Skip to content

docs(target-arch): v2 — side-effect handling reframed to retry-with-trace + tool-side gates - #1404

Merged
obasilakis merged 3 commits into
devfrom
docs/target-architecture-v2
Jul 1, 2026
Merged

obasilakis merged 3 commits into
devfrom
docs/target-architecture-v2

Conversation

@vybe

@vybe vybe commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Replaces docs/planning/TARGET_ARCHITECTURE.md with v2, archiving v1. The only architectural change is side-effect handling under re-delivery (issue #1084); every other section carries forward unchanged. Docs-only, no code.

v1 (Direction A): make re-delivery safe by threading a platform-injected idempotency key through every outbound sink (universal coverage) — a gate that blocked pull default-on for all side-effect agents.

v2 (Direction B): abandon universal sink coverage (the surface is unbounded — the agent's own key / gh / curl / any new MCP server) and instead:

  1. Retry with prior-trace context (feat: structured recovery trace + injection into re-delivered and subsequent executions #1401) — re-delivery and the next execution carry the prior failed run's structured, three-state (done/not-done/unknown), write-ahead trace, so the agent recovers from hindsight: continue / verify-before-redo / fail-gracefully.
  2. Deterministic tool-side gates on capability-confined irreversible rails (payment) — provider-native idempotency token inside the Trinity-owned MCP tool; the agent never decides "verify vs redo" for money.
  3. Gate the effect, not the agent — read-only + reversible + confined-irreversible agents default on now; only irreversible-and-un-confineable effects wait.
  4. No synchronous user gates (feat: MAX_REDELIVERY cap + async operator-queue human-gate lever (lease-reaper backstop) #1402) — the human gate is the async operator queue; agents fire-and-park, never block a worker on a person.

What's in this PR

Honest deltas (called out in the doc, not hidden)

Notes

New sub-issues of #1081 filed alongside this: #1401 (recovery trace + injection) and #1402 (async operator-queue human-gate lever), both status-incubating until v2 is greenlit.

🤖 Generated with Claude Code

…ace + tool-side gates

Replace TARGET_ARCHITECTURE.md with v2 (Direction B); archive v1.

- Side-effect handling reframed from effect-key universal sink coverage
  (Direction A) to retry-with-prior-trace recovery + deterministic tool-side
  gates on capability-confined irreversible rails (Direction B).
- Gate the effect, not the agent: read-only + reversible + confined-irreversible
  agents can default on now; only irreversible-un-confineable effects wait.
- No synchronous user gates — the human gate is the async operator queue (#1402);
  agents fire-and-park.
- Reconciled with the tracker: #1401 (recovery trace + injection) and #1402 (async
  operator-queue human-gate lever) filed under #1081; #1084 (Direction A) awaits
  re-scope; the tool-side confined-rail gate is not yet filed; trace fidelity
  depends on the open #548/#333 reader-race family.
- Archive v1 -> docs/archive/plans/TARGET_ARCHITECTURE_v1_2026-06-06.md (superseded banner).
- Add design notes: EFFECT_IDEMPOTENCY_DIRECTION_B_RETRY_CONTEXT.md,
  EFFECT_IDEMPOTENCY_1084_REVIEW_NOTE.md.
- Bump CLAUDE.md Memory Files pointer to v2.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@vybe vybe added type-docs Documentation theme-reliability Theme: Reliability labels Jul 1, 2026
@obasilakis
obasilakis enabled auto-merge (squash) July 1, 2026 12:04
Eugene Vyborov and others added 2 commits July 1, 2026 13:26
Minimal pointer notes aligning stale "#1084 is the gate" / {execution_id}:{effect_ordinal}
framing with TARGET_ARCHITECTURE.md v2 (Direction B — retry-with-trace + tool-side gates,
gating per-effect not per-agent). The shipped effect_guard mechanism description is
unchanged; only forward-looking "the gate / per-agent default-on" claims get a v2 pointer.

- docs/memory/feature-flows.md — index row
- docs/memory/architecture.md — effect-scoped extension (target-direction note)
- docs/memory/requirements.md — pull-mode gate note
- docs/memory/feature-flows/effect-idempotency.md — reframed note
- docs/planning/PULL_PILOT_946_SOAK.md — "(the gate)" descriptor
- docs/planning/TRANSACTIONAL_EXECUTIONS_2026-06.md — stale :482 line ref + "the gate"
- docs/planning/ACTOR_MODEL_POSTCARD.md — ordinal-key + universal-sink framing
- docs/planning/ORCHESTRATION_BUG_META_ANALYSIS_2026-06.md — one dated banner (body unchanged, point-in-time snapshot)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…blic-repo hygiene)

The DGX Sparky reference embedded a personal absolute path
(`~/Dropbox/Agents/dgx/sparky-ui/`) in a world-visible doc. Replaced with a
non-path descriptor. Pre-existing; surfaced during the target-arch v2 doc pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@obasilakis
obasilakis merged commit 0d3e58b into dev Jul 1, 2026
18 checks passed
vybe pushed a commit that referenced this pull request Sep 10, 2026
…rseded planning docs (#2657)

* docs(pull): one entry point for the pull migration — delete five superseded 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

* docs: drop the dangling PULL_PILOT_946_SOAK reference (#2657)

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

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Co-authored-by: sim <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

theme-reliability Theme: Reliability type-docs Documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants