Skip to content

fix(cli): wire the documented post-seed scaffold lifecycle - #2592

Merged
rickylabs merged 6 commits into
mainfrom
orch/divybot-6572256863
Nov 2, 2026
Merged

rickylabs merged 6 commits into
mainfrom
orch/divybot-6572256863

Conversation

@rickylabs

@rickylabs rickylabs commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

The documented order starts Aspire before database seed. Workers previously read the seed marker only at startup, and streams installation linked the app without linking the record service. The existing runtime suite masked both gaps with an explicit service edge and a worker restart after seed.

Workers now watch atomic seed handoff publication and reuse the existing durable acceptance receipt. plugin install --service <name> persists the service consumer, preserves it on reinstall, and replaces only earlier managed links. The executable walkthrough selects --service users and includes detached Aspire startup.

Scope

Refs #2591. Keep this PR draft during the canary.2 hold; Cockpit owns review and merge.

Slices

  • Research, clean reproduction and design checkpoint.
  • Event-driven post-seed lifecycle, persisted service linking, docs and focused regressions.
  • Runtime gate executing the actual docs in three pristine workspaces, before all link/restart repair fixtures.
  • Canonical runtime cleanup, retained bind-mount scratch and compact scenario receipts.
  • Independent S1/S2/S3 source reviews and final exact-head evidence audit PASS.

Validation

Final head: 140b79950281c80c22ba5cf3dac221c16a31841e.

Exact-head one-pass runtime CI is green. PostgreSQL: 124 passed, 0 failed, 0 skipped. SQLite: 116 passed, 0 failed, 0 skipped. Static service/contracts/plugins reports pass 8/5/18 steps.

The documented gate proves both deliberate faults: missing seed handoff yields no job while real Activity passes; missing service link yields the exact link failure while the seed job completes. Restored documentation produces execution f9b0d79e-f579-43dc-8860-c35f867598b6 and stream/Activity event 8bdd2b01-9694-442a-bd4b-65573c4fbb08. Every case retains the same resident worker PID and passes exact-AppHost/container cleanup with no owned survivors.

Deno 2.9.7: 191 focused test/step results, plus 31 cleanup-repair results, pass. Scoped check/lint/fmt cover all 21 changed TypeScript files, with the repaired runner checked again. Final-head root check covers 4206 files, broader quality:gate has a durable PASS receipt, all four carrier generators leave no drift, and all 15 root check:* tasks pass. Review threads: zero unanswered.

Required PR checks are green or skipped by existing workflow policy. The native desktop job is green under its existing #859 exception; the underlying update callback limitation remains recorded, with no new waiver.

Harness

Run: .llm/runs/orch-divybot-6572256863--2591/. Source reviews: s1-review.md, s2-review.md, s3-review.md; local summaries and source hashes: validation.json. Final same-session implementation evaluation — PASS audits the exact-head runtime and local receipts. validation.json retains earlier source-candidate snapshots; final quality receipt scaffold-2591-final-head-quality binds the head above.

The matrix-declared claude-opus-5 fallback was used after the primary launcher was unavailable. Reviews use the same separate cross-family session throughout. Requested effort is xhigh; the native evaluator surface does not independently attest it.

Drift / Debt

No accepted product debt. Local RTK and Docker daemon are unavailable; live proof comes from CI. Earlier failed candidates remain recorded, including the DTO correction and scratch-deletion failure. Generated carriers and the Aspire scan inventory come only from their owning generators. Disposable workspaces remain in owned scratch after canonical runtime cleanup; no privileged data deletion was added. Cleanup does not claim a complete operating-system process inventory.

Definition of Done

  • Documented setup completes a real post-seed job without a manual worker restart.
  • Activity shows real linked-stream events without the not-linked warning.
  • Both negative controls fail for their intended symptom, then restored acceptance passes.
  • Exact owned AppHosts/containers clean up in all cases.
  • Deno 2.9.7 quality, focused tests, carrier chain and every root check task pass.
  • Independent final evidence review at the exact pushed head.
  • Final-head runtime CI green; required checks green or existing-policy skipped; no unanswered review threads.

