Skip to content

docs(pull): one entry point for the pull migration — delete five superseded planning docs - #2657

Merged
vybe merged 3 commits into
devfrom
docs/pull-migration-consolidate
Sep 10, 2026
Merged

vybe merged 3 commits into
devfrom
docs/pull-migration-consolidate

Conversation

@obasilakis

Copy link
Copy Markdown
Contributor

The pull migration's state lived across eleven planning/testing documents plus the tracker, and they had drifted apart. This reduces that to six documents with one entry point, and corrects what the survivors got wrong.

No source changes. tests/unit/test_2306_architecture_split.py and test_2533_alembic_head_watch.py pass; no internal markdown link in the six surviving docs is broken; nothing in tests/, scripts/ or .github/ referenced any deleted file.

Deleted five (git retains them)

file why
PULL_PILOT_946_SOAK.md #946 closed. Its decision record was never filled in — Verdict: GO | NO-GO, Envelope finding: <notes>. A blank scaffold.
EFFECT_IDEMPOTENCY_1084_REVIEW_NOTE.md #1084 closed; it reviews Direction A, which was retired.
EFFECT_IDEMPOTENCY_DIRECTION_B_RETRY_CONTEXT.md A proposal whose content was adopted into TARGET_ARCHITECTURE.md (#1404).
ORCHESTRATION_BUG_META_ANALYSIS_2026-06.md Its own §5 is titled "Recommended changes to the Target Architecture (applied 2026-06-06)", and the spec header records the three that landed. 1,819 lines of superseded working.
TRANSACTIONAL_EXECUTIONS_2026-06.md June planning artifact; nothing references it.

Why deleted rather than archived. An archived file is still in the working tree, still grepped, still loaded into an agent's context, and still read by someone who doesn't scroll up to the "superseded" header. That is not hypothetical: the Direction B proposal frames the fail-closed execution_id policy as an open question — "Neither is obviously right… this decision is the substance of the issue" — while the spec states it as settled. Reading the proposal first produces the conclusion that the policy is undecided, and re-opens a closed decision. That happened this week and cost a full review cycle. Moving the file to archive/ would not have prevented it.

Rewrote the status doc as the entry point

PULL_MIGRATION_STATUS.md is meant to be this already — "the durable record of what was built, what is load-bearing, and what remains" — but it was materially wrong:

It now also carries two things that were written down nowhere:

Corrections to the surviving docs

The Phase-5 soak bar is mis-cited in four places. They say "≥2-week zero-orphan soak (#856)". #856 sets no such bar — it is a closed 2026-05-15 spike on soak-testing approaches for multi-agent fleet stability (context exhaustion, retry storms) that never mentions duration, orphans, or pull. The two-week figure originates in #429's own gating condition — "#306 must be in production for ≥2 weeks with zero observed orphan recoveries" — written for the Redis Streams event bus, which closed 2026-04-21. #1766's own acceptance criterion asks for "several days of real traffic".

I have not silently picked a new number. The citation is corrected, the discrepancy is stated, and §4 flags it for deliberate re-derivation — including which measurements pool across non-consecutive windows and which need a build-matched baseline.

T6.3 now states the fail-closed policy is decided in the spec and that #2392 is the build, not the decision.

M5 records the first end-to-end observation of lease expiry → re-delivery → poison-park outside the 2026-07-08 synthetic pilot (2026-09-09, local PostgreSQL, forced fault): re-delivery preserved the execution_id and recovered the work on a different worker; killing on every claim walked the counter to the cap and parked it with a high-priority operator alert. Every production soak window so far has reported redelivery_count = 0, which until now was indistinguishable from "the mechanism is untested".

Result

Eleven documents to six, each of which someone would actually open: the spec, the status file, the test/gate list, the rollback runbook, the wire contract, and the taxonomy. The five survivors carry a banner pointing at the status file.

🤖 Generated with Claude Code

https://claude.ai/code/session_019Tm7UEkd4G9KQZD5oeLRSa

…rseded planning docs

The migration's state lived across eleven planning/testing documents plus the tracker,
and they had drifted apart. Five of them were finished work that was never retired: they
were last touched on 2026-07-08, the day the Phase 0-3 PR merged, and their conclusions
had already been folded into TARGET_ARCHITECTURE.md.

Leaving them in the tree is not free. EFFECT_IDEMPOTENCY_DIRECTION_B_RETRY_CONTEXT.md is
a *proposal* whose content was adopted into the spec; it frames the fail-closed
execution_id policy as an open question, while the spec states it as settled. A reader
who finds the proposal first concludes the policy is undecided and re-opens a closed
decision. That happened, and it cost a full review cycle.

Deleted (git retains them; nothing in tests, CI or scripts referenced any of them):

  PULL_PILOT_946_SOAK.md                        #946 closed; the decision record was
                                                never filled in - it is a blank scaffold
  EFFECT_IDEMPOTENCY_1084_REVIEW_NOTE.md        #1084 closed; reviews Direction A, retired
  EFFECT_IDEMPOTENCY_DIRECTION_B_RETRY_CONTEXT  adopted into TARGET_ARCHITECTURE.md (#1404)
  ORCHESTRATION_BUG_META_ANALYSIS_2026-06.md    its own §5 is titled "applied 2026-06-06";
                                                the spec header records the three changes
  TRANSACTIONAL_EXECUTIONS_2026-06.md           June planning artifact, nothing points at it

Archiving rather than deleting was considered and rejected: an archived file is still in
the working tree, still grepped, still loaded into an agent's context, and still read by
someone who does not scroll up to the "superseded" header - which is the exact failure
mode above. Git history is the durable copy.

PULL_MIGRATION_STATUS.md is rewritten as the entry point and verified against dev and the
tracker. It was materially wrong: Phase 4 read "not started" (it is built and in review),
#1401/#1402 read "not yet built" (closed in July), and it named a branch that no longer
exists. It now also carries two things that were recorded nowhere - the trigger reach
table (six of nine on dev, nine with Phase 4), and the behaviour the loop and fan-out
rewrites change on installs with an EMPTY pilot allowlist, which is not flag-gated and is
operator-visible.

Corrected across the surviving docs:

- The Phase-5 ">=2-week zero-orphan soak" bar was cited to #856 in four places. #856 sets
  no such bar - it is a closed spike on multi-agent fleet stability and does not mention
  duration, orphans or pull. The figure originates in #429's gating condition for #306
  (the event bus, closed 2026-04-21) and was carried over. #1766's own criterion asks for
  "several days". Flagged for deliberate re-derivation rather than silently re-fixed.
- T6.3 now states that the fail-closed policy is DECIDED in the spec and that #2392 is the
  build, not the decision.
- M5 records the first end-to-end observation of lease expiry, re-delivery and poison-park
  outside the 2026-07-08 synthetic pilot (2026-09-09, local PG, forced fault): re-delivery
  preserved the execution id and recovered the work on a different worker, and killing on
  every claim walked the counter to the cap and parked it with a high-priority operator
  alert. Every production window so far has reported redelivery_count=0, which until now
  was indistinguishable from "untested".

The five surviving reference docs get a banner pointing at the status file. Net: eleven
documents to six, one entry point.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_019Tm7UEkd4G9KQZD5oeLRSa
@vybe

vybe commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

merge-train 2026-09-09: not on this train. The editorial judgement is good and the factual corrections check out — I verified them against the tracker rather than taking them on trust: #429's body does carry the ≥2-week/orphan bar verbatim, #856's body has zero mentions of it, and the #1401/#1402 close dates are as stated. The new §3 trigger-reach table matches pull_pilot.PULL_REACHABLE_TRIGGERS exactly. Zero new broken markdown links (124 pre-existing, identical on both sides), and no CI job or script touches docs/planning/.

The blocker is that two of the five deletions are still load-bearing.

1. Deleting TRANSACTIONAL_EXECUTIONS_2026-06.md orphans the H4 label cited by 11 shipped sites. The body says "nothing references it." That is false — the references use the hazard label, not the filename, which is why a filename grep misses them (it missed mine on the first pass too):

  • tests/unit/test_terminal_write_cas_gate.py:1 — """Unit tests for the terminal-write CAS gate (#671 / H4, doc §6.3). — cites a section number inside the deleted file
  • src/backend/services/task_execution_service.py:810, 1296, 1603, 2039, 2048, 2101, 2239, 2361, 2519 — nine #671/H4 comments
  • src/backend/services/execution_envelope.py:38
  • docs/planning/MESSAGE_ENVELOPE_SCHEMA.md:408 — a doc this PR keeps

After merge, H4 has zero definition anywhere in docs/. It is also the sole record of a NO-GO verdict: #1095 closed COMPLETED with no comments, so the kill criterion and re-open SQL survive nowhere else.

2. ORCHESTRATION_BUG_META_ANALYSIS_2026-06.md is not a recommendations doc. §5 ("applied 2026-06-06") is 13 lines of 1819. The rest is a root-cause taxonomy, an 11-area recurrence-hotspot table, four accretion chains, the canary-invariant compensation map, and 11 forensic catalogs. Its six class names — SPLIT_STATE_AUTHORITY, PUSH_DISPATCH_BLOCKING, TTL_HEURISTIC, POINT_FIX_ACCRETION, PARALLEL_CODE_PATHS, MISSING_IDEMPOTENCY, 366 mentions total — return 0 hits in the surviving tree. It is the written rationale for #429 (open, status-blocked, inside Phase 5's deletion scope) and for the canary invariants Phase 5 retires. ACTOR_MODEL_POSTCARD.md is not a substitute: its taxonomy is the runtime error_code enum, a different artifact at a different layer.

3. The rewrite drops settled decisions for an open issue. Old PULL_MIGRATION_STATUS.md:108-124 held #1408's eligibility bar ("Trinity solely fronts the rail AND the agent holds no direct credential; v1 = Nevermined settle only"), #1401's prompt-advisory branch, and #1402's park semantics + cap-default-3. git grep "eligibility bar": dev 1 → PR 0. "prompt-advisory": dev 1 → PR 0. #1408 is still open and would have no surviving spec.

4. Dangling reference in a live memory doc — docs/memory/feature-flows/agent-to-agent-collaboration.md:309 lists `docs/planning/PULL_PILOT_946_SOAK.md` under "Reference docs". Link-checking misses it because it is a code span, not a link.

On the archive question, which is where I think the disagreement actually is. The anti-archive argument in the body is genuinely good for the case it was written about — a proposal that reads as an open question, whose header frames a settled policy as undecided, is a trap whether it sits in planning/ or archive/, and the Direction-B doc is exactly that. But it does not transfer to a forensic catalog or a decision record, which are read deliberately, by label, not stumbled into. docs/archive/README.md has a plans/ table for precisely this, with two precedents in the same doc family (ORCHESTRATION_RELIABILITY_2026-04.md, TARGET_ARCHITECTURE_v1_2026-06-06.md). Archiving the meta-analysis and the transactional doc keeps H4 resolvable and the taxonomy findable while still getting them out of the working set — and the two effect-idempotency deletions I would keep exactly as you have them.

Smaller things, cheap in the same pass:

  • CLAUDE.md:157, 182, 367 present TARGET_ARCHITECTURE.md as the authoritative active-direction doc, while the PR banners it "This file is reference material." PULL_MIGRATION_STATUS.md, the declared new entry point, appears nowhere in CLAUDE.md. Neither is updated. (Correcting my own brief to the reviewer: docs/memory/architecture.md does not cite it — only CLAUDE.md does.)
  • Banner scope: TARGET_ARCHITECTURE.md is a 627-line whole-system doc across 19 sections, of which pull coordination is one. It now opens by sending every reader — including someone evaluating a frontend or security tradeoff — to a pull-migration status file.
  • docs/testing/PULL_MIGRATION_TESTING.md:350 still reads "the ≥2-week soak (Spike: soak testing approaches for multi-agent fleet stability #856 / Production soak-test of pull/work-stealing coordination (#1081) before default-on #1766, measurement set in §9)", unflagged, contradicting §7/§8 of the same file and §4 of the status doc.
  • PULL_MIGRATION_STATUS.md:79 says "Four documents"; it was three (ROLLBACK, STATUS, TESTING), 7 occurrences. Same line calls Spike: soak testing approaches for multi-agent fleet stability #856 "a closed 2026-05-15 spike" — that is its created date; it closed 2026-07-03.
  • A 7th pull-family doc is left out: docs/planning/ACTOR_MODEL_TASK_DEMOTION_MAP.md is live, un-bannered, and absent from §7's "these six remain" table — yet MESSAGE_ENVELOPE_SCHEMA.md, which is in that table, links readers to it.
  • PULL_PILOT_946_SOAK.md §2's alternating control/treatment windows (designed so load and API-latency drift hit both arms) have no successor; surviving §9 is single-arm baseline-then-measure. Dropped in the same PR that correctly flags the soak bar as needing re-derivation.
  • docs/archive/plans/TARGET_ARCHITECTURE_v1_2026-06-06.md:12 cites the meta-analysis, now unresolvable. Archive is a frozen record and out of guard scope, but the citation dies.

Minimum to land: archive rather than delete the meta-analysis and the transactional doc, fix agent-to-agent-collaboration.md:309, and fold the old §5 gate decisions into the spec. Rides the next train once those are settled.

sim and others added 2 commits September 10, 2026 14:00
The PR deletes docs/planning/PULL_PILOT_946_SOAK.md and already removed
this same bullet from MESSAGE_ENVELOPE_SCHEMA.md; the copy in
agent-to-agent-collaboration.md's "Reference docs" list was missed
because the PR's link verification scoped to docs/planning/, not
docs/memory/.

Verified: all five files this PR deletes now have zero live (non-archive)
references.

merge-train: mechanical, per the merge-train note on the PR.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01CswDvc38w7EheWhbbUD4So
@vybe

vybe commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

merge-train 2026-09-10: on this train. Two commits pushed to docs/pull-migration-consolidate — a dev merge and one mechanical fix. No content decisions made on your behalf.

Pushed: the dangling reference to a file this PR deletes. docs/memory/feature-flows/agent-to-agent-collaboration.md:309 still listed:

- `docs/planning/PULL_PILOT_946_SOAK.md` — soak harness + go/no-go criteria

under "Reference docs". You already removed the identical bullet from MESSAGE_ENVELOPE_SCHEMA.md in this same PR, so this is your own precedent applied to the copy that was missed — the PR's verification scoped to docs/planning/ and the six survivors, and this one lives in docs/memory/.

I swept the other four deletions the same way rather than fixing only the one found: EFFECT_IDEMPOTENCY_1084_REVIEW_NOTE.md, EFFECT_IDEMPOTENCY_DIRECTION_B_RETRY_CONTEXT.md, ORCHESTRATION_BUG_META_ANALYSIS_2026-06.md, TRANSACTIONAL_EXECUTIONS_2026-06.md — zero live (non-archive) references remain for any of the five.

Not fixed — your call. docs/planning/ACTOR_MODEL_TASK_DEMOTION_MAP.md is a seventh pull-track doc that survives, is still cross-referenced from MESSAGE_ENVELOPE_SCHEMA.md, and got no entry-point banner — so the "eleven documents to six" arithmetic quietly excludes it. Pasting the banner in would have been a one-block edit, but whether that doc belongs under the entry point is an editorial decision about your own consolidation, not a mechanical repair, so I left it.

Verified, not assumed. Validation spot-checked seven factual claims in the diff against live source — including the exact poison_lease error string at lease_reaper_service.py:137-140, the 60+300=360s lease arithmetic against slot_service.py:33, the six-trigger frozenset at pull_pilot.py:95-97, and the ≥2-week zero-orphan bar being correctly re-attributed from #856 to #429. All seven passed, and an automated link scan over the six survivors found zero broken relative links. One nit that lives only in the PR body, not the shipped doc: #856 was raised 2026-05-15 and closed 2026-07-03.

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge-train: batch validated on train/20260910-1327 (#2686), 32 checks green across all five members together.

@vybe
vybe merged commit ff7a2e0 into dev Sep 10, 2026
26 checks passed
@obasilakis

Copy link
Copy Markdown
Contributor Author

Two items in the rewritten status doc moved this week

Flagging these against the PR rather than editing it, since the point of consolidating was to have one file that is actually true — both of these will be stale on merge otherwise.

§4 item 3 — "a soak on an agent that actually emits". The doc says the mechanics for a second emitting pilot are in the ops repo and "are not yet applied — the backend still reports PULL_MODE_PILOT_AGENTS=cornelius-oracle". As of 2026-09-15 that is applied: the flag is now cornelius-oracle,oracle-6-science,oracle-7-ai-semi. oracle-7-ai-semi has file_sharing_enabled=1 with the public volume mounted and a dedicated 2-hourly schedule that exercises create_share. eu2's effect:* count went from 0 of 215 to its first row today, so the guard is no longer un-entered on that instance.

The choice differs from what the doc anticipates in one way worth capturing: it is not a disposable agent. A disposable agent only produces synthetic traffic; an existing cron agent exercises the guard under real load and can catch a natural lease expiry. The cost is that the emitting agent's own pre-flip history stops being a valid control — which is why the clean baseline arm is a separate agent carrying no emit. That two-agent split is the part worth writing down.

§3 trigger reach — one trigger is missing from the table. retry is not in PULL_REACHABLE_TRIGGERS, so a cron pilot with max_retries > 0 shows a permanent small pushed remainder. Both new eu2 arms run max_retries=1 and both showed it on day 1. The current table lists the six reachable and three unreachable triggers but not retry, and its absence reads as a leak to anyone checking M1 on a cron pilot.

§4 item 4 / Phase 5. The deletion list is S-01/S-02/S-03. B-02 belongs there too — filed as #2840. It has no pull awareness (its premise is that the backend drains, which is false for a pilot), fired critical on cornelius-oracle on 2026-09-09, and becomes universally wrong at default-ON. More broadly, grep -rl 'pull_pilot\|PULL_MODE_PILOT\|pull_owns_dispatch' src/backend/canary/ returns nothing — no invariant knows pull exists.

One addition for §5 or §6, if you want it. A backend restart discards every in-flight push execution, including completed-and-paid-for turns, because push dispatch ownership is an in-process dict plus a 60s Redis liveness marker; pull rows are immune because ownership is durable columns. Measured on eu2 twice this week (detail on #1081 / #429). That is the sharpest short statement of the Phase-5 payoff I have, and the status doc currently has no equivalent line.

Everything else in the rewrite matches what I see on dev and on the instance. The §4 correction of the "≥2-week (#856)" mis-citation in particular is worth having — it was cited back at me during the 08-25 re-flip.

@obasilakis

Copy link
Copy Markdown
Contributor Author

Operator decision, 2026-09-16 (@obasilakis): Open Question 7 resolves to the edge adapter — human-interactive chat goes on the durable queue, and the push coordination path is deleted rather than kept alongside. Full record on #1989; work created as #2842 and #2843.

This PR needs changes before merge, or it lands the opposite of the decision into the document that is meant to be the single entry point. Flagging rather than pushing to your branch.

Three places in the rewritten status doc now assert the opposite:

  1. §3 reach table — interactive chat is listed as "Deliberately excluded — scope cut, see §4 item 5". It becomes "pending feat(pull): interactive turns jump the queue — the starvation half of Open Question 7 #2842/feat(pull): one turn per conversation at a time — the transcript-safety half of Open Question 7 #2843".
  2. §4 item 5 — "Until it is decided, 'everything is pull' is false by design, not by omission. One FIFO ordered by queued_at would park a human turn behind autonomous work, which is why the cut exists." This paragraph is now exactly wrong and should be deleted, not softened. The starvation premise it rests on is also overstated: push does not avoid the wait — human chat already queues in a bounded Redis FIFO at capacity, and on eu2 the worst case is already ~32 minutes. What push avoids is waiting behind queued batch work. Priority (feat(pull): interactive turns jump the queue — the starvation half of Open Question 7 #2842) restores parity.
  3. §2 phase table / §4 item 4 — Phase 5's deletion list should also name the synchronous chat dispatch path and its in-memory overflow FIFO, since the second set of books now goes entirely.

Given this PR's own thesis — that an archived-but-present document still gets read and relitigated, and that this cost a review cycle once already — §4 item 5 is precisely the sentence that will cause the next one.

Two smaller corrections while it is open, both from the eu2 soak this week:

  • §3 is missing retry. It is in neither the autonomous nor the reachable set; on eu2 that is 308 rows over 30 days (4.7% of traffic), and it goes to push on pilot agents whose schedules go to pull.
  • §4 item 3 ("a soak on an agent that actually emits ... not yet applied") is now applied — the pilot flag carries three agents and one has file sharing with a dedicated emitting schedule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants