Why: Emergency Codex fallback must not run before Cursor, Antigravity, and PI have each been exhausted.
Evidence: Cursor transport 5e6c93f765c232783a7dccb05544e26c386fb031; 29 config tests, focused emergency controller test, and 449 governance tests passed with 19 skips.
Impact: Emergency-mode implementation, repair, and test roles now require exactly one enabled profile for each normal adapter while preserving configured order.
Refs: .task/feature-agent-cli-enforcement.md
Why: The approved contract requires exactly three safe attempts for Cursor, agy, and PI, then one Codex emergency attempt, never host implementation authority.
Evidence: Routing/config tests were RED for never, max attempts, forbidden adapters, and legacy host fallback; 133 related tests now pass with one opt-in probe skipped.
Impact: Normal emergency-mode roles reject all non-Cursor/agy/PI adapters, project fallback is never, and Codex remains available through emergency/review paths.
Refs: independent Codex review of feature/agent-cli-enforcement
Why: Success-shaped receipts and caller-writable history must not authorize apply/admit without controller-originated provenance.
Evidence: Fabricated, unsigned, tampered-history, and moved-ref tests were RED before HMAC binding; 52 controller/history/admission tests now pass.
Impact: Stores a local 0600 attestation key, signs successful history including transport commit SHA, and verifies it before apply/admit.
Refs: independent Codex review of feature/agent-cli-enforcement
Why: Safe routing must not retry unproven cleanup, ignore worker fail-stop terminals, or lose out-of-scope rename sources.
Evidence: New tests were RED for each Review finding; 44 controller and admission tests now pass with diff-check clean.
Impact: Tightens safety classification and path inventory only; routing order and provenance contract remain unchanged.
Refs: independent Codex review of feature/agent-cli-enforcement
Why: Agents must use configured CLIs for implementation and testing, while remaining free to inspect, plan, test, and iterate within bounded scope.
Evidence: Task-card contract tests and the full 430-test governance discovery pass with 19 existing skips; diff-check passes.
Impact: Defines three safe attempts per normal CLI, one emergency Codex attempt, fail-stop terminals, and mandatory apply/admit integration.
Refs: feature/agent-cli-enforcement
Why: Implementation changes must be mechanically tied to a successful CLI transport instead of relying on agents to follow prose.
Evidence: Admission tests went RED without apply/admit; 10 admission, 41 agent-exec, and 62 task tests now pass with exact staged-content matching.
Impact: Adds validated transport fast-forwarding and rejects unproven implementation commits while exempting task cards and approved plan/spec paths.
Refs: feature/agent-cli-enforcement
Why: Parser hardening requires the emergency fixture to use the real Codex adapter contract instead of a custom adapter.
Evidence: Agent-exec and config suites pass 58 executions with one opt-in probe skipped; validate and diff-check pass.
Impact: Test fixture only; production validation remains strict.
Refs: feature/agent-cli-enforcement
Why: Normal execution roles must exclude Codex while a single enabled Codex adapter remains available for emergency routing and review.
Evidence: Parser invalid-case tests were RED before validation; all 17 config tests and agent_exec validate now pass.
Impact: Enables three attempts per normal profile, stable Cursor routing, and a validated emergency Codex profile.
Refs: feature/agent-cli-enforcement
Why: Codex CLI must run only after every regular profile exhausts its three safe attempts.
Evidence: The focused test records three regular failed-clean attempts and fails because no emergency Codex attempt is launched.
Impact: Adds a RED controller contract test and test helper support only.
Refs: feature/agent-cli-enforcement
Why: The routing controller must retry each safe failed profile three times before advancing.
Evidence: The focused test fails with observed order retryme,thenok instead of three retryme attempts, proving current behavior lacks retries.
Impact: Adds a RED controller contract test only; production behavior is unchanged.
Refs: feature/agent-cli-enforcement
Why: Routing needs an explicit per-profile attempt limit and a named Codex emergency profile before controller enforcement can be implemented.
Evidence: The new parser test failed on unknown keys before implementation; all 15 config test executions now pass and git diff --check is clean.
Impact: Adds backward-compatible optional configuration fields only; routing behavior is unchanged in this commit.
Refs: feature/agent-cli-enforcement
Why: include the current integration baseline before verification.
Evidence: fetched origin/main=dc86a023605d00fccca1b9679b4cdad96373bdee.
Impact: integrate upstream changes without rewriting task history.
Refs: task-sync
Why: Settings plaintext loses to secret_keys, so replacing the env key did not change the key a conversation actually sent.
Evidence: python3 -m unittest tests.test_svc.SvcDbRecoveryTests.test_seed_replaces_old_system_secret tests.test_svc.SvcDbRecoveryTests.test_seed_warns_when_old_secret_stays_active tests.test_svc.SvcDbRecoveryTests.test_seed_puts_without_credentials_when_auth_off (SELF).
Impact: Embedded databases now compare the active system secret fingerprint after seeding, and the backend gitlink carries the adoption fix.
Refs: fix/model-key-secret-overlay
Co-authored-by: Cursor <cursoragent@cursor.com>
Why: Gitea containers may leave SIGKILLed children as zombies until PID 1 reaps them, while kill -0 still reports success.
Evidence: Both timeout tests and the full AgentExecControllerTests suite pass; git diff --check passes.
Impact: Changes test liveness detection only; genuinely running child processes still fail the assertions.
Refs: #567
Why: PR #567 CI runs without a global Git user identity, causing every successful agent transport commit to fail with exit 128.
Evidence: The focused no-identity regression plus AgentExecControllerTests and AgentExecHistoryTests pass (30 executions total); git diff --check passes.
Impact: Supplies a deterministic non-secret identity only to git commit-tree; routing, receipts, and transport validation are unchanged.
Refs: #567
Why: execution history intentionally adds one source-external Git metadata path after every run
Evidence: focused fallback and history tests
Impact: preserves the no-canonical-implementation assertion while accepting the history record
Refs: feature/goal-first-delivery
Why: include the current integration baseline before verification.
Evidence: fetched origin/main=919f75cf7b39ca357e212a08a0ba5ba3d9a79b51.
Impact: integrate upstream changes without rewriting task history.
Refs: task-sync
Why: retain which CLI handled each task so routing can improve from real outcomes over time
Evidence: AgentExecHistoryTests and git diff --check
Impact: appends sanitized source-external JSONL records without changing run outcomes
Refs: feature/goal-first-delivery
Why: make the three approved CLIs the only active implementation and test routes
Evidence: adapter unit tests, configuration validation, diff check, and real marker probes for all three profiles
Impact: narrows project routing and fixes agy prompt binding for noninteractive execution
Refs: feature/goal-first-delivery
Why: include the current integration baseline before verification.
Evidence: fetched origin/main=692735e91d6a9ab07ddd3686feb60a56b270728a.
Impact: integrate upstream changes without rewriting task history.
Refs: task-sync
Co-authored-by: Cursor <cursoragent@cursor.com>
Why: verify configured Agent CLIs one profile at a time before declaring them usable
Evidence: 53 focused tests, agent-exec validation, 397-test governance regression, and diff check
Impact: adds opt-in source-external probes, acceptance checks, and current task records
Refs: U5; docs/superpowers/plans/2026-10-15-project-agent-execution.md
Why: include the current integration baseline before verification.
Evidence: fetched origin/main. The multi-instance account bootstrap conflict keeps main's identity ensure and activation flow.
Impact: integrate upstream changes without rewriting task history. Backend gitlink stays 80bb123.
Refs: task-sync
Co-authored-by: Cursor <cursoragent@cursor.com>
Why: include the current integration baseline before verification.
Evidence: fetched origin/main=59cbf1109634b66c88f5b1702f330cd738aa75ef.
Impact: integrate upstream changes without rewriting task history.
Refs: task-sync
Why: The multi-instance acceptance test still created alice with a literal
password; backend U3 replaced local password-bearing creation with trusted
pending-account activation, so the first pin bump past U3 failed test-pg
with RECOVERY_CONTRACT_REPLACED. The seam was left pending by the U3 task
and this PR is the first to cross it.
Evidence: Full TestTwoInstancesOverSharedPG passes against a disposable
PostgreSQL 16 container (identity ensure -> bootstrap-admin -> pending
create with activation key -> key redemption -> grant-setup password ->
api key -> all cross-instance scenarios, 15s).
Impact: Test-only bootstrap rewrite (deployment-level identity ensured once
per pair, admin bootstrapped first, alice activated through the key
redemption and grant-setup password flow); no product code changes.
Refs: Dev task feature/pptx-gate-reference-integrity; backend U3 #198
Why: Hide provider-specific noninteractive, model, permission, workspace, prompt, and output differences behind one adapter seam.
Evidence: Cursor observed red then 22 green config/adapter tests; the host replays them and whitespace checks during integration.
Impact: Adds deterministic direct-argv adapters and probes without launching providers or enabling project routing.
Refs: docs/superpowers/plans/2026-10-15-project-agent-execution.md
Why: bootstrap-admin now refuses a database that has no agent_system_identity row, and serve does not insert one.
Evidence: Dev CI run 3266 job 5008 failed with system identity missing on 7eef723.
Impact: test setup only.
Refs: Agent-System-Dev pulls/558
Co-authored-by: Cursor <cursoragent@cursor.com>
Why: the synced backend rejects password-bearing user create, so the shared-PG acceptance could not open its first account.
Evidence: Backend CI run 3261 succeeded on 8c60ed0; Dev test-pg run 3263 failed in TestTwoInstancesOverSharedPG before this change.
Impact: test setup only. Alice remains a non-admin account and still receives an API key after setting a password.
Refs: Agent-System-Dev pulls/558
Co-authored-by: Cursor <cursoragent@cursor.com>
Why: Establish one validated project-local routing document before any real Agent execution is enabled.
Evidence: Cursor observed red then 12 green configuration tests; the host replays those tests, the temporary validation target, and whitespace checks during integration.
Impact: Adds the U1 configuration contract and parser only; real routing, adapters, controller execution, and governance adoption remain disabled.
Refs: docs/superpowers/plans/2026-10-15-project-agent-execution.md
Why: Long-history task tests could finish while Git background maintenance still rewrote a disposable clone, racing TemporaryDirectory cleanup and failing CI with a non-empty .git directory.
Evidence: The failing test passes 25/25 and all 344 governance tests pass locally.
Impact: Test fixture only; product, governance commands, and runtime behavior are unchanged.
Refs: Dev run 3237 jobs 4951 and 4965
Why: Chat, lightweight, fallback and vision settings need a seed path, and the backend now sends current-turn images only to models declared capable of seeing them.
Evidence: The backend change is cfde38d. The seed test covers fallback and vision settings. A local image conversation on each builtin profile returned the pictured content from the expected model, and removing the chat model from the capable list switched that turn to the vision model.
Impact: New runs can use the four builtin profiles and image input. Secrets stay in the ignored env file. The live 8788 process is unchanged.
Refs: .task/feature-four-model-vision.md
Co-authored-by: Cursor <cursoragent@cursor.com>
Why: Ensure implementation authorship is delegated per unit while the primary model remains responsible for planning and delivery management.
Evidence: The focused task-card generation regression went red then green, and git diff --check passed.
Impact: Every repository-writing implementation unit gets a fresh Cursor CLI run; unavailable or failed Cursor work is recorded as a blocker instead of being silently implemented by the primary model.
Refs: .task/feature-goal-first-delivery.md
Why: Keep authorized work focused on its stated outcome, prevent private scope expansion, and remove mechanical human stage gates.
Evidence: make test-governance passed 344 tests with 18 environment-dependent skips; receipt is recorded in the task card.
Impact: New tasks use goal-first execution while retaining real decision points, independent review, evidence, platform admission, and high-consequence dual keys.
Refs: .task/feature-goal-first-delivery.md
Why: deploy needs to choose registered plugins and ship them inside one agent-system, then refuse the release when they are not active.
Evidence: python3 -m unittest tests.test_svc_plugins tests.test_svc_user_help tests.test_svc tests.test_svc_u2 (SELF, 63 passed, 1 skipped). Real compose build and make test-lifecycle are NOT_RUN.
Impact: --with is mutually exclusive with --from rdm and --from release. Existing non-interactive deploys stay without plugins unless plugins= is already recorded. Changing the plugin id set on a live service requires --allow-source-switch.
Refs: .task/feature-svc-plugin-compose.md modules/documents/docs/proposals/2026-10-14-svc-plugin-compose-deploy.md
Co-authored-by: Cursor <cursoragent@cursor.com>
Why: card_merge only recognized "Merge ... from <branch> into main"
merge commits, so a PR landed as a squash (real case: #457) left its
task card in .task/ forever; task-close reported nothing to close and
precheck showed no debt. Closing required a manual backfill (PR #541).
Evidence: card_merge now returns sha|subject|pr and falls back to a
Gitea API lookup by head ref or label (deleted branches keep the
original name only in label), gated by merge_commit_sha ancestry in
origin/main; precheck [cards] reuses card_merge so both surfaces agree.
Live probe against production Gitea returns 226a4af15791|Reset
per-service runtime state in svc.sh env_config|457 for
feature/svc-pidcheck-leak; stub-server tests cover squash landing,
decoy skip and the not-on-main refusal; full governance suite follows
in-card evidence.
Impact: scripts/task.sh close and precheck detect squash-merged cards
when GITEA_TOKEN is set (merge-commit path unchanged without token);
tests/test_task.py adds two regressions; no protocol change for
existing merge-commit closures beyond the appended pr field.
Refs: card-merge-misses-squash-merges (memory); PR #541 manual closure.
Why: F2 token extraction predates the two-section (HOME/IMC) layout of
~/.secrets/gitea so it concatenated both tokens and always failed; F6
registered a grep BRE alternation that facts-verify unescapes into a
literal pipe, failing re-verification and misaligning precheck's naive
pipe split into a spurious F6 date-format expiry warning, while both
underlying facts still hold.
Evidence: make facts-verify now 6/6 PASS with last_verified refreshed
to 2026-10-14; new regression test for escaped pipes in facts rows;
full governance suite 342 tests OK (18 skipped); precheck [facts] line
reports all facts fresh on the fixed parser.
Impact: policy/facts.md F2 (HOME-section awk extraction) and F6
(negated pipe-free grep); scripts/task.sh precheck neutralizes escaped
pipes the same way facts-verify does; tests/test_task.py covers it.
Refs: precheck WARN 过期事实 F6(日期格式); AGENTS.md 证据与验证门禁.
Why: pipefail treated a recent merged-card match as a failed git log after grep exited early, hiding completed cards from precheck and task-close.
Evidence: A disposable long-history regression failed before the fix and passed after it; make test-governance passed 341 cases. Git history confirms PR #489/#488/#486 merge SHAs.
Impact: Detect merged cards reliably and archive only the three authorized trial cards; four unrelated eligible cards remain untouched.
Refs: Dev merge queue #518; Dev #489, #488, #486
Why: include the current integration baseline before verification.
Evidence: fetched origin/main=5aae47ebca20ad1f3add3b080212cca7e1c6edf9.
Impact: integrate upstream changes without rewriting task history.
Refs: task-sync
Why: with the four-repo v0.4.0 release live, the account.list query/name
passthrough (RDM #356) enables the deferred full assertion of scenario 2; the
harness also needed v0.4.0 adaptations discovered on the combo instance.
Evidence: tool-written rows on the card - full ten-scenario run on a disposable
rdm@84ca64f combo instance (25/25 PASS incl. 2b name-substring, 2c
case-insensitive owner filter, 2d limit truncation), and dev service status
(rdm@84ca64f running against the live dev database, auth gate 401).
Harness fixes: rdm.project.member.setRole renamed to set-role (RDM #350);
command envelope parsed via payload; re-login after the password gate (base
#195 revokes sessions on password change); RDM world provisioning via
rdm.project.create + bind with the domain admin self-removing so owner2 is the
sole owner (creator is seeded as owner); scenario 8b asserts allow:true in the
current response shape; scenario 10b now meaningful (base #195 admits member
conversations through RDM project membership).
Impact: integration script and task card only; no product code.
Refs: task feature/rdm-increment-settings-duties; RDM #356; base v0.4.0 tags.