@rickylabs

Copy link
Copy Markdown
Owner Author

[PHASE: IMPL] — S1 complete

Commit: 321eca9b9c53d7ac7b12e832d09b9c43c861bde7.

Running workers now observe atomic seed publications without polling; startup validation, failure isolation, shutdown, and directory rearming preserve the worker lifecycle. plugin install --service persists a service consumer and moves only prior managed edges on reselection. The documented stream install selects the record service.

Deno 2.9.7: 112 focused test/step results pass; all 14 owned TypeScript files pass scoped check/lint/fmt with explicit rules/config; quality and doctrine pass. Same independent cross-family Opus evaluator re-reviewed the repairs and returned PASS. Evidence and review.

S2 follows: pristine documented-order runtime acceptance plus both negative controls. Runtime remains unproven locally because Docker is unavailable. Refs #2591; main remains on hold and this PR remains draft.

@rickylabs

rickylabs commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner Author

Implementation — S2 independent sign-off

Head: 140b79950281c80c22ba5cf3dac221c16a31841e.

The new behavior.documented-scaffold gate reads the actual documented command block and runs three isolated pristine Postgres setups before link/restart repair fixtures: missing seed handoff, missing service link, then restored documentation. It checks real seed-correlated handler output, committed stream/Activity content, unchanged worker PID and canonical exact-AppHost cleanup.

Same-session cross-family S2 repair evaluation: PASS (source/slice), following S1 PASS. The same evaluator also passed the subsequent S3 scratch-retention repair (s3-review.md). Reports are in .llm/runs/orch-divybot-6572256863--2591/s1-review.md and s2-review.md. The matrix-declared Opus fallback was used after the primary launcher was unavailable; requested xhigh effort is not independently attestable through the native surface.

Deno 2.9.7: 191 focused test/step results PASS, followed by 31 focused cleanup-repair results; all 21 changed TypeScript files pass scoped check/lint/fmt with complete coverage; root check covers 4206 files. Broader quality, CLI/workers JSR audits, all four carrier generators and all 15 root check tasks pass. Final-head confirmation is being captured without further source changes.

Exact-head one-pass runtime CI is in progress. The earlier failed runtime exposed and drove fixes to the public DTO assumption and cleanup path; it is not final acceptance. The 650fb2e candidate passed the missing-seed control and exact cleanup, then failed only while recursively deleting bind-mounted database scratch. The final head retains those generated workspaces; runtime cleanup remains required. Final live CI and same-session evidence review remain required before READY. The PR remains draft under the canary.2 hold, with Refs #2591 and no merge.

@rickylabs

Copy link
Copy Markdown
Owner Author

[PHASE: IMPL-EVAL] [VERDICT: PASS]

IMPL-EVAL final evidence audit — issue 2591 / PR 2592 · PASS

Same evaluator session, following my S1, S2 and S3 source PASS. Nothing edited, committed, pushed or posted. Model: claude-opus-5, matrix-declared fallback at requested xhigh; effort is not independently attested by this session surface and I make no such claim.

Target head: 140b79950281c80c22ba5cf3dac221c16a31841e — verified as the local git rev-parse HEAD, with git status --porcelain empty, and as PR 2592's headRefOid.

Observed facts

Source identity. The delta from my reviewed 650fb2ed00389105ebe6cb242a212c827f4c1309 is 7 files: the S3 runner change plus run evidence (context-pack.md, worklog.md, validation.json, s3-review.md, two memory notes). The verify-documented-scaffold.ts diff is byte-for-byte the four hunks I reviewed in S3 — one per-variant log line added, the per-command success line removed, recursive scratch deletion replaced by a comment, parent removal replaced by the summary emit. All 25 sourceHashes in .llm/runs/orch-divybot-6572256863--2591/validation.json verify against the actual files (25/25, SHA-256). git log main..HEAD -- .github/ is empty: no workflow or policy file was touched.

