Skip to content

docs: promote Tier 2 to Phase 10; register external-infra tier as gated#21

Closed
RNT56 wants to merge 1 commit into
docs/promote-phase9from
docs/promote-phase10
Closed

docs: promote Tier 2 to Phase 10; register external-infra tier as gated#21
RNT56 wants to merge 1 commit into
docs/promote-phase9from
docs/promote-phase10

Conversation

@RNT56

@RNT56 RNT56 commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Stacked on #19 (base docs/promote-phase9). GitHub will retarget this to main automatically once #19 merges. Merge #19 first.

What

Finishes promoting the docs/UPGRADE-PATH.md proposals into the canonical queue — and does it the right way for each tier.

Tier 2 → Phase 10 (eligible canonical tasks)
docs/TASKS.md gains Phase 10 — Context depth, trusted steering & distribution (P10-T01..T07), promoted from Tier 2 (U2-T01..07, same order/specs):

  • P10-T01/02 authoritative operator steering file — a new trusted-input class (I7's deliberate, operator-authored exception), loaded principal-only at the front door; cannot widen capability or bypass the gate/verifier.
  • P10-T03 provider-backed Embedder + P10-T04 pure-Go ANN semantic index (closes the dead Semantic=nil path; stays CGO-free, I6).
  • P10-T05 multi-language AST/live index (pure-Go/wasm, preserves REPLACE-on-rebuild).
  • P10-T06 versioned skills/MCP registry (local; remote fetch is gated as EXT-07).
  • P10-T07 Tier-2 CLI wiring.
    Master-DAG rows added; the "later phases" note updated.

Tier 3 → registered as GATED, NOT enqueued
The external-infra items are added to docs/TASKS.md under a new "External infrastructure — GATED" section that explicitly states they are not eligible queue tasks and must not be picked up by the work-selection rule. They stay tracked in docs/ROADMAP-EXTERNAL-INFRA.md (EXT-01..08) behind the §0 thesis gate. This was a deliberate design choice: enqueuing them as pickable P-tasks would defeat the whole point of gating them (each grants standing authority the design refuses by default — I3 — and crosses the "one self-hosted binary" identity).

Why it's safe

  • Documentation only — no behavior change; the default binary is byte-identical. Every Phase-10 task is itself additive and nil/flag-gated when later implemented.
  • docs/TASKS.md is a contract file (CLAUDE.md §5); this is its dedicated, serialized change. Rebase before merge.
  • make verify is green.

Note

Phase numbering: Tier 1 = Phase 9 (#19), Tier 2 = Phase 10 (here); Phase 8 stays reserved for the concurrency workstream. docs/UPGRADE-PATH.md got "promoted" / "gated" callouts on §5 and §6 so the proposal doc and the queue stay in sync.

🤖 Generated with Claude Code

Promote the second proposal tier into the canonical queue and register the
external-infrastructure tier as explicitly not-eligible, preserving its gate.

- Promote Tier 2 into docs/TASKS.md as Phase 10 — Context depth, trusted
  steering & distribution (P10-T01..T07): authoritative operator steering file
  (a new trusted-input class, I7's deliberate exception), provider-backed
  Embedder + pure-Go ANN semantic index (CGO-free, I6), multi-language AST/live
  index, versioned skills/MCP registry, and the Tier-2 CLI wiring.
- Register the external-infra tier (EXT-01..08) under "External infrastructure
  — GATED" — NOT eligible queue work; blocked behind the
  docs/ROADMAP-EXTERNAL-INFRA.md §0 thesis gate, so the work-selection rule
  skips it. Tier 3 is deliberately not enqueued as pickable tasks.
- Add the master-DAG rows + update the "later phases" note; cross-reference the
  proposal doc; add the Tier 2 "promoted" / Tier 3 "gated" callouts in
  docs/UPGRADE-PATH.md.

Documentation only: no behavior change, the default binary is byte-identical.
docs/TASKS.md is a contract file; this is its dedicated serialized change.
Stacked on docs/promote-phase9 (PR #19). make verify green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
RNT56 pushed a commit that referenced this pull request Jun 16, 2026
… Tier 2→P10 (#19, #21)

# Conflicts:
#	CHANGELOG.md
#	docs/TASKS.md
@RNT56

RNT56 commented Jun 16, 2026

Copy link
Copy Markdown
Owner Author

Integrated into main via merge commits 0788b23 (docs: #19, #21) and 1cfad56 (code: #22, #24). All content is on main; make verify + golangci-lint (0 issues) green on the integrated tree. Closing as merged.

@RNT56 RNT56 closed this Jun 16, 2026
@RNT56 RNT56 deleted the docs/promote-phase10 branch June 20, 2026 09:59
RNT56 added a commit that referenced this pull request Jul 5, 2026
… fixes (5 HIGH) (#95)

* feat(upgrade): wire the dormant loops — batch 1 (caching, lessons, race evidence, trust fold, bounded results)

Four judge-ranked items from the upgrade program, each closing a shipped-but-
never-consumed loop:

- provider/anthropic: emit the 3 prompt-cache breakpoints (system, last tool,
  moving last-message marker) the pricer already accounts for; fold Anthropic's
  disjoint usage tallies into the canonical total-input convention (the dormant
  under-billing the activation would have exposed). Complete+Stream share the
  request path; edge cases (empty system, zero tools, uncacheable final block)
  keep requests valid.
- memory: TaskContext merges ScopeProject + ScopeGlobal (lessons) under one
  budget, newest-first retention; main.go MemoryContext closure uses it — the
  distilled-lessons pipeline finally reaches a prompt (I7 labels byte-identical).
- agent/trust: race escalation threads the failed attempt's fail-class + fenced
  verifier tail into each candidate's Constraints (frozen contract, existing
  field — I1); final_verify is class-tagged and trust.Replay folds it alongside
  race_outcome (skip-not-panic guards; class-less pre-upgrade events replay
  byte-identical), so per-class trust warms on single-backend deployments.
- tools/mcp: read gains {offset,limit} paging + a 48KB cap with a recovery-
  teaching notice; the mcp tool result is capped at the one seam all three
  success paths share. Both mirror the webfetch cap precedent.

make verify green (119 pkgs).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(upgrade): batch 2 — tiered/flake-aware verification, sandbox credential masking, swarm DAG completion, core-loop context lifecycle

Four judge-ranked batches:

- verify + cmd/verifier: NILCORE_VCACHE default-on (kernelEnabled idiom, =0
  hatch) killing the 2x verify tax; FlakeProbe decorator (test-class red +
  identical content hash => one real-verifier re-run; verify_flaky event;
  never guesses); TieredVerifier (scoped go vet/test of touched packages
  short-circuits RED before the full gate; only Full can PASS; word-boundary
  soundness gate so it wraps only go-test-family verify commands; under-scoping
  falls through). Order: tiered(flakeprobe(vcache(base))).
- sandbox: the namespace backend masks operator credentials before Landlock —
  vault dir + ~/.ssh/.aws/.gnupg/.netrc/.config/gh/.docker/config.json/.codex/
  .claude* (ro tmpfs over dirs, /dev/null over files, fail-closed 126, worktree
  shadow-exclusion). Closes the in-box vault-decryption I3 hole; parent resolves
  roots via stripped control env vars.
- swarm: Shard.BaseRef + dependency-aware base resolution (dep branch / TipSHA)
  with fenced claim-status+summary handoff (I7) — DAG edges now buy the dep's
  CODE, not just ordering; merged-set tracking (no re-merge spam) + conflict
  requeue on the integrated tip under the requeue Ledger; termination honesty
  (Outcome.Unmerged folds into Remaining — a dropped green can never exit 0);
  evidence-carrying focused requeue (red keeps its branch, retry continues from
  it with red claim ids + verifier detail in the goal). Fixed latent blocker:
  unique attempt-branch suffixes (retry cuts previously collided with kept
  branches).
- backend/native: bounded shell/registry output (head 2KB + tail 6KB backstop,
  self-bounded tools exempt); advisor trail records structured edits;
  MaxOutputTokens (default 16384) + max_tokens salvage turn + json.Valid belt;
  one-shot budget wrap-up signal; RepoContext seam (fenced repo map, I7);
  in-run compaction (msgs[0] byte-identical to preserve the cache prefix,
  pairs never split, tool bodies excluded from summaries) + context-overflow
  compact-once-retry. Events: truncated_turn, budget_wrapup, loop_compact.

make verify green (119 pkgs); swarm -race clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat(upgrade): batch 3 — delivery loop (/diff, /apply), evidence-rich gates end to end, orientation wiring

- delivery loop: verified chat/run drives KEEP their branch (the front door no
  longer verifies work then deletes it); the outcome line teaches the verbs;
  /diff renders a bounded preview and /apply merges through the EXACT structured
  PromoteToBase gate flow (graapprove envelope intact); WorkState.Branch
  round-trips a restart; internal/maint caps kept branches.
- gate evidence: policy.GateEvidence (diffstat + bounded head-biased excerpt +
  verify tail with an explicit verdict line + spend), redacted at construction,
  carried additively on GateAction.Evidence through the existing
  StructuredApprover seam and mirrored to emit.GatePrompt (AskPrompt precedent).
  Rendered on every attended surface: console, plain writer, styled REPL, TUI
  modal, Slack/Telegram (bounded). Legacy flat approvers byte-identical (pinned).
- follow-through wiring: the graapprove fall-through now forwards the FULL
  structured action to a structured human (11 sites via one helper; previously
  every graded fall-through flattened to Describe()); the swarm promote gate
  gains the same differ+spend evidence (no verify recorder — swarm verifies per
  shard, the section stays empty); RepoContext (new bounded repoMap) + CtxWindow
  (meter's window table) wired at BOTH Native construction sites; swarm
  --retries flag (default 2) arms Ledger.MaxAttempts — requeue budget was
  always 0, so focused/conflict retries were inert.
- docs: ARCHITECTURE records vcache default-on (kernel-cutover pattern), the
  flake-probe + tiered-verify composition (I2 arguments), and the namespace
  credential masking (I3 rationale).

make verify green (119 pkgs); tui build green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs(changelog): record the upgrade program; fix a staticcheck nit in the graded fall-through test

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(upgrade): remediate 25 adversarial-review findings (4 HIGH) + wire the verify decorators into run/serve/chat

A 7-lens, 36-agent adversarial review of the upgrade branch (refute-by-default
per finding) confirmed 25 real defects — mostly the integration seams between
the concurrently-built waves. All fixed, each with a discriminating test.

HIGH:
- native.go: a mid-tool_use stream EOF (proxy closes SSE without message_stop)
  recorded an invalid-JSON tool_use into history, so every later request marshal
  failed and the run died permanently — now sanitized to {} before the turn is
  recorded (+ routed through the corrective belt).
- verify/tiered: the scoped-red fast path shipped false REDs as the verdict and
  skipped the full verifier (default-on) — its subset guarantee didn't hold for
  opaque `make verify` recipes, flagged go-test commands, or package-load errors.
  Made OPT-IN; when on, arms only for full-module `go test ./...` with replicated
  flags and short-circuits only a provable subset red (loads fall through).
- integrate: a green shard that committed nothing (gitignored artifact / already-
  satisfied dependent) was an ancestor of the tip, so `git merge` said "already
  up to date", the commit failed, and it was misclassified a CONFLICT — burning
  rebuild attempts to a false exit-1. mergeOne now treats an already-contained
  branch as an idempotent Merged success.
- swarm/handoff: model-authored claim ids/fields rode UNFENCED as control lines
  into a dependent shard's goal (I7 break — cross-worker prompt injection).
  Sanitized (single-line, clipped) and moved inside the guard.Wrap fence.
- swarm/passes: a DAG dependent skipped because its dep failed wrote no artifact,
  was invisible to requeue, and the run reported Done=true with the dependent's
  planned work missing. Skipped dependents are now tracked, re-run when their dep
  greens, and a termination-honesty backstop forbids a false green.

Also: `finish_reason:"length"`→max_tokens salvage on OpenAI-family; mcp added to
selfBoundedTools; cumulative message_delta usage fold; scoped-red output tail-
bounded; conflictStale delete only on a fresh green re-run; resume reloads
durably-passed-but-unmerged shards; resume suffixes an existing branch; ledger
persists the pass's spent attempts; --resume honors an explicit --retries;
/apply gates on the merge TARGET (never-auto-approve-main floor sees `main`);
non-Done drives don't orphan a kept branch; /diff+/apply get TUI handlers and
explicit serve replies; chatNativeBackend gets RepoContext+CtxWindow; sandbox
EACCES skips instead of bricking; ~/.git-credentials masked; symlink-resolved
workdir-overlap exclusion.

WIRING (finding #23): orchestratorVerifier wraps run/serve/chat/resume verifiers
with the vcache→flake→tiered chain (previously only build/swarm), so a green run
pays one full verify not two and a flaky final verify is re-probed once before
the N-worktree race — making the shipped decorators' advertised effects real.

make verify (119 pkgs) + tui build + golangci-lint (0) + -race all green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(swarm): unresolvedPlanned counts only never-ran nodes (no double-count vs board.Remaining)

The Fix #21 termination backstop folded unresolvedPlanned into Outcome.Remaining
on top of board.Remaining, but it counted every planned shard not in
passed/merged/exhaustedFail — which includes a shard that RAN, verified RED, and
still has retry budget. That shard already has a red artifact board.Remaining
counts, so a non-converged run (passes/stalled/budget/ctx rail) over-reported
Remaining (2 instead of 1 for one red shard). Not an I2 break — over-reporting is
the safe direction and Done stays false — but the operator figure was wrong and it
contradicted the documented disjoint-counters invariant.

Track a ran-set (every planned shard that produced a terminal verdict, green or
red — i.e. everything Scan can see) and count as unresolved ONLY planned shards
that never ran (a Skipped dependent that never re-ran). Now disjoint from both
board.Remaining and unmergedGreens. Regression test pins Remaining==1 for a single
red-with-budget shard at the passes rail. Found by the remediation verification pass.

make verify (119 pkgs) + swarm -race green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: RNT56 <rnt56.2b@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant