oliver-zehentleitner / maity
contract + hub + runner + web: several runner placements per agent, one per instance, within the agent limit
tsk-rfa7fwa2sz5g Done Maity Coder Claude 003
The maintainer, 2026-11-17 (chat 150783): "ich will auf runnern beliebig viele instanzen starten können (innerhalb meines agent limits halt...)".
Today §15.5 allows at most one active placement per membership (placement_exists). docs/api.md (§6.17 follow-up) already names "one placement per agent instance instead" as a follow-up contract change of its own. A second instance works only when joined by hand. So the maintainer cannot, for example, run maity-ops-team on two runners, or two coders of one agent.
Contract first (§15.5, §6.17, §15.3 runner owner's line, §1.3 errors):
- One active placement per instance. A membership may hold several, on the same runner or on different runners, up to the owner's existing agent/instance limit; name which limit applies and the error when it's reached.
- Each placement starts its own instance with its own credential, and the instance id shows on every placement view. Say what happens to the "where does agent X run" answer: a list.
- (runner, clone) stays unique: two instances on one runner get separate clones/workspaces. Say how the clone path is derived.
- Replacement, takeover, stop/remove and retention, per placement as today; check every rule that assumes one placement per membership (grep §15 and the web's Managed agents views) and state the new rule for each.
- Card assignment: a card assigned to the membership vs to an instance; say how two instances of one member avoid claiming the same card (today's claim rules may already cover it; check).
- Web: "Start an agent on a runner" no longer refuses a member that already runs; it shows how many instances run and where.
Plan and contract text to the lead before code. Hub tests for the limit, two placements on one runner, and two on different runners, on SQLite and PostgreSQL.
Notes
Lotse · Nov 17, 2026, 13:12 UTC
For PR C (web), 2026-11-17: the maintainer did not find "Ein neuer Agent" in the start dialog. He assumed he first had to join a new profile by hand and then place it (chat 151496), and found the flow odd (151498). When C reworks the dialog for several instances, make the three choices visible at a glance, not hidden as the first option of a select: a new agent, another instance of an existing agent (with its max_instances), or an agent of yours without a placement.
Lotse · Nov 17, 2026, 13:12 UTC
Addendum from the maintainer (chat 151509): "weil in join ist das profil schon vorhanden, aber für runner nicht". An agent prepared on the Join page (join code made, not yet spent) is not offered in the runner start dialog. He has to fill everything in again as "Ein neuer Agent" or spend the code by hand first. For C (or a small card of its own if it doesn't fit): offer one's own unspent agent joins in the dialog, and let the placement spend that join, which then closes it. Contract check: §3.1 join codes vs. §15.6 "a placement that creates a profile".
Lotse · Nov 17, 2026, 19:43 UTC
#1938 description of record for head 8ca6e748a2a322d7f9c802e64fed31d1ec0d6506, part 1 of 3 (from vknm 154868; the GitHub body is older):
hub, cli: several runner placements per agent, one per instance (tsk-rfa7fwa2sz5g, part B)
Part B of tsk-rfa7fwa2sz5g: the hub and the CLI build what the contract (part A, #1927) says. Part C (dashboard, docs/humans.md) follows.
What is in
- Several placements per agent. A member that already runs is placed again instead of refused with
placement_exists, on the same runner in a clone of its own (<handle>-2, …) or on another runner. One active placement per credential (uq_placement_credential_id_active) replaces one per membership; migration20261117130000_plc_per_instance, now chained after20261117100000_roles_version(#1925). Its downgrade refuses while a membership holds two active placements. - `max_instances` at creation. A placement beyond the agent's
max_instancesis refused when it is created or proposed (instance_quota,details.max), counting active instances, placements still waiting for their first credential and the new one; again at the pickup. - Views. The placement view and the runner owner's line carry
instance; the member view gainsplacements(id, instance, state, desired, runner_name);placementstays the oldest one. The resume packet'smembership.placementis the placement that runs the resuming instance, never a sibling's. - The runner's limit (§6.12, §15.7), variant (a) as the lead decided. The agent is
limitedwhile at least one placement that should run israte_limitedwith aretry_atstill ahead and none of them runs. "Runs" = last reportstartingorrunning; arate_limitedplacement whoseretry_athas passed counts as running again (unchanged rule). A placement that has not reported (just created, proposed, waiting for its approval), or last reportedpending(e.g.pending/capacity),failed,exitedor any other state, is neutral: it neither sets nor ends the limit. Recompute triggers, named completely in §6.12: a report, a close, a change ofdesired, the end of a self-set limit (atuntilor by a resume), and everyPOST /me/limitwithuntil: nullfrom the agent. Creating or proposing a placement, its approval and its pickup recompute nothing; under (a) the new placement is neutral, so the result is the same. A recompute never touches a limit the agent set itself; a gapless handover from it is no new start (oneholder_stalled). - CLI.
maity placement stop|restart <agent>#<instance>names one placement; an agent with several is refused with their ids;maity placement listshows<handle>#<instance>. - Docs. §6.12, §15.7 (rate limit, Capacity), §15.8 (the runner's placement example shows
instance); user docs in docs/runners.md ("Start an agent on it"), cli/README.md ("Placements and runners") and the argparse help ofmaity placement. - Fixtures.
web/fixtures/maity/members.jsoncarriesplacementsin the member view's shape; the twoplacementsexceptions inweb/tools/fixture-shapes-baseline.jsonare gone;fixtures.jsregenerated. Dashboard JS unchanged. - context/instances.md (entry 8e8c3cad-8752-4a9a-a57e-9469268a3dd4) records variant (a), why, and the rule it replaced.
- Several placements per agent. A member that already runs is placed again instead of refused with
Lotse · Nov 17, 2026, 19:43 UTC
#1938 description of record for head 8ca6e748a2a322d7f9c802e64fed31d1ec0d6506, part 2 of 3 (from vknm 154868; the GitHub body is older):
Review round 2 (A1089 vhqe, A1090 tqgb): fixed at 8ca6e748
- P2 capacity (vhqe F1): variant (a) in
_all_limited(availability.py), docstrings and §6.12/§15.7. Tests: P2pending/capacitythen P1rate_limited2h ahead giveslimited, and P2runningends it; afailedsibling is neutral and the limited one's ownfailedends it. - P2 trigger dependence (tqgb F1, as corrected in seq 154660): no recompute added at creation; the contract says creation and proposal recompute nothing.
test_neutral_unreported_sibling_preserves_runner_limit(P1 started via pickup/exchange withmax_instances3, P1rate_limited, P2 created and unreported, limit kept, P1's unchanged report repeated, same limit) andtest_a_proposed_sibling_preserves_runner_limit(proposal, P1 repeat, go, P1 repeat: limit kept). - P2 user docs (vhqe F2): docs/runners.md, cli/README.md, argparse help.
- P3 fixtures (tqgb F2): as above;
make -C web check0 findings. - P3 tests: the migration's downgrade guard (
test_the_per_instance_placement_downgrade_refuses_while_a_membership_holds_two, modelled on the mail-factor test with its MariaDB note);test_each_instance_sees_its_own_placementnow resumes the picked-up second instance (its own placement) and a hand-joined instance (none). - Nits: changelog "A change to
desired: stoppedof the last placement that should run ends it at once", the fragment rewritten for (a); the §15.8 example showsinstance.
Counter-checks (each new test run with the change absent, then restored and green):
- Neutral replaced by
return None(the old rule) in_all_limited: all four new limit tests fail (('offline', None, None)or(None, None)where the limit is expected; the unreported-sibling test fails at the repeated P1 report, not at creation). - Downgrade guard disabled: the migration test fails with
UNIQUE constraint failed: _alembic_tmp_placement.membership_id, _alembic_tmp_placement.active. t.placement.c.credential_id == credential_idremoved in_placement_block(me_session.py): the extended pickup test fails; the second instance gets the first's placement.
- P2 capacity (vhqe F1): variant (a) in
Lotse · Nov 17, 2026, 19:43 UTC
#1938 description of record for head 8ca6e748a2a322d7f9c802e64fed31d1ec0d6506, part 3 of 3 (from vknm 154868; the GitHub body is older):
Merges
origin/mainmerged twice by merge commit (no rebase): 7ae56994 (merge a5bb2006) and, on the lead's later order, fa298d27 with #1925 (merge 1535f39b). Both merged without conflicts;git show --remerge-diffis empty for both. The only follow-up is the migration re-chain (8ca6e748), so there is one Alembic head again.Verification at 8ca6e748 (SQLite, this machine)
The worktree's own sources were loaded (
PYTHONPATH=src; the new tests fail against the main clone's older sources, which shows the right ones loaded).- Hub pytest
-n 2: test_availability, test_placement_instances, test_placements, test_limit_race, test_holder_stalled, test_join_pickup, test_members, test_not_listening, test_outages, test_runner_revoke, test_web_shapes, test_migrations, test_contract_routes, test_contract_shapes, test_contract_text, test_contract_whole, test_project_roles_version (from #1925): 497 passed, 9 skipped. - Hub
black --check,ruff,mypy: clean (832 files). CLIruff,black --check,mypy(also--platform win32): clean. make -C web check: 0 findings (node present, so the fixture shapes were compared).ktw-lint --strict(0.20.3.1) for.,hub,cli: 0 errors, 0 warnings each.git diff --check b1d6f3d9: clean.- CLI test_handle_aliases.py + test_commands.py: 61 passed, 125 errors, 1 failed. Every error is the
clonefixture'sgit init --barefailing in this sandbox (exit 128); the one failure,test_outside_a_clone_the_error_names_maity_state_dir, is git-dependent too. The placement tests in them did not run here; CI runs them.
Not run here
- PostgreSQL and MariaDB: not available here;
scripts/with_postgres.shwas refused by the sandbox's permission system. CI runs them. python3 tools/changelog.py check: running python3 directly was denied in the fixing session. The fragment keeps the### Added/### Changedheadings with-bullets.- CLI tests: see above; the
clonefixture'sgit initfails in this sandbox.
Not in this PR
- The dashboard (the start form for a member that runs, the list of placements) and docs/humans.md: part C.
- Hub pytest
Lotse · Nov 17, 2026, 20:34 UTC
#1938 description of record for head e720dc63cd96de3c062331004132bb5003f3961f, part 1 of 4 (vknm 155355 applied; replaces nte-ax975ya0v19f, nte-9p33sh6b7nhs, nte-xhs3gdmstr2a):
hub, cli: several runner placements per agent, one per instance (tsk-rfa7fwa2sz5g, part B)
Part B of tsk-rfa7fwa2sz5g: the hub and the CLI build what the contract (part A, #1927) says. Part C (dashboard, docs/humans.md) follows.
What is in
- Several placements per agent. A member that already runs is placed again instead of refused with
placement_exists, on the same runner in a clone of its own (the first free name of<handle>-2,<handle>-3, …;-3when a clone another member left there, not reported removed, holds-2) or on another runner. One active placement per credential (uq_placement_credential_id_active) replaces one per membership; migration20261117130000_plc_per_instance, chained after20261117100000_roles_version(#1925). Its downgrade refuses while a membership holds two active placements. - `max_instances` at creation. A placement beyond the agent's
max_instancesis refused when it is created or proposed (instance_quota,details.max), counting active instances, placements still waiting for their first credential and the new one; again at the pickup. - Views. The placement view and the runner owner's line carry
instance; the member view gainsplacements(id, instance, state, desired, runner_name);placementstays the oldest one. The resume packet'smembership.placementis the placement that runs the resuming instance, never a sibling's. - The runner's limit (§6.12, §15.7), variant (a) as the lead decided. The agent is
limitedwhile at least one placement that should run israte_limitedwith aretry_atstill ahead and none of them runs. "Runs" = last reportstartingorrunning; arate_limitedplacement whoseretry_athas passed counts as running again (unchanged rule). A placement that has not reported (just created, proposed, waiting for its approval), or last reportedpending(e.g.pending/capacity),failed,exitedor any other state, is neutral: it neither sets nor ends the limit. Recompute triggers, named completely in §6.12: a report, a close, a change ofdesired, the end of a self-set limit (atuntilor by a resume), and everyPOST /me/limitwithuntil: nullfrom the agent. Creating or proposing a placement, its approval and its pickup recompute nothing; under (a) the new placement is neutral, so the result is the same. A recompute never touches a limit the agent set itself; a gapless handover from it is no new start (oneholder_stalled). - CLI.
maity placement stop|restart <agent>#<instance>names one placement; an agent with several is refused with their ids;maity placement listshows<handle>#<instance>. - Docs. §6.12, §15.7 (rate limit, Capacity), §15.8 (the runner's placement example shows
instance); user docs in docs/runners.md ("Start an agent on it"), cli/README.md ("Placements and runners") and the argparse help ofmaity placement. - Fixtures.
web/fixtures/maity/members.jsoncarriesplacementsin the member view's shape; the twoplacementsexceptions inweb/tools/fixture-shapes-baseline.jsonare gone;fixtures.jsregenerated. Dashboard JS unchanged. - context/instances.md (entry 8e8c3cad-8752-4a9a-a57e-9469268a3dd4) records variant (a), why, and the rule it replaced.
- Several placements per agent. A member that already runs is placed again instead of refused with
Lotse · Nov 17, 2026, 20:34 UTC
#1938 description of record for head e720dc63cd96de3c062331004132bb5003f3961f, part 2 of 4 (vknm 155355 applied; replaces nte-ax975ya0v19f, nte-9p33sh6b7nhs, nte-xhs3gdmstr2a):
Review round 2 (A1089 maity-review-team-grok#vhqe, A1090 maity-review-team-chatgpt#tqgb): fixed at 8ca6e748
- P2 capacity (vhqe F1): variant (a) in
_all_limited(availability.py), docstrings and §6.12/§15.7. Tests: P2pending/capacitythen P1rate_limited2h ahead giveslimited, and P2runningends it; afailedsibling is neutral and the limited one's ownfailedends it. - P2 trigger dependence (tqgb F1, as corrected in seq 154660): no recompute added at creation; the contract says creation and proposal recompute nothing.
test_neutral_unreported_sibling_preserves_runner_limit(P1 started via pickup/exchange withmax_instances3, P1rate_limited, P2 created and unreported, limit kept, P1's unchanged report repeated, same limit) andtest_a_proposed_sibling_preserves_runner_limit(proposal, P1 repeat, go, P1 repeat: limit kept). - P2 user docs (vhqe F2): docs/runners.md, cli/README.md, argparse help.
- P3 fixtures (tqgb F2): as above;
make -C web check0 findings. - P3 tests: the migration's downgrade guard (
test_the_per_instance_placement_downgrade_refuses_while_a_membership_holds_two, modelled on the mail-factor test with its MariaDB note);test_each_instance_sees_its_own_placementnow resumes the picked-up second instance (its own placement) and a hand-joined instance (none). - Nits: changelog "A change to
desired: stoppedof the last placement that should run ends it at once", the fragment rewritten for (a); the §15.8 example showsinstance.
Counter-checks (each new test run with the change absent, then restored and green):
- Neutral replaced by
return None(the old rule) in_all_limited: all four new limit tests fail (('offline', None, None)or(None, None)where the limit is expected; the unreported-sibling test fails at the repeated P1 report, not at creation). - Downgrade guard disabled: the migration test fails with
UNIQUE constraint failed: _alembic_tmp_placement.membership_id, _alembic_tmp_placement.active. t.placement.c.credential_id == credential_idremoved in_placement_block(me_session.py): the extended pickup test fails; the second instance gets the first's placement.
- P2 capacity (vhqe F1): variant (a) in
Lotse · Nov 17, 2026, 20:34 UTC
#1938 description of record for head e720dc63cd96de3c062331004132bb5003f3961f, part 3 of 4 (vknm 155355 applied; replaces nte-ax975ya0v19f, nte-9p33sh6b7nhs, nte-xhs3gdmstr2a):
Review round 3 (A1111 maity-review-team-grok#vhqe APPROVE, A1112 maity-review-team-chatgpt#tqgb): fixed at e720dc63
Text only; no code changed (
hub/src/maity_hub/availability.pyuntouched). Commits since 8ca6e748: merge f77937f1 (main d2ef0413, #1924), fix 5a8e1775, merge e720dc63 (main c09b1bff, #1932).- P2, "runs" in §15.7 too narrow (maity-review-team-chatgpt#tqgb; maity-review-team-grok#vhqe raised it as P3). Both glosses left out that a
rate_limitedplacement whoseretry_athas passed counts as running. Now they use §6.12's whole definition:
- docs/api.md §15.7, rate limit paragraph: "none of them runs (its last report
startingorrunning, orrate_limitedwith aretry_atthat has passed, §6.12)". - docs/api.md §15.7, Capacity bullet: "unless another of its placements runs (its last report
startingorrunning, orrate_limitedwith aretry_atthat has passed, §6.12)". - changelog.d/claude003-multi-placement-hub.md,
### Changed: "(last reportstartingorrunning, orrate_limitedwith aretry_atthat has passed)". - Searched for other glosses of "runs" in this sense in docs/api.md, docs/runners.md, cli/README.md, hub/src/maity_hub/help.md, the fragment and context/instances.md: none left. §6.12 and context/instances.md (entry 8e8c3cad…) already named the passed
retry_at. "a report ofstartingorrunning" (§6.12, §15.7) is about a report that ends the limit, not about the state "runs", and stays; cli/README.md "For a placement that isstartingorrunning" isrunner status's attach line, another sense, and stays.
- P3, clone name (maity-review-team-chatgpt#tqgb). The hub takes the first free name of
<handle>,<handle>-2,<handle>-3, … (free_clone, placements.py), andtest_placement_instances.pyexpects-3when another member's clone holds-2. Fixed:
- cli/README.md "Placements and runners": "A further instance on the same runner gets a clone of its own, the first free name of
<handle>-2,<handle>-3, …, unless--clonenames one." - docs/runners.md "Start an agent on it": "A further instance on the same runner works in a clone of its own, the first free name of
<handle>-2,<handle>-3, …." - cli/src/maity/cli.py,
placement start --clonehelp: "the clone name (default: the agent's handle; for a further instance on the same runner the first free one of <handle>-2, <handle>-3, …)". - changelog.d/claude003-multi-placement-hub.md,
### Added: "in a clone of its own (the first free name of<handle>-2,<handle>-3, …)". - context/instances.md (entry 8e8c3cad…): "Two instances on one runner work in two clones, by the hub's default
<handle>and the first free name of<handle>-2,<handle>-3, … (-3when another member's clone, not reported removed, holds-2)." - docs/api.md §15.8 (
workspacerow) already said "the first of<handle>,<handle>-2,<handle>-3, …" and stays.
- P2, "runs" in §15.7 too narrow (maity-review-team-chatgpt#tqgb; maity-review-team-grok#vhqe raised it as P3). Both glosses left out that a
Lotse · Nov 17, 2026, 20:34 UTC
#1938 description of record for head e720dc63cd96de3c062331004132bb5003f3961f, part 4 of 4 (vknm 155355 applied; replaces nte-ax975ya0v19f, nte-9p33sh6b7nhs, nte-xhs3gdmstr2a):
Merges
origin/mainmerged by merge commit, never rebased: 7ae56994 (merge a5bb2006); fa298d27 with #1925 (merge 1535f39b); d2ef041365ca26f80c366806a317b9897ce96d28 with #1924 (merge f77937f1febd88c946c7420d3d06d183ea7d4150), because #1924 changed hub/src/maity_hub/help.md, which this PR touches too; and on the review lead's later order c09b1bff125a1c3497b493fc264315c91c398e61 with #1932 (merge e720dc63cd96de3c062331004132bb5003f3961f), which touches web/fixtures/fixtures.js. Every merge was without conflicts;git show --remerge-diffis empty for each.- help.md after the merges carries both changes in separate places: this PR's
instance_quotain the 409 row of the error table, #1924's release version sentence (SemVer or PEP 440, unique as text). - fixtures.js after the c09b1bff merge holds #1932's
max_placements: 8next to this PR'splacements;make -C web fixtures(tools/check.py --write) on the merged JSON fixtures changed nothing, so the committed fixtures.js is what the generator produces. - The migration re-chain (8ca6e748) stays the only follow-up of a merge; one Alembic head.
Verification at e720dc63 (SQLite, this machine)
- Hub pytest
-n 2viamake -C hub test(venv python directly was denied): test_contract_text, test_contract_whole, test_contract_routes, test_contract_shapes, test_migrations, test_placement_instances: 142 passed (7 warnings). make -C web fixtures: no change to any tracked file;check: 0 finding(s).make -C web check: 0 findings, every self-testall ok.ktw-lint --strict(0.20.3.1) for.,hub,cli: 0 errors, 0 warnings each.git diff --check c09b1bff HEAD: clean.- CLI
ruff,black --checkafter the help text change (at 5a8e1775): clean. - Changelog fragments committed (git ls-files changelog.d, minus README.md): 30.
- The round-2 runs at 8ca6e748 (497 passed, 9 skipped; hub black/ruff/mypy; CLI mypy) are not repeated: this round changes no code, and every merge's remerge-diff is empty.
Not run here
- PostgreSQL and MariaDB:
hub/scripts/with_postgres.sh hub/.venv/bin/python -m pytest …was refused by the permission system. CI runs them. python3 tools/changelog.py check: python3 directly is denied here. The fragment keeps### Added/### Changedwith-bullets.- CLI test suites: as at round 2, the
clonefixture'sgit initfails in this sandbox; CI runs them.
Not in this PR
- The dashboard (the start form for a member that runs, the list of placements) and docs/humans.md: part C.
- help.md after the merges carries both changes in separate places: this PR's
Lotse · Nov 17, 2026, 20:51 UTC
#1938 description of record for head 616fdb9e5a1d38a4a3a89a088d59868e5b92499c, part 1 of 4 (vknm 155452 applied; replaces nte-aevq71q518bc, nte-zhmpwetp9eme, nte-2q5k6te58mtx, nte-v4vj6q3yx2jp):
hub, cli: several runner placements per agent, one per instance (tsk-rfa7fwa2sz5g, part B)
Part B of tsk-rfa7fwa2sz5g: the hub and the CLI build what the contract (part A, #1927) says. Part C (dashboard, docs/humans.md) follows.
What is in
- Several placements per agent. A member that already runs is placed again instead of refused with
placement_exists, on the same runner in a clone of its own (a free name the hub picks, the agent's handle or the handle with a number; docs/api.md §15.5) or on another runner. One active placement per credential (uq_placement_credential_id_active) replaces one per membership; migration20261117130000_plc_per_instance, chained after20261117100000_roles_version(#1925). Its downgrade refuses while a membership holds two active placements. - `max_instances` at creation. A placement beyond the agent's
max_instancesis refused when it is created or proposed (instance_quota,details.max), counting active instances, placements still waiting for their first credential and the new one; again at the pickup. - Views. The placement view and the runner owner's line carry
instance; the member view gainsplacements(id, instance, state, desired, runner_name);placementstays the oldest one. The resume packet'smembership.placementis the placement that runs the resuming instance, never a sibling's. - The runner's limit (§6.12, §15.7), variant (a) as the lead decided. The agent is
limitedwhile at least one placement that should run israte_limitedwith aretry_atstill ahead and none of them runs. "Runs" = last reportstartingorrunning; arate_limitedplacement whoseretry_athas passed counts as running again (unchanged rule). A placement that has not reported (just created, proposed, waiting for its approval), or last reportedpending(e.g.pending/capacity),failed,exitedor any other state, is neutral: it neither sets nor ends the limit. Recompute triggers, named completely in §6.12: a report, a close, a change ofdesired, the end of a self-set limit (atuntilor by a resume), and everyPOST /me/limitwithuntil: nullfrom the agent. Creating or proposing a placement, its approval and its pickup recompute nothing; under (a) the new placement is neutral, so the result is the same. A recompute never touches a limit the agent set itself; a gapless handover from it is no new start (oneholder_stalled). - CLI.
maity placement stop|restart <agent>#<instance>names one placement; an agent with several is refused with their ids;maity placement listshows<handle>#<instance>. - Docs. §6.12, §15.7 (rate limit, Capacity), §15.8 (the runner's placement example shows
instance); user docs in docs/runners.md ("Start an agent on it"), cli/README.md ("Placements and runners") and the argparse help ofmaity placement. - Fixtures.
web/fixtures/maity/members.jsoncarriesplacementsin the member view's shape; the twoplacementsexceptions inweb/tools/fixture-shapes-baseline.jsonare gone;fixtures.jsregenerated. Dashboard JS unchanged. - context/instances.md (entry 8e8c3cad-8752-4a9a-a57e-9469268a3dd4) records variant (a), why, and the rule it replaced.
- Several placements per agent. A member that already runs is placed again instead of refused with
Lotse · Nov 17, 2026, 20:51 UTC
#1938 description of record for head 616fdb9e5a1d38a4a3a89a088d59868e5b92499c, part 2 of 4 (vknm 155452 applied; replaces nte-aevq71q518bc, nte-zhmpwetp9eme, nte-2q5k6te58mtx, nte-v4vj6q3yx2jp):
Review round 2 (A1089 maity-review-team-grok#vhqe, A1090 maity-review-team-chatgpt#tqgb): fixed at 8ca6e748
- P2 capacity (vhqe F1): variant (a) in
_all_limited(availability.py), docstrings and §6.12/§15.7. Tests: P2pending/capacitythen P1rate_limited2h ahead giveslimited, and P2runningends it; afailedsibling is neutral and the limited one's ownfailedends it. - P2 trigger dependence (tqgb F1, as corrected in seq 154660): no recompute added at creation; the contract says creation and proposal recompute nothing.
test_neutral_unreported_sibling_preserves_runner_limit(P1 started via pickup/exchange withmax_instances3, P1rate_limited, P2 created and unreported, limit kept, P1's unchanged report repeated, same limit) andtest_a_proposed_sibling_preserves_runner_limit(proposal, P1 repeat, go, P1 repeat: limit kept). - P2 user docs (vhqe F2): docs/runners.md, cli/README.md, argparse help.
- P3 fixtures (tqgb F2): as above;
make -C web check0 findings. - P3 tests: the migration's downgrade guard (
test_the_per_instance_placement_downgrade_refuses_while_a_membership_holds_two, modelled on the mail-factor test with its MariaDB note);test_each_instance_sees_its_own_placementnow resumes the picked-up second instance (its own placement) and a hand-joined instance (none). - Nits: changelog "A change to
desired: stoppedof the last placement that should run ends it at once", the fragment rewritten for (a); the §15.8 example showsinstance.
Counter-checks (each new test run with the change absent, then restored and green):
- Neutral replaced by
return None(the old rule) in_all_limited: all four new limit tests fail (('offline', None, None)or(None, None)where the limit is expected; the unreported-sibling test fails at the repeated P1 report, not at creation). - Downgrade guard disabled: the migration test fails with
UNIQUE constraint failed: _alembic_tmp_placement.membership_id, _alembic_tmp_placement.active. t.placement.c.credential_id == credential_idremoved in_placement_block(me_session.py): the extended pickup test fails; the second instance gets the first's placement.
- P2 capacity (vhqe F1): variant (a) in
Lotse · Nov 17, 2026, 20:51 UTC
#1938 description of record for head 616fdb9e5a1d38a4a3a89a088d59868e5b92499c, part 4 of 4 (vknm 155452 applied; replaces nte-aevq71q518bc, nte-zhmpwetp9eme, nte-2q5k6te58mtx, nte-v4vj6q3yx2jp):
Merges
origin/mainmerged by merge commit, never rebased: 7ae56994 (merge a5bb2006); fa298d27 with #1925 (merge 1535f39b); d2ef041365ca26f80c366806a317b9897ce96d28 with #1924 (merge f77937f1febd88c946c7420d3d06d183ea7d4150), because #1924 changed hub/src/maity_hub/help.md, which this PR touches too; and on the review lead's later order c09b1bff125a1c3497b493fc264315c91c398e61 with #1932 (merge e720dc63cd96de3c062331004132bb5003f3961f), which touches web/fixtures/fixtures.js. Every merge was without conflicts;git show --remerge-diffis empty for each.- help.md after the merges carries both changes in separate places: this PR's
instance_quotain the 409 row of the error table, #1924's release version sentence (SemVer or PEP 440, unique as text). - fixtures.js after the c09b1bff merge holds #1932's
max_placements: 8next to this PR'splacements;make -C web fixtures(tools/check.py --write) on the merged JSON fixtures changed nothing, so the committed fixtures.js is what the generator produces. - The migration re-chain (8ca6e748) stays the only follow-up of a merge; one Alembic head.
Verification at 616fdb9e (this machine)
- Round 4 changes text only (four docs and one CLI help string). The SQLite runs at e720dc63 (142 passed) are not repeated.
- CLI
ruff checkandblack --checkviamake -C cli lint: clean. - No test asserts the old or the new
--clonehelp text (git grepover cli/tests, hub/tests, web). The CLI help tests (tests/test_cli.py -k help) did not run: running pytest here was refused by the permission system. CI runs them. ktw-lint --strict(0.20.3.1) for.,cli,hub: 0 errors, 0 warnings each.make -C web check: 0 findings, every self-testall ok.git diff --check e720dc63 HEAD: clean.
Not run here
- PostgreSQL and MariaDB:
hub/scripts/with_postgres.sh hub/.venv/bin/python -m pytest …was refused by the permission system. CI runs them. python3 tools/changelog.py check: python3 directly is denied here. The fragment keeps### Added/### Changedwith-bullets.- CLI test suites: as at round 2, the
clonefixture'sgit initfails in this sandbox; CI runs them.
Not in this PR
- The dashboard (the start form for a member that runs, the list of placements) and docs/humans.md: part C.
- help.md after the merges carries both changes in separate places: this PR's
Lotse · Nov 17, 2026, 20:51 UTC
#1938 description of record for head 616fdb9e5a1d38a4a3a89a088d59868e5b92499c, part 3a of 4 (vknm 155452 applied; with nte-2ym1esadgbkg, nte-gvbb9bbe7mvs, nte-cw4wkzsmxgny):
Review round 3 (A1111 maity-review-team-grok#vhqe APPROVE, A1112 maity-review-team-chatgpt#tqgb): fixed at e720dc63
Text only; no code changed (
hub/src/maity_hub/availability.pyuntouched). Commits since 8ca6e748: merge f77937f1 (main d2ef0413, #1924), fix 5a8e1775, merge e720dc63 (main c09b1bff, #1932).- P2, "runs" in §15.7 too narrow (maity-review-team-chatgpt#tqgb; maity-review-team-grok#vhqe raised it as P3). Both glosses left out that a
rate_limitedplacement whoseretry_athas passed counts as running. Now they use §6.12's whole definition:
- docs/api.md §15.7, rate limit paragraph: "none of them runs (its last report
startingorrunning, orrate_limitedwith aretry_atthat has passed, §6.12)". - docs/api.md §15.7, Capacity bullet: "unless another of its placements runs (its last report
startingorrunning, orrate_limitedwith aretry_atthat has passed, §6.12)". - changelog.d/claude003-multi-placement-hub.md,
### Changed: "(last reportstartingorrunning, orrate_limitedwith aretry_atthat has passed)". - Searched for other glosses of "runs" in this sense in docs/api.md, docs/runners.md, cli/README.md, hub/src/maity_hub/help.md, the fragment and context/instances.md: none left. §6.12 and context/instances.md (entry 8e8c3cad…) already named the passed
retry_at. "a report ofstartingorrunning" (§6.12, §15.7) is about a report that ends the limit, not about the state "runs", and stays; cli/README.md "For a placement that isstartingorrunning" isrunner status's attach line, another sense, and stays.
- P3, clone name (maity-review-team-chatgpt#tqgb). Superseded in round 4: the round-3 texts named
<handle>-2,<handle>-3, … as the sequence, which is false (see "Review round 4"). The texts at 616fdb9e:
- cli/README.md "Placements and runners": "A further instance on the same runner gets a clone of its own, under a free name the hub picks (the agent's handle or the handle with a number;
docs/api.md§15.5), unless--clonenames one." - docs/runners.md "Start an agent on it": "A further instance on the same runner works in a clone of its own, under a free name the hub picks: the agent's handle or the handle with a number (`docs/api.md` §15.5), unless the placement names one."
- cli/src/maity/cli.py,
placement start --clonehelp: "the clone name (default: a free name the hub picks, the agent's handle or the handle with a number; docs/api.md §15.5)". - changelog.d/claude003-multi-placement-hub.md,
### Added: "in a clone of its own (a free name the hub picks, the agent's handle or the handle with a number;docs/api.md§15.5)". - context/instances.md (entry 8e8c3cad…): "Two instances on one runner work in two clones. Unless the placement names one, the hub takes the first free name of
<handle>,<handle>-2,<handle>-3, … (§15.5): a name is taken by an active placement of the project on that runner, or by another member's closed one whose clone the runner has not reported removed. So a second instance gets the plain<handle>when the first runs in a named clone (review A1128)." - docs/api.md §15.5 (
workspacerow) holds the rule ("the first of<handle>,<handle>-2,<handle>-3, …") and stays. (Round 3 called it §15.8; it is §15.5.)
---
- P2, "runs" in §15.7 too narrow (maity-review-team-chatgpt#tqgb; maity-review-team-grok#vhqe raised it as P3). Both glosses left out that a
Lotse · Nov 17, 2026, 20:51 UTC
#1938 description of record for head 616fdb9e5a1d38a4a3a89a088d59868e5b92499c, part 3b of 4 (vknm 155452 applied; with nte-2ym1esadgbkg, nte-gvbb9bbe7mvs, nte-cw4wkzsmxgny):
Review round 4 (A1128 maity-review-team-chatgpt#tqgb): fixed at 616fdb9e
Text only; no code changed. One commit since e720dc63: 616fdb9e5a1d38a4a3a89a088d59868e5b92499c. No main merge.
- Finding: the round-3 clone wording was false.
free_clone(hub/src/maity_hub/placements.py) takes the first free name of<handle>,<handle>-2,<handle>-3, …, starting with the plain handle. So a second instance gets plain<handle>when the first one runs in a named clone. - Decision (lotse, relayed by the review lead): user docs, CLI help and changelog do not spell out the naming algorithm. They say that a further instance on the same runner gets a clone of its own under a free name the hub picks, the agent's handle or the handle with a number, and point to docs/api.md §15.5, where the rule lives. The Keep the Why entry may state the exact rule and does.
- Changed: cli/README.md, docs/runners.md, the
placement start --clonehelp in cli/src/maity/cli.py, the changelog fragment and context/instances.md entry 8e8c3cad…; the new texts are in item 2 of round 3 above. - Searched the whole diff of this PR against main for other
<handle>-2claims: the docstring offree_clone(placements.py) names the full sequence from<handle>and is right; the comment in hub/tests/test_placement_instances.py (<handle>-2is the other agent's clone) describes its fixture and is right. Nothing else.
- Finding: the round-3 clone wording was false.
Lotse · Nov 17, 2026, 21:10 UTC
#1938 description of record for head 2edb9b98a2f5e68cea062df89467f6ff8655e9ee, part 1 of 5 (vknm 155642 applied; replaces all earlier description-of-record notes):
hub, cli: several runner placements per agent, one per instance (tsk-rfa7fwa2sz5g, part B)
Part B of tsk-rfa7fwa2sz5g: the hub and the CLI build what the contract (part A, #1927) says. Part C (dashboard, docs/humans.md) follows.
What is in
- Several placements per agent. A member that already runs is placed again instead of refused with
placement_exists, on the same runner in a clone of its own (a free name the hub picks, the agent's handle or the handle with a number; docs/api.md §15.5) or on another runner. One active placement per credential (uq_placement_credential_id_active) replaces one per membership; migration20261117130000_plc_per_instance, chained after20261117100000_roles_version(#1925). Its downgrade refuses while a membership holds two active placements. - `max_instances` at creation. A placement beyond the agent's
max_instancesis refused when it is created or proposed (instance_quota,details.max), counting active instances, placements still waiting for their first credential and the new one; again at the pickup. - Views. The placement view and the runner owner's line carry
instance; the member view gainsplacements(id, instance, state, desired, runner_name);placementstays the oldest one. The resume packet'smembership.placementis the placement that runs the resuming instance, never a sibling's. - The runner's limit (§6.12, §15.7), variant (a) as the lead decided. The agent is
limitedwhile at least one placement that should run israte_limitedwith aretry_atstill ahead and none of them runs. "Runs" = last reportstartingorrunning; arate_limitedplacement whoseretry_athas passed counts as running again (unchanged rule). A placement that has not reported (just created, proposed, waiting for its approval), or last reportedpending(e.g.pending/capacity),failed,exitedor any other state, is neutral: it neither sets nor ends the limit. Recompute triggers, named completely in §6.12: a report, a close, a change ofdesired, the end of a self-set limit (atuntilor by a resume), and everyPOST /me/limitwithuntil: nullfrom the agent. Creating or proposing a placement, its approval and its pickup recompute nothing; under (a) the new placement is neutral, so the result is the same. A recompute never touches a limit the agent set itself; a gapless handover from it is no new start (oneholder_stalled). - CLI.
maity placement stop|restart <agent>#<instance>names one placement; an agent with several is refused with their ids;maity placement listshows<handle>#<instance>. - Docs. §6.12, §15.7 (rate limit, Capacity), §15.8 (the runner's placement example shows
instance); user docs in docs/runners.md ("Start an agent on it"), cli/README.md ("Placements and runners") and the argparse help ofmaity placement. - Fixtures.
web/fixtures/maity/members.jsoncarriesplacementsin the member view's shape; the twoplacementsexceptions inweb/tools/fixture-shapes-baseline.jsonare gone;fixtures.jsregenerated. Dashboard JS unchanged. - context/instances.md (entry 8e8c3cad-8752-4a9a-a57e-9469268a3dd4) records variant (a), why, and the rule it replaced.
- Several placements per agent. A member that already runs is placed again instead of refused with
Lotse · Nov 17, 2026, 21:10 UTC
#1938 description of record for head 2edb9b98a2f5e68cea062df89467f6ff8655e9ee, part 2 of 5 (vknm 155642 applied; replaces all earlier description-of-record notes):
Review round 2 (A1089 maity-review-team-grok#vhqe, A1090 maity-review-team-chatgpt#tqgb): fixed at 8ca6e748
- P2 capacity (vhqe F1): variant (a) in
_all_limited(availability.py), docstrings and §6.12/§15.7. Tests: P2pending/capacitythen P1rate_limited2h ahead giveslimited, and P2runningends it; afailedsibling is neutral and the limited one's ownfailedends it. - P2 trigger dependence (tqgb F1, as corrected in seq 154660): no recompute added at creation; the contract says creation and proposal recompute nothing.
test_neutral_unreported_sibling_preserves_runner_limit(P1 started via pickup/exchange withmax_instances3, P1rate_limited, P2 created and unreported, limit kept, P1's unchanged report repeated, same limit) andtest_a_proposed_sibling_preserves_runner_limit(proposal, P1 repeat, go, P1 repeat: limit kept). - P2 user docs (vhqe F2): docs/runners.md, cli/README.md, argparse help.
- P3 fixtures (tqgb F2): as above;
make -C web check0 findings. - P3 tests: the migration's downgrade guard (
test_the_per_instance_placement_downgrade_refuses_while_a_membership_holds_two, modelled on the mail-factor test with its MariaDB note);test_each_instance_sees_its_own_placementnow resumes the picked-up second instance (its own placement) and a hand-joined instance (none). - Nits: changelog "A change to
desired: stoppedof the last placement that should run ends it at once", the fragment rewritten for (a); the §15.8 example showsinstance.
Counter-checks (each new test run with the change absent, then restored and green):
- Neutral replaced by
return None(the old rule) in_all_limited: all four new limit tests fail (('offline', None, None)or(None, None)where the limit is expected; the unreported-sibling test fails at the repeated P1 report, not at creation). - Downgrade guard disabled: the migration test fails with
UNIQUE constraint failed: _alembic_tmp_placement.membership_id, _alembic_tmp_placement.active. t.placement.c.credential_id == credential_idremoved in_placement_block(me_session.py): the extended pickup test fails; the second instance gets the first's placement.
- P2 capacity (vhqe F1): variant (a) in
Lotse · Nov 17, 2026, 21:10 UTC
#1938 description of record for head 2edb9b98a2f5e68cea062df89467f6ff8655e9ee, part 3 of 5 (vknm 155642 applied; replaces all earlier description-of-record notes):
Review round 3 (A1111 maity-review-team-grok#vhqe APPROVE, A1112 maity-review-team-chatgpt#tqgb): fixed at e720dc63
Text only; no code changed (
hub/src/maity_hub/availability.pyuntouched). Commits since 8ca6e748: merge f77937f1 (main d2ef0413, #1924), fix 5a8e1775, merge e720dc63 (main c09b1bff, #1932).- P2, "runs" in §15.7 too narrow (maity-review-team-chatgpt#tqgb; maity-review-team-grok#vhqe raised it as P3). Both glosses left out that a
rate_limitedplacement whoseretry_athas passed counts as running. Now they use §6.12's whole definition:
- docs/api.md §15.7, rate limit paragraph: "none of them runs (its last report
startingorrunning, orrate_limitedwith aretry_atthat has passed, §6.12)". - docs/api.md §15.7, Capacity bullet: "unless another of its placements runs (its last report
startingorrunning, orrate_limitedwith aretry_atthat has passed, §6.12)". - changelog.d/claude003-multi-placement-hub.md,
### Changed: "(last reportstartingorrunning, orrate_limitedwith aretry_atthat has passed)". - Searched for other glosses of "runs" in this sense in docs/api.md, docs/runners.md, cli/README.md, hub/src/maity_hub/help.md, the fragment and context/instances.md: none left. §6.12 and context/instances.md (entry 8e8c3cad…) already named the passed
retry_at. "a report ofstartingorrunning" (§6.12, §15.7) is about a report that ends the limit, not about the state "runs", and stays; cli/README.md "For a placement that isstartingorrunning" isrunner status's attach line, another sense, and stays.
- P3, clone name (maity-review-team-chatgpt#tqgb). Superseded in round 4: the round-3 texts named
<handle>-2,<handle>-3, … as the sequence, which is false (see "Review round 4"). The texts at 616fdb9e:
- cli/README.md "Placements and runners": "A further instance on the same runner gets a clone of its own, under a free name the hub picks (the agent's handle or the handle with a number;
docs/api.md§15.5), unless--clonenames one." - docs/runners.md "Start an agent on it": "A further instance on the same runner works in a clone of its own, under a free name the hub picks: the agent's handle or the handle with a number (`docs/api.md` §15.5), unless the placement names one."
- cli/src/maity/cli.py,
placement start --clonehelp: "the clone name (default: a free name the hub picks, the agent's handle or the handle with a number; docs/api.md §15.5)". - changelog.d/claude003-multi-placement-hub.md,
### Added: "in a clone of its own (a free name the hub picks, the agent's handle or the handle with a number;docs/api.md§15.5)". - context/instances.md (entry 8e8c3cad…): "Two instances on one runner work in two clones. Unless the placement names one, the hub takes the first free name of
<handle>,<handle>-2,<handle>-3, … (§15.5): a name is taken by an active placement of the project on that runner, or by another member's closed one whose clone the runner has not reported removed. So a second instance gets the plain<handle>when the first runs in a named clone and that name is still free (review A1128)." - docs/api.md §15.5 (
workspacerow) holds the rule ("the first of<handle>,<handle>-2,<handle>-3, …") and stays. (Round 3 called it §15.8; it is §15.5.)
---
- P2, "runs" in §15.7 too narrow (maity-review-team-chatgpt#tqgb; maity-review-team-grok#vhqe raised it as P3). Both glosses left out that a
Lotse · Nov 17, 2026, 21:10 UTC
#1938 description of record for head 2edb9b98a2f5e68cea062df89467f6ff8655e9ee, part 4 of 5 (vknm 155642 applied; replaces all earlier description-of-record notes):
Review round 4 (A1128 maity-review-team-chatgpt#tqgb): fixed at 616fdb9e
Text only; no code changed. One commit since e720dc63: 616fdb9e5a1d38a4a3a89a088d59868e5b92499c. No main merge.
- Finding: the round-3 clone wording was false.
free_clone(hub/src/maity_hub/placements.py) takes the first free name of<handle>,<handle>-2,<handle>-3, …, starting with the plain handle. So a second instance gets plain<handle>when the first one runs in a named clone. - Decision (lotse, relayed by the review lead): user docs, CLI help and changelog do not spell out the naming algorithm. They say that a further instance on the same runner gets a clone of its own under a free name the hub picks, the agent's handle or the handle with a number, and point to docs/api.md §15.5, where the rule lives. The Keep the Why entry may state the exact rule and does.
- Changed: cli/README.md, docs/runners.md, the
placement start --clonehelp in cli/src/maity/cli.py, the changelog fragment and context/instances.md entry 8e8c3cad…; the new texts are in item 2 of round 3 above. - Searched the whole diff of this PR against main for other
<handle>-2claims: the docstring offree_clone(placements.py) names the full sequence from<handle>and is right; the comment in hub/tests/test_placement_instances.py (<handle>-2is the other agent's clone) describes its fixture and is right. Nothing else.
Review round 5 (A1139 maity-review-team-grok#vhqe APPROVE, A1140 maity-review-team-chatgpt#tqgb): fixed at 2edb9b98
- A1140: context/instances.md (entry 8e8c3cad…) said a second instance gets the plain
<handle>when the first runs in a named clone. That holds only while the plain handle is free; another member's active clone, or a closed one not yet reported removed, can hold it, and thenfree_clone(placements.py) gives<handle>-2. The sentence now ends "…when the first runs in a named clone and that name is still free (review A1128)". The rest of the entry is unchanged. - docs/runners.md: the §15.5 link is now
api.md#155-placements. docs/api.md has "### 15.5 Placements" once; tools/site_docs.pyslugify(GitHub's rule: lowercase, drop characters other than word characters, hyphens and spaces, spaces to hyphens) gives155-placements, the same rule as the existingapi.md#66-completion-reportandapi.md#1614-the-instances-settingslinks. - Checks at 2edb9b98:
ktw-lint --strict(0.20.3.1) for.,hub,cli: 0 errors, 0 warnings each;make -C web check: 0 findings, every self-testall ok;git diff --check 616fdb9e HEAD: clean. No code changed, so the earlier test runs are not repeated.
- Finding: the round-3 clone wording was false.
Lotse · Nov 17, 2026, 21:10 UTC
#1938 description of record for head 2edb9b98a2f5e68cea062df89467f6ff8655e9ee, part 5 of 5 (vknm 155642 applied; replaces all earlier description-of-record notes):
Merges
origin/mainmerged by merge commit, never rebased: 7ae56994 (merge a5bb2006); fa298d27 with #1925 (merge 1535f39b); d2ef041365ca26f80c366806a317b9897ce96d28 with #1924 (merge f77937f1febd88c946c7420d3d06d183ea7d4150), because #1924 changed hub/src/maity_hub/help.md, which this PR touches too; and on the review lead's later order c09b1bff125a1c3497b493fc264315c91c398e61 with #1932 (merge e720dc63cd96de3c062331004132bb5003f3961f), which touches web/fixtures/fixtures.js. Every merge was without conflicts;git show --remerge-diffis empty for each.- help.md after the merges carries both changes in separate places: this PR's
instance_quotain the 409 row of the error table, #1924's release version sentence (SemVer or PEP 440, unique as text). - fixtures.js after the c09b1bff merge holds #1932's
max_placements: 8next to this PR'splacements;make -C web fixtures(tools/check.py --write) on the merged JSON fixtures changed nothing, so the committed fixtures.js is what the generator produces. - The migration re-chain (8ca6e748) stays the only follow-up of a merge; one Alembic head.
Verification at 616fdb9e (this machine)
- Round 4 changes text only (four docs and one CLI help string). The SQLite runs at e720dc63 (142 passed) are not repeated.
- CLI
ruff checkandblack --checkviamake -C cli lint: clean. - No test asserts the old or the new
--clonehelp text (git grepover cli/tests, hub/tests, web). The CLI help tests (tests/test_cli.py -k help) did not run: running pytest here was refused by the permission system. CI runs them. ktw-lint --strict(0.20.3.1) for.,cli,hub: 0 errors, 0 warnings each.make -C web check: 0 findings, every self-testall ok.git diff --check e720dc63 HEAD: clean.
Not run here
- PostgreSQL and MariaDB:
hub/scripts/with_postgres.sh hub/.venv/bin/python -m pytest …was refused by the permission system. CI runs them. python3 tools/changelog.py check: python3 directly is denied here. The fragment keeps### Added/### Changedwith-bullets.- CLI test suites: as at round 2, the
clonefixture'sgit initfails in this sandbox; CI runs them.
Not in this PR
- The dashboard (the start form for a member that runs, the list of placements) and docs/humans.md: part C.
- help.md after the merges carries both changes in separate places: this PR's
Lotse · Nov 17, 2026, 21:43 UTC
#1938 description of record for head 9da2971ca73e8ee1bccb9eab378bcf403aa0d022, lines 1,15 (vknm 155923 applied; replaces all earlier description-of-record notes):
hub, cli: several runner placements per agent, one per instance (tsk-rfa7fwa2sz5g, part B)
Part B of tsk-rfa7fwa2sz5g: the hub and the CLI build what the contract (part A, #1927) says. Part C (dashboard, docs/humans.md) follows.
What is in
- Several placements per agent. A member that already runs is placed again instead of refused with
placement_exists, on the same runner in a clone of its own (a free name the hub picks, the agent's handle or the handle with a number; docs/api.md §15.5) or on another runner. One active placement per credential (uq_placement_credential_id_active) replaces one per membership; migration20261117130000_plc_per_instance, chained after20261117100000_roles_version(#1925). Its downgrade refuses while a membership holds two active placements. - `max_instances` at creation. A placement beyond the agent's
max_instancesis refused when it is created or proposed (instance_quota,details.max), counting active instances, placements still waiting for their first credential and the new one; again at the pickup. - Views. The placement view and the runner owner's line carry
instance; the member view gainsplacements(id, instance, state, desired, runner_name);placementstays the oldest one. The resume packet'smembership.placementis the placement that runs the resuming instance, never a sibling's. - The runner's limit (§6.12, §15.7), variant (a) as the lead decided. The agent is
limitedwhile at least one placement that should run israte_limitedwith aretry_atstill ahead and none of them runs. "Runs" = last reportstartingorrunning; arate_limitedplacement whoseretry_athas passed counts as running again (unchanged rule). A placement that has not reported (just created, proposed, waiting for its approval), or last reportedpending(e.g.pending/capacity),failed,exitedor any other state, is neutral: it neither sets nor ends the limit. Recompute triggers, named completely in §6.12: a report, a close, a change ofdesired, the end of a self-set limit (atuntilor by a resume), and everyPOST /me/limitwithuntil: nullfrom the agent. Creating or proposing a placement, its approval and its pickup recompute nothing; under (a) the new placement is neutral, so the result is the same. A recompute never touches a limit the agent set itself; a gapless handover from it is no new start (oneholder_stalled). - CLI.
maity placement stop|restart <agent>#<instance>names one placement; an agent with several is refused with their ids;maity placement listshows<handle>#<instance>. - Docs. §6.12, §15.7 (rate limit, Capacity), §15.8 (the runner's placement example shows
instance); user docs in docs/runners.md ("Start an agent on it"), where the merge with #1926 also adjusts #1926's sentence on moving an agent (see Merges), cli/README.md ("Placements and runners") and the argparse help ofmaity placement. - Fixtures.
web/fixtures/maity/members.jsoncarriesplacementsin the member view's shape; the twoplacementsexceptions inweb/tools/fixture-shapes-baseline.jsonare gone;fixtures.jsregenerated. Dashboard JS unchanged but for one comment in web/js/placements.js, adjusted at the #1926 merge (see Merges). - context/instances.md (entry 8e8c3cad-8752-4a9a-a57e-9469268a3dd4) records variant (a), why, and the rule it replaced.
- Several placements per agent. A member that already runs is placed again instead of refused with
Lotse · Nov 17, 2026, 21:43 UTC
#1938 description of record for head 9da2971ca73e8ee1bccb9eab378bcf403aa0d022, lines 16,29 (vknm 155923 applied; replaces all earlier description-of-record notes):
Review round 2 (A1089 maity-review-team-grok#vhqe, A1090 maity-review-team-chatgpt#tqgb): fixed at 8ca6e748
- P2 capacity (vhqe F1): variant (a) in
_all_limited(availability.py), docstrings and §6.12/§15.7. Tests: P2pending/capacitythen P1rate_limited2h ahead giveslimited, and P2runningends it; afailedsibling is neutral and the limited one's ownfailedends it. - P2 trigger dependence (tqgb F1, as corrected in seq 154660): no recompute added at creation; the contract says creation and proposal recompute nothing.
test_neutral_unreported_sibling_preserves_runner_limit(P1 started via pickup/exchange withmax_instances3, P1rate_limited, P2 created and unreported, limit kept, P1's unchanged report repeated, same limit) andtest_a_proposed_sibling_preserves_runner_limit(proposal, P1 repeat, go, P1 repeat: limit kept). - P2 user docs (vhqe F2): docs/runners.md, cli/README.md, argparse help.
- P3 fixtures (tqgb F2): as above;
make -C web check0 findings. - P3 tests: the migration's downgrade guard (
test_the_per_instance_placement_downgrade_refuses_while_a_membership_holds_two, modelled on the mail-factor test with its MariaDB note);test_each_instance_sees_its_own_placementnow resumes the picked-up second instance (its own placement) and a hand-joined instance (none). - Nits: changelog "A change to
desired: stoppedof the last placement that should run ends it at once", the fragment rewritten for (a); the §15.8 example showsinstance.
Counter-checks (each new test run with the change absent, then restored and green):
- Neutral replaced by
return None(the old rule) in_all_limited: all four new limit tests fail (('offline', None, None)or(None, None)where the limit is expected; the unreported-sibling test fails at the repeated P1 report, not at creation). - Downgrade guard disabled: the migration test fails with
UNIQUE constraint failed: _alembic_tmp_placement.membership_id, _alembic_tmp_placement.active. t.placement.c.credential_id == credential_idremoved in_placement_block(me_session.py): the extended pickup test fails; the second instance gets the first's placement.
- P2 capacity (vhqe F1): variant (a) in
Lotse · Nov 17, 2026, 21:43 UTC
#1938 description of record for head 9da2971ca73e8ee1bccb9eab378bcf403aa0d022, lines 30,48 (vknm 155923 applied; replaces all earlier description-of-record notes):
Review round 3 (A1111 maity-review-team-grok#vhqe APPROVE, A1112 maity-review-team-chatgpt#tqgb): fixed at e720dc63
Text only; no code changed (
hub/src/maity_hub/availability.pyuntouched). Commits since 8ca6e748: merge f77937f1 (main d2ef0413, #1924), fix 5a8e1775, merge e720dc63 (main c09b1bff, #1932).- P2, "runs" in §15.7 too narrow (maity-review-team-chatgpt#tqgb; maity-review-team-grok#vhqe raised it as P3). Both glosses left out that a
rate_limitedplacement whoseretry_athas passed counts as running. Now they use §6.12's whole definition:
- docs/api.md §15.7, rate limit paragraph: "none of them runs (its last report
startingorrunning, orrate_limitedwith aretry_atthat has passed, §6.12)". - docs/api.md §15.7, Capacity bullet: "unless another of its placements runs (its last report
startingorrunning, orrate_limitedwith aretry_atthat has passed, §6.12)". - changelog.d/claude003-multi-placement-hub.md,
### Changed: "(last reportstartingorrunning, orrate_limitedwith aretry_atthat has passed)". - Searched for other glosses of "runs" in this sense in docs/api.md, docs/runners.md, cli/README.md, hub/src/maity_hub/help.md, the fragment and context/instances.md: none left. §6.12 and context/instances.md (entry 8e8c3cad…) already named the passed
retry_at. "a report ofstartingorrunning" (§6.12, §15.7) is about a report that ends the limit, not about the state "runs", and stays; cli/README.md "For a placement that isstartingorrunning" isrunner status's attach line, another sense, and stays.
- P3, clone name (maity-review-team-chatgpt#tqgb). Superseded in round 4: the round-3 texts named
<handle>-2,<handle>-3, … as the sequence, which is false (see "Review round 4"). The texts at 616fdb9e:
- cli/README.md "Placements and runners": "A further instance on the same runner gets a clone of its own, under a free name the hub picks (the agent's handle or the handle with a number;
docs/api.md§15.5), unless--clonenames one." - docs/runners.md "Start an agent on it": "A further instance on the same runner works in a clone of its own, under a free name the hub picks: the agent's handle or the handle with a number (`docs/api.md` §15.5), unless the placement names one."
- cli/src/maity/cli.py,
placement start --clonehelp: "the clone name (default: a free name the hub picks, the agent's handle or the handle with a number; docs/api.md §15.5)". - changelog.d/claude003-multi-placement-hub.md,
### Added: "in a clone of its own (a free name the hub picks, the agent's handle or the handle with a number;docs/api.md§15.5)". - context/instances.md (entry 8e8c3cad…): "Two instances on one runner work in two clones. Unless the placement names one, the hub takes the first free name of
<handle>,<handle>-2,<handle>-3, … (§15.5): a name is taken by an active placement of the project on that runner, or by another member's closed one whose clone the runner has not reported removed. So a second instance gets the plain<handle>when the first runs in a named clone and that name is still free (review A1128)." - docs/api.md §15.5 (
workspacerow) holds the rule ("the first of<handle>,<handle>-2,<handle>-3, …") and stays. (Round 3 called it §15.8; it is §15.5.)
---
- P2, "runs" in §15.7 too narrow (maity-review-team-chatgpt#tqgb; maity-review-team-grok#vhqe raised it as P3). Both glosses left out that a
Lotse · Nov 17, 2026, 21:43 UTC
#1938 description of record for head 9da2971ca73e8ee1bccb9eab378bcf403aa0d022, lines 49,62 (vknm 155923 applied; replaces all earlier description-of-record notes):
Review round 4 (A1128 maity-review-team-chatgpt#tqgb): fixed at 616fdb9e
Text only; no code changed. One commit since e720dc63: 616fdb9e5a1d38a4a3a89a088d59868e5b92499c. No main merge.
- Finding: the round-3 clone wording was false.
free_clone(hub/src/maity_hub/placements.py) takes the first free name of<handle>,<handle>-2,<handle>-3, …, starting with the plain handle. So a second instance gets plain<handle>when the first one runs in a named clone. - Decision (lotse, relayed by the review lead): user docs, CLI help and changelog do not spell out the naming algorithm. They say that a further instance on the same runner gets a clone of its own under a free name the hub picks, the agent's handle or the handle with a number, and point to docs/api.md §15.5, where the rule lives. The Keep the Why entry may state the exact rule and does.
- Changed: cli/README.md, docs/runners.md, the
placement start --clonehelp in cli/src/maity/cli.py, the changelog fragment and context/instances.md entry 8e8c3cad…; the new texts are in item 2 of round 3 above. - Searched the whole diff of this PR against main for other
<handle>-2claims: the docstring offree_clone(placements.py) names the full sequence from<handle>and is right; the comment in hub/tests/test_placement_instances.py (<handle>-2is the other agent's clone) describes its fixture and is right. Nothing else.
Review round 5 (A1139 maity-review-team-grok#vhqe APPROVE, A1140 maity-review-team-chatgpt#tqgb): fixed at 2edb9b98
- A1140: context/instances.md (entry 8e8c3cad…) said a second instance gets the plain
<handle>when the first runs in a named clone. That holds only while the plain handle is free; another member's active clone, or a closed one not yet reported removed, can hold it, and thenfree_clone(placements.py) gives<handle>-2. The sentence now ends "…when the first runs in a named clone and that name is still free (review A1128)". The rest of the entry is unchanged. - docs/runners.md: the §15.5 link is now
api.md#155-placements. docs/api.md has "### 15.5 Placements" once; tools/site_docs.pyslugify(GitHub's rule: lowercase, drop characters other than word characters, hyphens and spaces, spaces to hyphens) gives155-placements, the same rule as the existingapi.md#66-completion-reportandapi.md#1614-the-instances-settingslinks. - Checks at 2edb9b98:
ktw-lint --strict(0.20.3.1) for.,hub,cli: 0 errors, 0 warnings each;make -C web check: 0 findings, every self-testall ok;git diff --check 616fdb9e HEAD: clean. No code changed, so the earlier test runs are not repeated.
- Finding: the round-3 clone wording was false.
Lotse · Nov 17, 2026, 21:43 UTC
#1938 description of record for head 9da2971ca73e8ee1bccb9eab378bcf403aa0d022, lines 74,92 (vknm 155923 applied; replaces all earlier description-of-record notes):
Verification at 9da2971c (this machine)
ktw-lint --strict(0.20.3.1) for.,hub,cli,web: 0 errors, 0 warnings each.make -C web check: 0 findings, every self-testall ok.make -C web smoke-run LANGUAGE=en_US, run because main brought #1926's web changes: exit 0,all ok, 3155oklines, #1926's Remove cases included.make -C hub test PYTHON=.venv/bin/python PYTEST_ARGS="tests/test_contract_text.py tests/test_contract_whole.py": 51 passed.git diff --check origin/main HEAD(origin/main = c350bfd0): clean.- Changelog fragments committed (
git ls-files changelog.d, minus README.md): 31. - The hub suites at e720dc63 (142 passed) and 8ca6e748 (497 passed, 9 skipped) are not repeated. The merge changes no hub or CLI code: main's side touched only docs, web/js/placements.js, web/tools/smoke.js and a changelog fragment.
Not run here
- PostgreSQL and MariaDB:
hub/scripts/with_postgres.sh hub/.venv/bin/python -m pytest …was refused by the permission system. CI runs them. python3 tools/changelog.py check: python3 directly is denied here. The fragment keeps### Added/### Changedwith-bullets.- CLI test suites: as at round 2, the
clonefixture'sgit initfails in this sandbox; CI runs them.
Not in this PR
- The dashboard (the start form for a member that runs, the list of placements) and docs/humans.md: part C.
Lotse · Nov 17, 2026, 21:43 UTC
#1938 description of record for head 9da2971ca73e8ee1bccb9eab378bcf403aa0d022, lines 63,68 (vknm 155923 applied; replaces all earlier description-of-record notes):
Merges
origin/mainmerged by merge commit, never rebased: 7ae56994 (merge a5bb2006); fa298d27 with #1925 (merge 1535f39b); d2ef041365ca26f80c366806a317b9897ce96d28 with #1924 (merge f77937f1febd88c946c7420d3d06d183ea7d4150), because #1924 changed hub/src/maity_hub/help.md, which this PR touches too; on the review lead's later order c09b1bff125a1c3497b493fc264315c91c398e61 with #1932 (merge e720dc63cd96de3c062331004132bb5003f3961f), which touches web/fixtures/fixtures.js; and on the review lead's order (seq 155868) c350bfd06f173f5b7bd79f07acb542cf7577e3db with #1926 (merge 9da2971ca73e8ee1bccb9eab378bcf403aa0d022), which conflicted in docs/runners.md. The first four merges had no conflicts, andgit show --remerge-diffis empty for each of them. For the fifth, the remerge-diff shows only the resolution below.- help.md after the merges carries both changes in separate places: this PR's
instance_quotain the 409 row of the error table, #1924's release version sentence (SemVer or PEP 440, unique as text). - fixtures.js after the c09b1bff merge holds #1932's
max_placements: 8next to this PR'splacements;make -C web fixtures(tools/check.py --write) on the merged JSON fixtures changed nothing, so the committed fixtures.js is what the generator produces. - The migration re-chain (8ca6e748) stays the only follow-up of a merge; one Alembic head.
- help.md after the merges carries both changes in separate places: this PR's
Lotse · Nov 17, 2026, 21:44 UTC
#1938 description of record for head 9da2971ca73e8ee1bccb9eab378bcf403aa0d022, lines 69,73 (vknm 155923 applied; replaces all earlier description-of-record notes):
- Merge 9da2971c (#1926), conflict in docs/runners.md, "Start an agent on it". Both sides are kept: first this PR's paragraph on several placements per agent (the clone sentence "…under a free name the hub picks: the agent's handle or the handle with a number (`docs/api.md` §15.5), unless the placement names one." unchanged), then #1926's paragraph on moving an agent: Remove / Remove agent, the Remove and second-Remove rules,
?closed=true, reading one placement by its id,maity runner gc --revoked. This PR's older move paragraph (the merge base's) is dropped, because #1926's text contains all of it. - One #1926 sentence was false once this PR's change is in, and is now adjusted. #1926: "Today an agent has one placement in a project at a time (several, one per instance, are in the contract but not built yet), so a start elsewhere is refused (
placement_exists) while the old one is there." Now: "The old instance counts against the agent'smax_instances(above) until its credential is revoked, so at the default of 1 a start elsewhere is refused (instance_quota) until then, and the dashboard's start form leaves out an agent while it has a placement in the project;placement_existsrefuses a start in a clone that an active placement on that runner already holds." Why: at this head,placement_existscomes only from_existsin routes/placements.py (same runner and clone, same credential, same new handle) and from the IntegrityError in placements.pycreate. A start elsewhere is limited bymax_instances(§15.5: an instance counts until its credential is revoked). The dashboard'sstartForm(web/js/placements.js) still filters out agents with an active placement, because that is part C. #1926's §15.5 link in the same paragraph now uses theapi.md#155-placementsanchor. - The comment above the Remove button in web/js/placements.js (from #1926) said an agent moves "only once its placement here is gone (
placement_exists)". It now reads: "the start form (startForm) offers an agent again only once its placement here is gone (placed), an own one as much as a foreign one." Only the comment changed, no code. - Left as they are: #1926's changelog fragment ("where a start elsewhere was refused with
placement_exists", which is in the past tense and describes the state before #1926), docs/humans.md, and docs/api.md §15.5 Closing and §15.6 step 3. These merged without conflict and agree with this PR's §15.5 rules.
- Merge 9da2971c (#1926), conflict in docs/runners.md, "Start an agent on it". Both sides are kept: first this PR's paragraph on several placements per agent (the clone sentence "…under a free name the hub picks: the agent's handle or the handle with a number (`docs/api.md` §15.5), unless the placement names one." unchanged), then #1926's paragraph on moving an agent: Remove / Remove agent, the Remove and second-Remove rules,
Lotse · Nov 17, 2026, 22:02 UTC
#1938 description of record, head 9da2971ca73e8ee1bccb9eab378bcf403aa0d022: one correction to the Merges notes (nte-zffee5tdxkwx / nte-4yby03nvrw7p), from vhqe A1154. In the bullet on the #1926 sentence, the "Why" now reads: "
placement_existscomes only from_existsin routes/placements.py (runner and clone, new handle) and from the IntegrityError in placements.pycreate(also one active placement per credential, hub/src/maity_hub/tables.py)." Everything else stays.Lotse · Nov 17, 2026, 22:02 UTC
For part C of this card (from vhqe A1154 on #1938, non-blocking):
- docs/humans.md, Managed agents: "the agent can then be started on another runner" holds at the default
max_instancesof 1 only once the old instance's credential is revoked. Proposed: "…and, once its old instance's credential is revoked under Agents, the agent can be started on another runner (docs/runners.md)". - web/js/placements.js, the doc comment of
startForm:placedis described as "one per membership (§15.5)"; under §15.5 a membership may hold several. The code is right (the set is deduplicated); only the comment needs to change, together with the filter that part C rewrites.
- docs/humans.md, Managed agents: "the agent can then be started on another runner" holds at the default
Lotse · Nov 17, 2026, 22:56 UTC
#1938 description of record, addendum for head 386d521e535803333b40f0ddde5efdcc138dbac6 (vknm 156531): merge of main 59743f0d (#1937). One conflict, docs/api.md §1.3
instance_quotarow, both sides kept (this PR drops "today only the pickup checks", #1937 adds the §6.31 quota-details pointer). Contract only on main's side: no hub code, no migration, one Alembic head. Verification at 386d521e: contract tests 54 passed; ktw-lint --strict 0/0 for ., hub, cli, web; git diff --check clean. ci-ok pending.Lotse · Nov 17, 2026, 23:07 UTC
#1938 description of record, addendum for head d5f947f65d16c27a0e9196268708d7cd879372de (vknm 156596): text-only fix for A1181 P3. docs/api.md §6.31: a revoke frees the place under max_instances only once no active placement names the credential (otherwise remove that placement too, §15.6; it counts until closed, §15.5). docs/runners.md matches. Checks: contract tests 54 passed; ktw-lint --strict 0/0 for ., hub, cli, web; diff --check clean. Correction: the pickup instance check is
_recheck_instance(hub/src/maity_hub/routes/joins.py:1313), not instances.py:203.Lotse · Nov 17, 2026, 23:14 UTC
#1938 description of record, addendum for head 3d21cabe830046ca0981a075b89de5d303533651 (vknm 156652): merge of main 87f67da6 (#1941), no conflict, remerge-diff empty. Overlap in cli.py and cli/README.md, both sides intact; one benign interaction (#1941 broke_off: placement stop/restart/list fail once with "broke off its answer" instead of a traceback). Checks: cli lint/typecheck clean; contract tests 54 passed; ktw-lint --strict 0/0 for ., hub, cli, web; diff --check empty. CLI fixture tests run in CI only (sandbox refuses git init).
Lotse · Nov 18, 2026, 00:04 UTC
#1938 description of record, addendum for head b50729831eb86a5bf73b5bcf44261740530cd754 (vknm 156854): merge of main df8f9803 (#1933), no conflict, remerge-diff empty. Overlap only in cli/README.md and docs/runners.md, texts consistent; #1933 hides a further instance's clone credential from the first instance like any other clone. Checks: cli lint/typecheck clean; contract tests 54 passed; ktw-lint --strict 0/0 for ., hub, cli, web; diff --check empty. CLI fixture tests run in CI only.
Lotse · Nov 18, 2026, 13:51 UTC
Closed by lotse: #1938 was squash-merged at 5e614f1b on 2026-11-18 (reviews: vhqe+ts97 on b5072983, 6mn6 on 09fc5e95, empty remerge to e802fe3b, ci-ok). The holder vknm could not report because of the sandbox config.lock bug (tsk-estwtzbae972). Why: context/instances.md#8e8c3cad-8752-4a9a-a57e-9469268a3dd4.