Local exact-head gates. final-head-quality-receipt.json binds gitHead === actualGitHead === 140b799, outcome: PASS, exit 0, argv deno task quality:gate. All 15 tasks in final-head-check-tasks.json exit 0. Root check at final HEAD: 4206 files, 36 batches, 0 failed batches, 0 occurrences — and its logged command (--root packages --root plugins --ext ts,tsx) includes packages/cli/e2e/, so the changed runner is covered there as well as by s3-check.json. Scoped wrappers report full coverage with no drops or refusals (check 21/21, lint 21/21, fmt 21/21; S3 repair 1/1 each). All four carrier generators ran (final-head-gen-*.txt) and the tree is clean afterwards — that combination, not the logs alone, is what proves no generated drift.

Focused tests re-run by me at this head: 135 tests + 56 steps = 191 results, 0 failed, reconciling exactly with final-focused-tests.json; s3-tests.json 31/0 likewise re-confirmed.

CI. Run 41425306150, headSha 140b799, status completed, conclusion success. Jobs: classify, scaffold-static, desktop-native-linux, scaffold-runtime-sqlite, scaffold-runtime all success; "scaffold CI lane visibility" skipped. The Postgres log shows exactly one invocation of the canonical command — deno task e2e:cli run scaffold.runtime --cleanup --format pretty --report .llm/tmp/e2e-report-scaffold-runtime.json — not split into gates or per-scaffold commands; --report only adds the artifact. Suite report: suiteId: scaffold.runtime, ok: true, 124 steps, every one passed, 0 failed / 0 skipped, including cleanup.aspire-stop. SQLite 116/0/0; static service 8, contracts 5, plugins 18, all 0 failed / 0 skipped. So the surrounding suites pass, not merely the new gate.

behavior.documented-scaffold — verdict passed, critical, exit 0, timedOut: false, one attempt, 220,927 ms (against the 2,400,000 ms ceiling I asked to be raised in S2). All three scenarios discriminate correctly, with all six receipts plus the summary intact in stdoutTail:

variant job Activity worker
skip-seed-handoff RED: missing handoff real event 6ca00f10-a91d-4b3e-8257-082ccf7c441a PID preserved
drop-link real execution ba4c40c5-c38c-4bb5-aee2-778196d50c4d RED: missing link PID preserved
restored f9b0d79e-f579-43dc-8860-c35f867598b6 8bdd2b01-9694-442a-bd4b-65573c4fbb08 PID preserved

Each variant emitted its own {"cleanup":"PASS","exactAppHostStopped":true,"foreignOrUnknownLeftAlone":0}, then {"documentedScaffold":"PASS","variants":["skip-seed-handoff","drop-link","restored"]}. Each fault is RED only for its own contract while the other passes with a real identifier — the discrimination I required in S2 is now demonstrated live, and drop-link (which failed in both prior attempts) passing its job assertion is the direct live proof of the S2 by-correlation + seed-payload repair.

Prior attempts, kept distinct from acceptance. 41423003834 at 41fb51d failed on a Fresh/esbuild subprocess EPIPE during the first variant; it is a failed diagnostic attempt, not evidence, and later successful rendering does not retire it. 41423746948 at 650fb2e failed: the seed fault and runtime cleanup passed, then recursive scratch deletion raised PermissionDenied and variants 2–3 never ran. Only 41425306150 at 140b799 is acceptance evidence.

Native desktop. evidence.json is status: "FAIL" (1307-char failure) for the renderer stage-v2 gap — the underlying native suite did not pass, and I do not claim it did. The green job comes from .github/scripts/desktop-native-exception.ts, pre-existing and unmodified by this branch, which fails closed: it requires evidence.status === 'FAIL' plus all three ISSUE_859_MARKERS; I verified all three are present in the observed failure, so the bounded exception was applied for its declared reason. No new waiver exists or could — .github/ is untouched.

PR lanes — not tests. final-head-pr-checks.json: 26 checks, 4 SUCCESS / 22 SKIPPED. The 4 successes are unrelated lanes (command-postgres, docs-site classify/build/Utility docs browser and style policy). The 22 skips are the draft/workflow-policy-skipped auto lanes — including the PR-attached scaffold-runtime, scaffold-runtime-sqlite, scaffold-static, desktop-native-linux, check-test, check-test-shard, quality, code-quality, surface-diff, breaking-migration, close-gate. None of these executed, and none is the runtime acceptance; that comes solely from the separately dispatched exact-head run.

Policy. PR 2592 OPEN, isDraft: true, base main, head 140b799; body carries Refs #2591 with no closing keyword and states the canary hold; labels type:fix, area:cli, status:impl-eval (exactly one status:); milestone 0.0.9. Issue 2591 OPEN — not auto-closed. check:review-threads re-run live by me: PASS … threads=0 unanswered=0.

Inferred coverage, stated as inference

Repo-wide unit/integration testing at this head rests on inference, not a receipt: every test artefact in the run directory is a focused selection, and the PR's check-test/check-test-shard lanes are policy-skipped, so no repo-wide deno task test receipt exists at 140b799. What is observed instead: the 4206-file root type check, quality:gate PASS, 15 check tasks, the three full E2E domains (124 + 116 + 31 steps), and focused suites over exactly the changed areas — plugins/workers, the CLI plugin-install feature, the reference reconciler, and the E2E runner/registry. Since the source delta is confined to those areas, I judge the residual risk low, but that is my judgement, not a gate result.

Non-blocking notes

  • validation.json is stale relative to the final evidence: its top-level qualityGate.gitHead is 41fb51d, and finalRuntime still reads "UNPROVEN until the repaired exact-head CI run passes". The final report should cite final-head-quality-receipt.json and run 41425306150 directly, and that string should be updated or it will understate the record later.
  • Labels carry no priority:. AGENTS.md hard-requires exactly one status: and one milestone (both satisfied); whether priority: is mandatory is Cockpit's call against the netscript-pr taxonomy — I am not asserting a violation.
  • My two S3 recommendations remain open and unblocking: the retained scratch under .llm/tmp/cli-e2e/… includes container-owned .data/postgres that the operator also cannot delete without privilege and that has no reaper; and the summary line prints the variants constant rather than an accumulated list (true today only because of the loop shape).

Verdict

PASS at 140b79950281c80c22ba5cf3dac221c16a31841e, scoped to what is evidenced above. Acceptance rests on the exact-head run 41425306150 plus the exact-head local receipts and verified source hashes; it does not extend to the native desktop suite (observed FAIL under the pre-existing bounded #859 exception), to the policy-skipped PR lanes, or to repo-wide deno task test, which has no receipt at this head. No self-certification and no promises about future runs: if the head moves, this verdict lapses and a new exact-head run must be identified and audited. The verdict belongs on the PR timeline and the ignored atomic final report — not a new source commit — and the issue must stay open with the draft/no-merge hold intact for Cockpit to review and merge.

@rickylabs
rickylabs marked this pull request as ready for review November 2, 2026 10:35
@rickylabs
rickylabs merged commit e7906c8 into main Nov 2, 2026
59 checks passed
@rickylabs
rickylabs deleted the orch/divybot-6572256863 branch November 2, 2026 12:19
@github-actions github-actions Bot added the canary:0.0.9-canary.4 Published NetScript prerelease 0.0.9-canary.4 label Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:cli canary:0.0.9-canary.4 Published NetScript prerelease 0.0.9-canary.4 status:impl-eval type:fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant