mercury-agent 0.23.2 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/container/Dockerfile +1 -1
- package/container/Dockerfile.base +1 -1
- package/container/agent-package.json +1 -1
- package/docs/configuration.md +60 -0
- package/docs/container-lifecycle.md +27 -15
- package/docs/extensions.md +36 -0
- package/docs/goals/rehearsal-bench/roadmap.md +1 -1
- package/docs/goals/release-gate/roadmap.md +8 -8
- package/docs/goals/whatsapp-bot-hardening/open-threads.md +18 -0
- package/docs/goals/whatsapp-bot-hardening/roadmap.md +1 -1
- package/docs/graceful-shutdown.md +21 -5
- package/docs/pending-verification.md +195 -4
- package/docs/plans/{bugs-0915 → archive/2026-09-15-bugs-0915}/decisions.md +1 -0
- package/docs/plans/{bugs-0915 → archive/2026-09-15-bugs-0915}/plan.md +2 -2
- package/docs/plans/archive/2026-09-15-bugs-0915/sessions/S1.md +56 -0
- package/docs/plans/archive/2026-09-15-bugs-0915/sessions/S2.md +51 -0
- package/docs/plans/archive/2026-09-15-bugs-0915/sessions/S3.md +60 -0
- package/docs/plans/archive/2026-09-15-bugs-0915/sessions/S4.md +46 -0
- package/docs/plans/archive/2026-09-22-p0-bugs-0922/briefs/S1.md +60 -0
- package/docs/plans/archive/2026-09-22-p0-bugs-0922/briefs/S2.md +60 -0
- package/docs/plans/archive/2026-09-22-p0-bugs-0922/briefs/S3.md +58 -0
- package/docs/plans/archive/2026-09-22-p0-bugs-0922/briefs/S4.md +58 -0
- package/docs/plans/archive/2026-09-22-p0-bugs-0922/decisions.md +8 -0
- package/docs/plans/archive/2026-09-22-p0-bugs-0922/plan.md +102 -0
- package/docs/plans/archive/2026-09-22-p0-bugs-0922/sessions/S1.md +29 -0
- package/docs/plans/archive/2026-09-22-p0-bugs-0922/sessions/S2.md +29 -0
- package/docs/plans/archive/2026-09-22-p0-bugs-0922/sessions/S3.md +30 -0
- package/docs/plans/archive/2026-09-22-p0-bugs-0922/sessions/S4.md +32 -0
- package/docs/plans/bench-patterns-0915/briefs/S10.md +72 -0
- package/docs/plans/bench-patterns-0915/briefs/S11.md +95 -0
- package/docs/plans/bench-patterns-0915/briefs/S12.md +87 -0
- package/docs/plans/bench-patterns-0915/briefs/S9.md +81 -0
- package/docs/plans/bench-patterns-0915/decisions.md +7 -1
- package/docs/plans/bench-patterns-0915/plan.md +92 -8
- package/docs/plans/bench-patterns-0915/sessions/S10.md +40 -0
- package/docs/plans/bench-patterns-0915/sessions/S11.md +53 -0
- package/docs/plans/bench-patterns-0915/sessions/S12.md +44 -0
- package/docs/plans/bench-patterns-0915/sessions/S4.md +29 -0
- package/docs/plans/bench-patterns-0915/sessions/S5.md +30 -0
- package/docs/plans/bench-patterns-0915/sessions/S6.md +46 -0
- package/docs/plans/bench-patterns-0915/sessions/S7.md +30 -0
- package/docs/plans/bench-patterns-0915/sessions/S8.md +30 -0
- package/docs/plans/bench-patterns-0915/sessions/S9.md +2 -0
- package/docs/plans/flat-0916/briefs/S1.md +55 -0
- package/docs/plans/flat-0916/briefs/S2.md +55 -0
- package/docs/plans/flat-0916/decisions.md +8 -0
- package/docs/plans/flat-0916/plan.md +88 -0
- package/docs/plans/p0-plan-0922/briefs/S1.md +60 -0
- package/docs/plans/p0-plan-0922/briefs/S2.md +54 -0
- package/docs/plans/p0-plan-0922/briefs/S3.md +58 -0
- package/docs/plans/p0-plan-0922/briefs/S4.md +54 -0
- package/docs/plans/p0-plan-0922/briefs/S5.md +79 -0
- package/docs/plans/p0-plan-0922/briefs/S6.md +77 -0
- package/docs/plans/p0-plan-0922/briefs/S7.md +79 -0
- package/docs/plans/p0-plan-0922/briefs/S8.md +69 -0
- package/docs/plans/p0-plan-0922/decisions.md +9 -0
- package/docs/plans/p0-plan-0922/plan.md +215 -0
- package/docs/plans/p0-plan-0922/sessions/S1.md +22 -0
- package/docs/plans/p0-plan-0922/sessions/S2.md +22 -0
- package/docs/plans/p0-plan-0922/sessions/S3.md +22 -0
- package/docs/plans/p0-plan-0922/sessions/S4.md +22 -0
- package/docs/plans/p0-plan-0922/sessions/S5.md +44 -0
- package/docs/plans/p0-plan-0922/sessions/S6.md +60 -0
- package/docs/plans/p0-plan-0922/sessions/S7.md +69 -0
- package/docs/plans/sensitive-bugs-0922/briefs/S1.md +63 -0
- package/docs/plans/sensitive-bugs-0922/briefs/S2.md +62 -0
- package/docs/plans/sensitive-bugs-0922/briefs/S3.md +61 -0
- package/docs/plans/sensitive-bugs-0922/briefs/S4.md +61 -0
- package/docs/plans/sensitive-bugs-0922/briefs/S5.md +62 -0
- package/docs/plans/sensitive-bugs-0922/decisions.md +9 -0
- package/docs/plans/sensitive-bugs-0922/plan.md +147 -0
- package/docs/release-gate.md +1 -1
- package/docs/smoke-fixtures.md +9 -0
- package/examples/extensions/feed-watch/fixtures.ts +210 -0
- package/examples/extensions/feed-watch/index.ts +140 -9
- package/examples/extensions/office-365-mail/README.md +132 -0
- package/examples/extensions/office-365-mail/index.ts +170 -0
- package/examples/extensions/office-365-mail/lib/graph.ts +1031 -0
- package/examples/extensions/office-365-mail/scripts/login.ts +252 -0
- package/examples/extensions/office-365-mail/skill/SKILL.md +94 -0
- package/examples/profiles/football-reporter/AGENTS.md +15 -2
- package/examples/profiles/football-reporter/config.yaml +5 -1
- package/examples/profiles/tel-aviv-flat-search/AGENTS.md +5 -1
- package/package.json +10 -6
- package/resources/pi-extensions/subagent/index.ts +38 -42
- package/resources/pi-extensions/subagent/outcome.ts +28 -0
- package/src/adapters/whatsapp-thread.ts +12 -0
- package/src/agent/container-entry.ts +40 -7
- package/src/agent/container-env.ts +26 -0
- package/src/agent/container-error.ts +28 -0
- package/src/agent/container-runner.ts +50 -14
- package/src/audit/ledger-queries.ts +35 -3
- package/src/bridges/slack.ts +4 -1
- package/src/bridges/teams.ts +55 -15
- package/src/bridges/telegram.ts +3 -1
- package/src/cli/mercury.ts +46 -0
- package/src/cli/mrctl-http.ts +25 -0
- package/src/cli/mrctl.ts +13 -14
- package/src/config.ts +70 -34
- package/src/core/api.ts +51 -29
- package/src/core/boot-reconcile.ts +168 -0
- package/src/core/chat-run-journal.ts +383 -0
- package/src/core/debounce.ts +97 -1
- package/src/core/handler.ts +292 -44
- package/src/core/instance-lock.ts +159 -0
- package/src/core/operator-alerts.ts +80 -10
- package/src/core/pending-ingress.ts +298 -0
- package/src/core/routes/dashboard.ts +28 -6
- package/src/core/routes/media.ts +22 -0
- package/src/core/routes/shadow.ts +28 -3
- package/src/core/runtime.ts +139 -4
- package/src/core/simulate-ingress.ts +5 -2
- package/src/core/space-queue.ts +38 -9
- package/src/core/storage-cleanup.ts +16 -8
- package/src/core/system-messages.ts +50 -0
- package/src/core/task-scheduler.ts +150 -14
- package/src/dashboard/index.html +2 -0
- package/src/main.ts +121 -2
- package/src/ops/shadow-service.ts +113 -1
- package/src/ops/shadow-snapshot.ts +126 -0
- package/src/preflight/checks/roundtrip.ts +50 -39
- package/src/smoke/cli.ts +24 -4
- package/src/storage/db.ts +613 -89
- package/src/types.ts +20 -3
- /package/docs/plans/{bugs-0915 → archive/2026-09-15-bugs-0915}/briefs/S1.md +0 -0
- /package/docs/plans/{bugs-0915 → archive/2026-09-15-bugs-0915}/briefs/S2.md +0 -0
- /package/docs/plans/{bugs-0915 → archive/2026-09-15-bugs-0915}/briefs/S3.md +0 -0
- /package/docs/plans/{bugs-0915 → archive/2026-09-15-bugs-0915}/briefs/S4.md +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Brief S6 — a killed scheduled run leaves a ledger row
|
|
2
|
+
|
|
3
|
+
**Plan**: docs/plans/p0-plan-0922/plan.md **Session**: S6 **Round**: 2 **Kind**: feature
|
|
4
|
+
**Item slug**: ledger-misses-interrupted-runs
|
|
5
|
+
|
|
6
|
+
> The only file this session reads from the plan. Self-contained: it never points at a sibling's brief. The `**Item slug**:` line is the key the execution commands grep for to detect that a brief is active — keep it exactly in that shape.
|
|
7
|
+
|
|
8
|
+
## Launch
|
|
9
|
+
|
|
10
|
+
/f-ops-plan work p0-plan-0922 S6
|
|
11
|
+
|
|
12
|
+
## Run
|
|
13
|
+
|
|
14
|
+
/f-feature-dev ledger-misses-interrupted-runs
|
|
15
|
+
|
|
16
|
+
## Scope notes
|
|
17
|
+
|
|
18
|
+
Follow the doc's nine-step sequence. Step 4 (the `src/core/boot-reconcile.ts` seam) must come before step 5. **S7 builds on this seam**: after you land it appends a chat-run reconciler to `BOOT_RECONCILERS`. So write the seam's contract (the export names, the call order in `main.ts` before `startScheduler`, `bootAt`) into your log's **Siblings must know**, as it is in the code and not the doc. Owner decisions: an interrupted occurrence keeps today's make-up behaviour (only the label changes), and no chat notice goes to the group (the creator's missed-run report is reworded). **Deploy needs: rebuild + schema migration.** `src/types.ts` is baked, so run `container/build.sh`, then restart in a gap. The migration rebuilds `task_runs` on the live DB: rehearse on a shadow snapshot first (release-gate gate 2), and paste the §4 evidence block.
|
|
19
|
+
|
|
20
|
+
## Owned surfaces (predicted)
|
|
21
|
+
|
|
22
|
+
- scripts/football-audit.ts
|
|
23
|
+
- src/audit/ledger-queries.ts
|
|
24
|
+
- src/config.ts
|
|
25
|
+
- src/core/boot-reconcile.ts
|
|
26
|
+
- src/core/operator-alerts.ts
|
|
27
|
+
- src/core/routes/dashboard.ts
|
|
28
|
+
- src/core/runtime.ts
|
|
29
|
+
- src/core/task-scheduler.ts
|
|
30
|
+
- src/main.ts
|
|
31
|
+
- src/storage/db.ts
|
|
32
|
+
- src/types.ts
|
|
33
|
+
- tests/boot-reconcile.test.ts
|
|
34
|
+
- tests/dashboard-task-last-run.test.ts
|
|
35
|
+
- tests/ledger-queries.test.ts
|
|
36
|
+
- tests/operator-alerts.test.ts
|
|
37
|
+
- tests/scheduler-interrupted-shutdown.test.ts
|
|
38
|
+
- tests/scheduler-missed-runs.test.ts
|
|
39
|
+
- tests/task-run-ledger.test.ts
|
|
40
|
+
- tests/task-runs-migration.test.ts
|
|
41
|
+
|
|
42
|
+
## Do not touch
|
|
43
|
+
|
|
44
|
+
- container/build.sh, src/agent/container-entry.ts, src/agent/container-env.ts, src/agent/container-runner.ts, src/cli/mrctl.ts, src/core/api.ts, src/core/auth.ts, src/core/caller-token.ts, src/core/routes/console.ts, src/core/routes/media.ts, src/core/routes/storage.ts, src/preflight/checks/roundtrip.ts, tests/api-chat-auth.test.ts, tests/api-container-credential.test.ts, tests/api.test.ts, tests/console-routes.test.ts, tests/container-runner-create-args.test.ts, tests/media-storage-route.test.ts, tests/mrctl-http.test.ts, tests/preflight-roundtrip.test.ts (owned by S5 this plan)
|
|
45
|
+
- src/adapters/whatsapp.ts, src/agent/container-error.ts, src/agent/container-runner.ts, src/bridges/whatsapp.ts, src/core/chat-run-journal.ts, src/core/handler.ts, src/core/instance-lock.ts, src/core/space-queue.ts, src/core/system-messages.ts, tests/chat-run-journal.test.ts, tests/container-error.test.ts, tests/handler.test.ts, tests/instance-lock.test.ts, tests/orphaned-run-recovery.e2e.test.ts, tests/shutdown.test.ts, tests/space-queue.test.ts, tests/system-messages.test.ts (owned by S7 this plan)
|
|
46
|
+
- src/core/debounce.ts, src/core/handler.ts, src/core/pending-ingress.ts, tests/debounce.test.ts, tests/handler.test.ts, tests/pending-ingress.test.ts, tests/shutdown.test.ts (owned by S8 this plan)
|
|
47
|
+
- Not ours (avishai tsabari / Avishai-Tsabari, last 14 d): `src/core/runtime.ts`, `src/main.ts`, `src/storage/db.ts`, `src/config.ts`, `src/agent/container-runner.ts`, `src/agent/container-entry.ts`, `src/preflight/checks/roundtrip.ts`: see plan.md "Not ours". The lane is cleared by Q1 (ours). Re-check with `/f-ops-plan next p0-plan-0922`.
|
|
48
|
+
- Plan `sensitive-bugs-0922` fixes the sensitive-guard bugs in `src/core/runtime.ts` *after* this plan. Do not fix any of them here, even if you pass the code: `handleRawInput` → `checkSensitiveConnectionGuard`, the replay at ~1728, and the scheduler skip at ~1047.
|
|
49
|
+
|
|
50
|
+
## Edges
|
|
51
|
+
|
|
52
|
+
- start-after: none (satisfied — `next` launched you)
|
|
53
|
+
- merge-after: none
|
|
54
|
+
|
|
55
|
+
## Overlap verdicts
|
|
56
|
+
|
|
57
|
+
none
|
|
58
|
+
|
|
59
|
+
> The command's preflight overlap check treats a hit whose branch AND every shared file match a verdict line as answered (c), prints one `PLAN-PASSED(overlap): …` line, and carries it into the final report. Any other hit prompts as usual. The merge-time check is never waived.
|
|
60
|
+
|
|
61
|
+
## Decisions answered
|
|
62
|
+
|
|
63
|
+
- Q1: ours (owner, 2026-09-22). `src/core` and `src/agent` are this plan's lane.
|
|
64
|
+
|
|
65
|
+
## Ledger rules
|
|
66
|
+
|
|
67
|
+
- `docs/ROADMAP.md`: never edit. Your command writes `docs/pending-updates/ledger-misses-interrupted-runs.md` as usual.
|
|
68
|
+
- `docs/pending-verification.md`: append only under `## Plan p0-plan-0922 / S6`.
|
|
69
|
+
- Any goal's `decisions.md`: never edit; put decisions in your log's "Siblings must know".
|
|
70
|
+
|
|
71
|
+
## Environment
|
|
72
|
+
|
|
73
|
+
- Read `CLAUDE.md` → Worktree Setup and Gotchas before opening the worktree. Nothing from them is copied here. `bun install` once in the fresh worktree; the check gate is `bun run check` (every link runs to completion — read every line).
|
|
74
|
+
|
|
75
|
+
## Report
|
|
76
|
+
|
|
77
|
+
Your command's final report is appended to `docs/plans/p0-plan-0922/sessions/S6.md` by its report step (path resolved through `.claude/scripts/resolve-docs-root.sh docs/plans/probe.md`). `work` verifies the append.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Brief S7 — a hard kill leaves no dangling ⏳ and no silent drop
|
|
2
|
+
|
|
3
|
+
**Plan**: docs/plans/p0-plan-0922/plan.md **Session**: S7 **Round**: 3 **Kind**: feature
|
|
4
|
+
**Item slug**: orphaned-run-recovery
|
|
5
|
+
|
|
6
|
+
> The only file this session reads from the plan. Self-contained: it never points at a sibling's brief. The `**Item slug**:` line is the key the execution commands grep for to detect that a brief is active — keep it exactly in that shape.
|
|
7
|
+
|
|
8
|
+
## Launch
|
|
9
|
+
|
|
10
|
+
/f-ops-plan work p0-plan-0922 S7
|
|
11
|
+
|
|
12
|
+
## Run
|
|
13
|
+
|
|
14
|
+
/f-feature-dev orphaned-run-recovery
|
|
15
|
+
|
|
16
|
+
## Scope notes
|
|
17
|
+
|
|
18
|
+
Follow the doc's sequence. S6 has landed by the time you launch, so steps 5–6 are no longer blocked. Read the seam from the code, not from the doc. `ChatRunHandle` lives in `src/core/chat-run-journal.ts` and deliberately **not** in `src/types.ts` (baked), and that keeps this deploy **restart-only**. Do not move it. The instance lock (step 1) must still let a shadow take its own lock beside the live bot, so rehearse that. **Deploy needs: restart.** Deploy in a gap: no `mercury.managed` container and no `bin/pi`. Then the live check the doc names: restart mid-answer, see the ⏳ cleared and one "please send it again". `src/core/handler.ts`, `tests/handler.test.ts` and `tests/shutdown.test.ts` are shared with S8, which starts after you.
|
|
19
|
+
|
|
20
|
+
## Owned surfaces (predicted)
|
|
21
|
+
|
|
22
|
+
- src/adapters/whatsapp.ts
|
|
23
|
+
- src/agent/container-error.ts
|
|
24
|
+
- src/agent/container-runner.ts
|
|
25
|
+
- src/bridges/whatsapp.ts
|
|
26
|
+
- src/core/boot-reconcile.ts
|
|
27
|
+
- src/core/chat-run-journal.ts
|
|
28
|
+
- src/core/handler.ts
|
|
29
|
+
- src/core/instance-lock.ts
|
|
30
|
+
- src/core/runtime.ts
|
|
31
|
+
- src/core/space-queue.ts
|
|
32
|
+
- src/core/system-messages.ts
|
|
33
|
+
- src/main.ts
|
|
34
|
+
- src/storage/db.ts
|
|
35
|
+
- tests/chat-run-journal.test.ts
|
|
36
|
+
- tests/container-error.test.ts
|
|
37
|
+
- tests/handler.test.ts
|
|
38
|
+
- tests/instance-lock.test.ts
|
|
39
|
+
- tests/orphaned-run-recovery.e2e.test.ts
|
|
40
|
+
- tests/shutdown.test.ts
|
|
41
|
+
- tests/space-queue.test.ts
|
|
42
|
+
- tests/system-messages.test.ts
|
|
43
|
+
|
|
44
|
+
## Do not touch
|
|
45
|
+
|
|
46
|
+
- container/build.sh, src/agent/container-entry.ts, src/agent/container-env.ts, src/cli/mrctl.ts, src/config.ts, src/core/api.ts, src/core/auth.ts, src/core/caller-token.ts, src/core/routes/console.ts, src/core/routes/media.ts, src/core/routes/storage.ts, src/preflight/checks/roundtrip.ts, tests/api-chat-auth.test.ts, tests/api-container-credential.test.ts, tests/api.test.ts, tests/console-routes.test.ts, tests/container-runner-create-args.test.ts, tests/media-storage-route.test.ts, tests/mrctl-http.test.ts, tests/preflight-roundtrip.test.ts (owned by S5 this plan)
|
|
47
|
+
- scripts/football-audit.ts, src/audit/ledger-queries.ts, src/config.ts, src/core/operator-alerts.ts, src/core/routes/dashboard.ts, src/core/task-scheduler.ts, src/types.ts, tests/boot-reconcile.test.ts, tests/dashboard-task-last-run.test.ts, tests/ledger-queries.test.ts, tests/operator-alerts.test.ts, tests/scheduler-interrupted-shutdown.test.ts, tests/scheduler-missed-runs.test.ts, tests/task-run-ledger.test.ts, tests/task-runs-migration.test.ts (owned by S6 this plan)
|
|
48
|
+
- src/core/debounce.ts, src/core/pending-ingress.ts, src/types.ts, tests/debounce.test.ts, tests/pending-ingress.test.ts (owned by S8 this plan)
|
|
49
|
+
- Not ours (avishai tsabari / Avishai-Tsabari, last 14 d): `src/core/runtime.ts`, `src/main.ts`, `src/storage/db.ts`, `src/config.ts`, `src/agent/container-runner.ts`, `src/agent/container-entry.ts`, `src/preflight/checks/roundtrip.ts`: see plan.md "Not ours". The lane is cleared by Q1 (ours). Re-check with `/f-ops-plan next p0-plan-0922`.
|
|
50
|
+
- Plan `sensitive-bugs-0922` fixes the sensitive-guard bugs in `src/core/runtime.ts` *after* this plan. Do not fix any of them here, even if you pass the code: `handleRawInput` → `checkSensitiveConnectionGuard`, the replay at ~1728, and the scheduler skip at ~1047.
|
|
51
|
+
|
|
52
|
+
## Edges
|
|
53
|
+
|
|
54
|
+
- start-after: none (satisfied — `next` launched you)
|
|
55
|
+
- merge-after: land only after S6 is landed (it will be: S6 is also a start-after predecessor). Before step 5, re-read S6's `src/core/boot-reconcile.ts` as landed on `dev` and S6's log "Siblings must know". Check with `/f-ops-plan next p0-plan-0922` before the rebase step.
|
|
56
|
+
|
|
57
|
+
## Overlap verdicts
|
|
58
|
+
|
|
59
|
+
none
|
|
60
|
+
|
|
61
|
+
> The command's preflight overlap check treats a hit whose branch AND every shared file match a verdict line as answered (c), prints one `PLAN-PASSED(overlap): …` line, and carries it into the final report. Any other hit prompts as usual. The merge-time check is never waived.
|
|
62
|
+
|
|
63
|
+
## Decisions answered
|
|
64
|
+
|
|
65
|
+
- Q1: ours (owner, 2026-09-22). `src/core` and `src/agent` are this plan's lane.
|
|
66
|
+
|
|
67
|
+
## Ledger rules
|
|
68
|
+
|
|
69
|
+
- `docs/ROADMAP.md`: never edit. Your command writes `docs/pending-updates/orphaned-run-recovery.md` as usual.
|
|
70
|
+
- `docs/pending-verification.md`: append only under `## Plan p0-plan-0922 / S7`.
|
|
71
|
+
- Any goal's `decisions.md`: never edit; put decisions in your log's "Siblings must know".
|
|
72
|
+
|
|
73
|
+
## Environment
|
|
74
|
+
|
|
75
|
+
- Read `CLAUDE.md` → Worktree Setup and Gotchas before opening the worktree. Nothing from them is copied here. `bun install` once in the fresh worktree; the check gate is `bun run check` (every link runs to completion — read every line).
|
|
76
|
+
|
|
77
|
+
## Report
|
|
78
|
+
|
|
79
|
+
Your command's final report is appended to `docs/plans/p0-plan-0922/sessions/S7.md` by its report step (path resolved through `.claude/scripts/resolve-docs-root.sh docs/plans/probe.md`). `work` verifies the append.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Brief S8 — a restart persists and replays pending debounced messages
|
|
2
|
+
|
|
3
|
+
**Plan**: docs/plans/p0-plan-0922/plan.md **Session**: S8 **Round**: 4 **Kind**: feature
|
|
4
|
+
**Item slug**: wire-debounce-flush-to-shutdown-hook
|
|
5
|
+
|
|
6
|
+
> The only file this session reads from the plan. Self-contained: it never points at a sibling's brief. The `**Item slug**:` line is the key the execution commands grep for to detect that a brief is active — keep it exactly in that shape.
|
|
7
|
+
|
|
8
|
+
## Launch
|
|
9
|
+
|
|
10
|
+
/f-ops-plan work p0-plan-0922 S8
|
|
11
|
+
|
|
12
|
+
## Run
|
|
13
|
+
|
|
14
|
+
/f-feature-dev wire-debounce-flush-to-shutdown-hook
|
|
15
|
+
|
|
16
|
+
## Scope notes
|
|
17
|
+
|
|
18
|
+
Follow the doc's sequence. The owner decided to **persist, not flush**: the queue is cancelled and containers killed before the shutdown hooks run, inside a 10 s budget. `Debouncer.close(sink)` (step 2) is the delicate part. Read `src/core/debounce.ts` whole first: the stale-heal path and the `.finally()` identity guard are what a naive close breaks. S7 has landed by now and changed `src/core/handler.ts`, the shutdown path in `runtime.ts` and `SpaceQueue` settle. Rebase onto it and re-read those before step 3. **Deploy needs: restart** (no baked file, no version change). Confirm that with the release-gate §1 classification at deploy.
|
|
19
|
+
|
|
20
|
+
## Owned surfaces (predicted)
|
|
21
|
+
|
|
22
|
+
- src/core/debounce.ts
|
|
23
|
+
- src/core/handler.ts
|
|
24
|
+
- src/core/pending-ingress.ts
|
|
25
|
+
- src/core/runtime.ts
|
|
26
|
+
- src/main.ts
|
|
27
|
+
- src/storage/db.ts
|
|
28
|
+
- src/types.ts
|
|
29
|
+
- tests/debounce.test.ts
|
|
30
|
+
- tests/handler.test.ts
|
|
31
|
+
- tests/pending-ingress.test.ts
|
|
32
|
+
- tests/shutdown.test.ts
|
|
33
|
+
|
|
34
|
+
## Do not touch
|
|
35
|
+
|
|
36
|
+
- container/build.sh, src/agent/container-entry.ts, src/agent/container-env.ts, src/agent/container-runner.ts, src/cli/mrctl.ts, src/config.ts, src/core/api.ts, src/core/auth.ts, src/core/caller-token.ts, src/core/routes/console.ts, src/core/routes/media.ts, src/core/routes/storage.ts, src/preflight/checks/roundtrip.ts, tests/api-chat-auth.test.ts, tests/api-container-credential.test.ts, tests/api.test.ts, tests/console-routes.test.ts, tests/container-runner-create-args.test.ts, tests/media-storage-route.test.ts, tests/mrctl-http.test.ts, tests/preflight-roundtrip.test.ts (owned by S5 this plan)
|
|
37
|
+
- scripts/football-audit.ts, src/audit/ledger-queries.ts, src/config.ts, src/core/boot-reconcile.ts, src/core/operator-alerts.ts, src/core/routes/dashboard.ts, src/core/task-scheduler.ts, tests/boot-reconcile.test.ts, tests/dashboard-task-last-run.test.ts, tests/ledger-queries.test.ts, tests/operator-alerts.test.ts, tests/scheduler-interrupted-shutdown.test.ts, tests/scheduler-missed-runs.test.ts, tests/task-run-ledger.test.ts, tests/task-runs-migration.test.ts (owned by S6 this plan)
|
|
38
|
+
- src/adapters/whatsapp.ts, src/agent/container-error.ts, src/agent/container-runner.ts, src/bridges/whatsapp.ts, src/core/boot-reconcile.ts, src/core/chat-run-journal.ts, src/core/instance-lock.ts, src/core/space-queue.ts, src/core/system-messages.ts, tests/chat-run-journal.test.ts, tests/container-error.test.ts, tests/instance-lock.test.ts, tests/orphaned-run-recovery.e2e.test.ts, tests/space-queue.test.ts, tests/system-messages.test.ts (owned by S7 this plan)
|
|
39
|
+
- Not ours (avishai tsabari / Avishai-Tsabari, last 14 d): `src/core/runtime.ts`, `src/main.ts`, `src/storage/db.ts`, `src/config.ts`, `src/agent/container-runner.ts`, `src/agent/container-entry.ts`, `src/preflight/checks/roundtrip.ts`: see plan.md "Not ours". The lane is cleared by Q1 (ours). Re-check with `/f-ops-plan next p0-plan-0922`.
|
|
40
|
+
- Plan `sensitive-bugs-0922` fixes the sensitive-guard bugs in `src/core/runtime.ts` *after* this plan. Do not fix any of them here, even if you pass the code: `handleRawInput` → `checkSensitiveConnectionGuard`, the replay at ~1728, and the scheduler skip at ~1047.
|
|
41
|
+
|
|
42
|
+
## Edges
|
|
43
|
+
|
|
44
|
+
- start-after: none (satisfied — `next` launched you)
|
|
45
|
+
- merge-after: none
|
|
46
|
+
|
|
47
|
+
## Overlap verdicts
|
|
48
|
+
|
|
49
|
+
none
|
|
50
|
+
|
|
51
|
+
> The command's preflight overlap check treats a hit whose branch AND every shared file match a verdict line as answered (c), prints one `PLAN-PASSED(overlap): …` line, and carries it into the final report. Any other hit prompts as usual. The merge-time check is never waived.
|
|
52
|
+
|
|
53
|
+
## Decisions answered
|
|
54
|
+
|
|
55
|
+
- Q1: ours (owner, 2026-09-22). `src/core` and `src/agent` are this plan's lane.
|
|
56
|
+
|
|
57
|
+
## Ledger rules
|
|
58
|
+
|
|
59
|
+
- `docs/ROADMAP.md`: never edit. Your command writes `docs/pending-updates/wire-debounce-flush-to-shutdown-hook.md` as usual.
|
|
60
|
+
- `docs/pending-verification.md`: append only under `## Plan p0-plan-0922 / S8`.
|
|
61
|
+
- Any goal's `decisions.md`: never edit; put decisions in your log's "Siblings must know".
|
|
62
|
+
|
|
63
|
+
## Environment
|
|
64
|
+
|
|
65
|
+
- Read `CLAUDE.md` → Worktree Setup and Gotchas before opening the worktree. Nothing from them is copied here. `bun install` once in the fresh worktree; the check gate is `bun run check` (every link runs to completion — read every line).
|
|
66
|
+
|
|
67
|
+
## Report
|
|
68
|
+
|
|
69
|
+
Your command's final report is appended to `docs/plans/p0-plan-0922/sessions/S8.md` by its report step (path resolved through `.claude/scripts/resolve-docs-root.sh docs/plans/probe.md`). `work` verifies the append.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Decisions — plan p0-plan-0922
|
|
2
|
+
|
|
3
|
+
> Answer in the `Answer` column. Everything blocked on a question stays blocked until this column is non-empty for it. `build` and `next` add rows; only you write answers. Delete nothing — an answered row is the audit trail.
|
|
4
|
+
|
|
5
|
+
| ID | Blocks | Question | Options | Answer | Answered |
|
|
6
|
+
|----|--------|----------|---------|--------|----------|
|
|
7
|
+
| Q1 | S5, S6, S7, S8 | Lane: does avishai tsabari own `src/core` + `src/agent` (runtime.ts, main.ts, db.ts, config.ts, container-runner.ts; latest touch 2026-09-13)? | ours / theirs / split | ours: no worktree open, not mid-change | 2026-09-22 (owner) |
|
|
8
|
+
|
|
9
|
+
> No owner-blocked questions at build. The Open Questions in each idea were design questions, and their planning sessions resolved them. Q1 was added at `--rebuild` by the lane measurement.
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# Plan: p0-plan-0922
|
|
2
|
+
|
|
3
|
+
**Status**: Active
|
|
4
|
+
**Created**: 2026-09-22 **Last updated**: 2026-09-22 (rebuilt after Round 0)
|
|
5
|
+
**Landing mode**: pr
|
|
6
|
+
**Max width**: 4
|
|
7
|
+
**Inputs**: p0-plan-0922 require-caller-token-for-container-originated-requests sensitive-guard-one-read sensitive-opt-out-should-deny-not-block ledger-misses-interrupted-runs orphaned-run-recovery wire-debounce-flush-to-shutdown-hook (from docs/notes/2026-09-22-open-items-priority-scan.md P0 #2, #5, #6) · rebuilt 2026-09-22: `--rebuild`, adding the four implementation sessions S5–S8
|
|
8
|
+
**Me**: saharw01, Saharw01@gmail.com (also 92163791+saharw01@users.noreply.github.com, avishailevi2@gmail.com)
|
|
9
|
+
|
|
10
|
+
> Written by `/f-ops-plan` build (and `--rebuild`) and `archive` only. Nothing perishable lives here — no base sha, no other author's file list, no story counts; `next` measures those every time it runs. `plan-state.sh` parses the tables below by their header row, so keep the column order.
|
|
11
|
+
|
|
12
|
+
> **Why this batch.** This is the idea half of the 2026-09-22 open-items scan's suggested round. Round 0 (S1–S4, frozen) planned the four ideas and landed in `83384ee`. The rebuild adds one implementation session per item (S5–S8). The bugs from the same scan are the archived sibling plan `p0-bugs-0922`. **Strictly serial.** S6, S7 and S8 all touch `src/core/runtime.ts`, `src/main.ts` and `src/storage/db.ts`. S5 shares `src/config.ts` with S6 and `src/agent/container-runner.ts` with S7. So every round has width 1, and that is measured, not chosen. **Sibling plan:** the five sensitive-guard bugs that bench-patterns-0915 S6 filed are plan `sensitive-bugs-0922`. The owner chose features first (2026-09-22), so that plan's sessions start after S8 here, by cross-plan edges it owns.
|
|
13
|
+
|
|
14
|
+
## Items
|
|
15
|
+
|
|
16
|
+
| ID | Kind | Slug | Doc | Command | Round | Needs |
|
|
17
|
+
|----|------|------|-----|---------|-------|-------|
|
|
18
|
+
| S1 | plan | require-caller-token-for-container-originated-requests | docs/ideas/require-caller-token-for-container-originated-requests.md | /f-feature-planning require-caller-token-for-container-originated-requests | 0 | — |
|
|
19
|
+
| S2 | plan | ledger-misses-interrupted-runs | docs/ideas/ledger-misses-interrupted-runs.md | /f-feature-planning ledger-misses-interrupted-runs | 0 | — |
|
|
20
|
+
| S3 | plan | orphaned-run-recovery | docs/ideas/orphaned-run-recovery.md | /f-feature-planning orphaned-run-recovery | 0 | — |
|
|
21
|
+
| S4 | plan | wire-debounce-flush-to-shutdown-hook | docs/ideas/wire-debounce-flush-to-shutdown-hook.md | /f-feature-planning wire-debounce-flush-to-shutdown-hook | 0 | — |
|
|
22
|
+
| S5 | feature | require-caller-token-for-container-originated-requests | docs/backlog/require-caller-token-for-container-originated-requests.md | /f-feature-dev require-caller-token-for-container-originated-requests | 1 | — |
|
|
23
|
+
| S6 | feature | ledger-misses-interrupted-runs | docs/backlog/ledger-misses-interrupted-runs.md | /f-feature-dev ledger-misses-interrupted-runs | 2 | — |
|
|
24
|
+
| S7 | feature | orphaned-run-recovery | docs/backlog/orphaned-run-recovery.md | /f-feature-dev orphaned-run-recovery | 3 | — |
|
|
25
|
+
| S8 | feature | wire-debounce-flush-to-shutdown-hook | docs/backlog/wire-debounce-flush-to-shutdown-hook.md | /f-feature-dev wire-debounce-flush-to-shutdown-hook | 4 | — |
|
|
26
|
+
|
|
27
|
+
> Kind ∈ `feature` | `bug` | `refactor` | `plan` (a Round 0 planning session) | `story` (from `--goal`; runs `/f-feature-dev`).
|
|
28
|
+
> Needs = decision IDs from `decisions.md` that must be answered before this session may launch, or `—`.
|
|
29
|
+
> IDs are never renumbered; `--drop` moves a row to Deferred, `--add` takes the next unused ID.
|
|
30
|
+
|
|
31
|
+
## Edges
|
|
32
|
+
|
|
33
|
+
| From | To | Kind | Basis |
|
|
34
|
+
|------|----|------|-------|
|
|
35
|
+
| S2 | S3 | merge-after | semantic: orphaned-run-recovery's startup sweep builds on the ledger's insert-at-start / reconcile-on-boot row (user) |
|
|
36
|
+
| S5 | S6 | start-after | file: src/config.ts (both predicted) |
|
|
37
|
+
| S5 | S7 | start-after | file: src/agent/container-runner.ts (both predicted) |
|
|
38
|
+
| S6 | S7 | start-after | file: src/core/runtime.ts (both predicted; also src/main.ts, src/storage/db.ts, src/core/boot-reconcile.ts) |
|
|
39
|
+
| S6 | S8 | start-after | file: src/core/runtime.ts (both predicted; also src/main.ts, src/storage/db.ts, src/types.ts) |
|
|
40
|
+
| S7 | S8 | start-after | file: src/core/runtime.ts (both predicted; also src/main.ts, src/storage/db.ts, src/core/handler.ts, tests/handler.test.ts, tests/shutdown.test.ts) |
|
|
41
|
+
| S6 | S7 | merge-after | semantic: orphaned-run-recovery's reconciler (its steps 5–6) appends to the `BOOT_RECONCILERS` seam that ledger-misses-interrupted-runs creates in `src/core/boot-reconcile.ts` (user) |
|
|
42
|
+
|
|
43
|
+
> Kind ∈ `start-after` (To may not launch until From is landed) | `merge-after` (To may launch now, may not land until From is landed).
|
|
44
|
+
> Basis starts with `file:` (inferred from the collision map) or `semantic:` (asked) — never mixed in one row.
|
|
45
|
+
> From may name a session of ANOTHER active plan as `{plan-slug}/S{n}` — always `start-after`, always `file:`; resolved at `next` time by deriving that plan's state.
|
|
46
|
+
|
|
47
|
+
## Rounds
|
|
48
|
+
|
|
49
|
+
### Round 0 — unblock (landed; committed in 83384ee)
|
|
50
|
+
|
|
51
|
+
| Session | Action | Clears |
|
|
52
|
+
|---------|--------|--------|
|
|
53
|
+
| S1 | /f-feature-planning require-caller-token-for-container-originated-requests | S5 |
|
|
54
|
+
| S2 | /f-feature-planning ledger-misses-interrupted-runs | S6 |
|
|
55
|
+
| S3 | /f-feature-planning orphaned-run-recovery | S7 |
|
|
56
|
+
| S4 | /f-feature-planning wire-debounce-flush-to-shutdown-hook | S8 |
|
|
57
|
+
|
|
58
|
+
### Round 1 — width 1
|
|
59
|
+
|
|
60
|
+
| Session | Action | Clears |
|
|
61
|
+
|---------|--------|--------|
|
|
62
|
+
| S5 | /f-feature-dev require-caller-token-for-container-originated-requests | S6, S7 (src/config.ts, container-runner.ts) |
|
|
63
|
+
|
|
64
|
+
### Round 2 — width 1
|
|
65
|
+
|
|
66
|
+
| Session | Action | Clears |
|
|
67
|
+
|---------|--------|--------|
|
|
68
|
+
| S6 | /f-feature-dev ledger-misses-interrupted-runs | S7, S8 |
|
|
69
|
+
|
|
70
|
+
### Round 3 — width 1
|
|
71
|
+
|
|
72
|
+
| Session | Action | Clears |
|
|
73
|
+
|---------|--------|--------|
|
|
74
|
+
| S7 | /f-feature-dev orphaned-run-recovery | S8 |
|
|
75
|
+
|
|
76
|
+
### Round 4 — width 1
|
|
77
|
+
|
|
78
|
+
| Session | Action | Clears |
|
|
79
|
+
|---------|--------|--------|
|
|
80
|
+
| S8 | /f-feature-dev wire-debounce-flush-to-shutdown-hook | sensitive-bugs-0922 (its cross-plan edges) |
|
|
81
|
+
|
|
82
|
+
## Collision map
|
|
83
|
+
|
|
84
|
+
> Whole files, predicted; `docs/` and infrastructure paths are excluded exactly as `overlap-check.sh` excludes them (the predictor's `docs/…` hits, bare basenames that duplicate a full path, and host paths such as `~/sync-mercury.sh`, `.env` and `bin/pi` are ignored: 38 such paths, 110 predicted → 72 kept). Line ranges are folded into their file.
|
|
85
|
+
|
|
86
|
+
| File | Sessions |
|
|
87
|
+
|------|----------|
|
|
88
|
+
| src/core/runtime.ts | S6, S7, S8 |
|
|
89
|
+
| src/main.ts | S6, S7, S8 |
|
|
90
|
+
| src/storage/db.ts | S6, S7, S8 |
|
|
91
|
+
| src/config.ts | S5, S6 |
|
|
92
|
+
| src/agent/container-runner.ts | S5, S7 |
|
|
93
|
+
| src/core/boot-reconcile.ts (new) | S6, S7 |
|
|
94
|
+
| src/types.ts | S6, S8 |
|
|
95
|
+
| src/core/handler.ts | S7, S8 |
|
|
96
|
+
| tests/handler.test.ts | S7, S8 |
|
|
97
|
+
| tests/shutdown.test.ts | S7, S8 |
|
|
98
|
+
|
|
99
|
+
## Predicted surfaces
|
|
100
|
+
|
|
101
|
+
### S1
|
|
102
|
+
|
|
103
|
+
### S2
|
|
104
|
+
|
|
105
|
+
### S3
|
|
106
|
+
|
|
107
|
+
### S4
|
|
108
|
+
|
|
109
|
+
### S5
|
|
110
|
+
|
|
111
|
+
- container/build.sh
|
|
112
|
+
- src/agent/container-entry.ts
|
|
113
|
+
- src/agent/container-env.ts
|
|
114
|
+
- src/agent/container-runner.ts
|
|
115
|
+
- src/cli/mrctl.ts
|
|
116
|
+
- src/config.ts
|
|
117
|
+
- src/core/api.ts
|
|
118
|
+
- src/core/auth.ts
|
|
119
|
+
- src/core/caller-token.ts
|
|
120
|
+
- src/core/routes/console.ts
|
|
121
|
+
- src/core/routes/media.ts
|
|
122
|
+
- src/core/routes/storage.ts
|
|
123
|
+
- src/preflight/checks/roundtrip.ts
|
|
124
|
+
- tests/api-chat-auth.test.ts
|
|
125
|
+
- tests/api-container-credential.test.ts
|
|
126
|
+
- tests/api.test.ts
|
|
127
|
+
- tests/console-routes.test.ts
|
|
128
|
+
- tests/container-runner-create-args.test.ts
|
|
129
|
+
- tests/media-storage-route.test.ts
|
|
130
|
+
- tests/mrctl-http.test.ts
|
|
131
|
+
- tests/preflight-roundtrip.test.ts
|
|
132
|
+
|
|
133
|
+
### S6
|
|
134
|
+
|
|
135
|
+
- scripts/football-audit.ts
|
|
136
|
+
- src/audit/ledger-queries.ts
|
|
137
|
+
- src/config.ts
|
|
138
|
+
- src/core/boot-reconcile.ts
|
|
139
|
+
- src/core/operator-alerts.ts
|
|
140
|
+
- src/core/routes/dashboard.ts
|
|
141
|
+
- src/core/runtime.ts
|
|
142
|
+
- src/core/task-scheduler.ts
|
|
143
|
+
- src/main.ts
|
|
144
|
+
- src/storage/db.ts
|
|
145
|
+
- src/types.ts
|
|
146
|
+
- tests/boot-reconcile.test.ts
|
|
147
|
+
- tests/dashboard-task-last-run.test.ts
|
|
148
|
+
- tests/ledger-queries.test.ts
|
|
149
|
+
- tests/operator-alerts.test.ts
|
|
150
|
+
- tests/scheduler-interrupted-shutdown.test.ts
|
|
151
|
+
- tests/scheduler-missed-runs.test.ts
|
|
152
|
+
- tests/task-run-ledger.test.ts
|
|
153
|
+
- tests/task-runs-migration.test.ts
|
|
154
|
+
|
|
155
|
+
### S7
|
|
156
|
+
|
|
157
|
+
- src/adapters/whatsapp.ts
|
|
158
|
+
- src/agent/container-error.ts
|
|
159
|
+
- src/agent/container-runner.ts
|
|
160
|
+
- src/bridges/whatsapp.ts
|
|
161
|
+
- src/core/boot-reconcile.ts
|
|
162
|
+
- src/core/chat-run-journal.ts
|
|
163
|
+
- src/core/handler.ts
|
|
164
|
+
- src/core/instance-lock.ts
|
|
165
|
+
- src/core/runtime.ts
|
|
166
|
+
- src/core/space-queue.ts
|
|
167
|
+
- src/core/system-messages.ts
|
|
168
|
+
- src/main.ts
|
|
169
|
+
- src/storage/db.ts
|
|
170
|
+
- tests/chat-run-journal.test.ts
|
|
171
|
+
- tests/container-error.test.ts
|
|
172
|
+
- tests/handler.test.ts
|
|
173
|
+
- tests/instance-lock.test.ts
|
|
174
|
+
- tests/orphaned-run-recovery.e2e.test.ts
|
|
175
|
+
- tests/shutdown.test.ts
|
|
176
|
+
- tests/space-queue.test.ts
|
|
177
|
+
- tests/system-messages.test.ts
|
|
178
|
+
|
|
179
|
+
### S8
|
|
180
|
+
|
|
181
|
+
- src/core/debounce.ts
|
|
182
|
+
- src/core/handler.ts
|
|
183
|
+
- src/core/pending-ingress.ts
|
|
184
|
+
- src/core/runtime.ts
|
|
185
|
+
- src/main.ts
|
|
186
|
+
- src/storage/db.ts
|
|
187
|
+
- src/types.ts
|
|
188
|
+
- tests/debounce.test.ts
|
|
189
|
+
- tests/handler.test.ts
|
|
190
|
+
- tests/pending-ingress.test.ts
|
|
191
|
+
- tests/shutdown.test.ts
|
|
192
|
+
|
|
193
|
+
## Adjudicated overlaps
|
|
194
|
+
|
|
195
|
+
> Pre-answers for the execution commands' preflight overlap prompt. Scoped to exact branch + file pairs on branches that belong to NO active plan (a hand-opened worktree, another contributor). A branch of a sibling plan's session is never listed here — it becomes a cross-plan edge instead.
|
|
196
|
+
|
|
197
|
+
| Session | Branch (not in this plan) | Files | Verdict | Decided |
|
|
198
|
+
|---------|---------------------------|-------|---------|---------|
|
|
199
|
+
|
|
200
|
+
> Rebuild measurement 2026-09-22: no worktree other than the primary checkout, and no `worktree-*` branch. Nothing to adjudicate.
|
|
201
|
+
|
|
202
|
+
## Not ours
|
|
203
|
+
|
|
204
|
+
> Last measurement (`git log --since=14.days`, authors not in `Me`). Re-measured on every `next`; this table is the snapshot the briefs were written from.
|
|
205
|
+
|
|
206
|
+
| File / area | Author | Basis |
|
|
207
|
+
|-------------|--------|-------|
|
|
208
|
+
| src/core/runtime.ts, src/main.ts, src/storage/db.ts, src/config.ts | avishai tsabari / Avishai-Tsabari | 14-day log (latest `eaf58ba` 2026-09-13, /spaces link); S6, S7, S8 (and S5 for config.ts). Lane: Q1 = ours |
|
|
209
|
+
| src/agent/container-runner.ts, src/agent/container-entry.ts, src/preflight/checks/roundtrip.ts, tests/container-runner-create-args.test.ts, tests/preflight-roundtrip.test.ts | avishai tsabari / Avishai-Tsabari | 14-day log (2026-09-11 container fixes); S5, S7. Lane: Q1 = ours |
|
|
210
|
+
|
|
211
|
+
## Deferred
|
|
212
|
+
|
|
213
|
+
| Item | Reason | Home |
|
|
214
|
+
|------|--------|------|
|
|
215
|
+
| sensitive-opt-out-should-deny-not-block | moved to plan sensitive-bugs-0922 (rebuild 2026-09-22): the guard read landed; the opt-out now waits for B1 `sensitive-gate-is-checked-before-the-space-queue`, which that plan holds | docs/ideas/sensitive-opt-out-should-deny-not-block.md |
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
## Launched — 2026-09-22T19:30Z
|
|
2
|
+
Branch: —
|
|
3
|
+
|
|
4
|
+
## Report — 2026-09-22T21:05Z
|
|
5
|
+
Outcome: delivered
|
|
6
|
+
Delivered: local (uncommitted — shared checkout; committed with Round 0)
|
|
7
|
+
Blocked-on: —
|
|
8
|
+
Deploy needs: none
|
|
9
|
+
Files changed:
|
|
10
|
+
- docs/backlog/require-caller-token-for-container-originated-requests.md
|
|
11
|
+
- docs/ideas/require-caller-token-for-container-originated-requests.md (deleted — promoted)
|
|
12
|
+
- docs/ROADMAP.md (Next row 14)
|
|
13
|
+
Siblings must know:
|
|
14
|
+
- none
|
|
15
|
+
--- final report (verbatim) ---
|
|
16
|
+
~~~
|
|
17
|
+
Not captured. The owner ran /f-feature-planning require-caller-token-for-container-originated-requests directly, not through
|
|
18
|
+
/f-ops-plan work, so this block was backfilled at cleanup (2026-09-22). Launch
|
|
19
|
+
time is approximate. Outcome is delivered because
|
|
20
|
+
docs/backlog/require-caller-token-for-container-originated-requests.md predicts surfaces and the owner approved its
|
|
21
|
+
architecture.
|
|
22
|
+
~~~
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
## Launched — 2026-09-22T19:30Z
|
|
2
|
+
Branch: —
|
|
3
|
+
|
|
4
|
+
## Report — 2026-09-22T21:05Z
|
|
5
|
+
Outcome: delivered
|
|
6
|
+
Delivered: local (uncommitted — shared checkout; committed with Round 0)
|
|
7
|
+
Blocked-on: —
|
|
8
|
+
Deploy needs: none
|
|
9
|
+
Files changed:
|
|
10
|
+
- docs/backlog/ledger-misses-interrupted-runs.md
|
|
11
|
+
- docs/ideas/ledger-misses-interrupted-runs.md (deleted — promoted)
|
|
12
|
+
- docs/ROADMAP.md (Next row 15)
|
|
13
|
+
Siblings must know:
|
|
14
|
+
- none
|
|
15
|
+
--- final report (verbatim) ---
|
|
16
|
+
~~~
|
|
17
|
+
Not captured. The owner ran /f-feature-planning ledger-misses-interrupted-runs directly, not through
|
|
18
|
+
/f-ops-plan work, so this block was backfilled at cleanup (2026-09-22). Launch
|
|
19
|
+
time is approximate. Outcome is delivered because
|
|
20
|
+
docs/backlog/ledger-misses-interrupted-runs.md predicts surfaces and the owner approved its
|
|
21
|
+
architecture.
|
|
22
|
+
~~~
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
## Launched — 2026-09-22T19:30Z
|
|
2
|
+
Branch: —
|
|
3
|
+
|
|
4
|
+
## Report — 2026-09-22T21:05Z
|
|
5
|
+
Outcome: delivered
|
|
6
|
+
Delivered: local (uncommitted — shared checkout; committed with Round 0)
|
|
7
|
+
Blocked-on: —
|
|
8
|
+
Deploy needs: none
|
|
9
|
+
Files changed:
|
|
10
|
+
- docs/backlog/orphaned-run-recovery.md
|
|
11
|
+
- docs/ideas/orphaned-run-recovery.md (deleted — promoted)
|
|
12
|
+
- docs/ROADMAP.md (Next row 16)
|
|
13
|
+
Siblings must know:
|
|
14
|
+
- none
|
|
15
|
+
--- final report (verbatim) ---
|
|
16
|
+
~~~
|
|
17
|
+
Not captured. The owner ran /f-feature-planning orphaned-run-recovery directly, not through
|
|
18
|
+
/f-ops-plan work, so this block was backfilled at cleanup (2026-09-22). Launch
|
|
19
|
+
time is approximate. Outcome is delivered because
|
|
20
|
+
docs/backlog/orphaned-run-recovery.md predicts surfaces and the owner approved its
|
|
21
|
+
architecture.
|
|
22
|
+
~~~
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
## Launched — 2026-09-22T19:30Z
|
|
2
|
+
Branch: —
|
|
3
|
+
|
|
4
|
+
## Report — 2026-09-22T21:05Z
|
|
5
|
+
Outcome: delivered
|
|
6
|
+
Delivered: local (uncommitted — shared checkout; committed with Round 0)
|
|
7
|
+
Blocked-on: —
|
|
8
|
+
Deploy needs: none
|
|
9
|
+
Files changed:
|
|
10
|
+
- docs/backlog/wire-debounce-flush-to-shutdown-hook.md
|
|
11
|
+
- docs/ideas/wire-debounce-flush-to-shutdown-hook.md (deleted — promoted)
|
|
12
|
+
- docs/ROADMAP.md (Next row 17)
|
|
13
|
+
Siblings must know:
|
|
14
|
+
- none
|
|
15
|
+
--- final report (verbatim) ---
|
|
16
|
+
~~~
|
|
17
|
+
Not captured. The owner ran /f-feature-planning wire-debounce-flush-to-shutdown-hook directly, not through
|
|
18
|
+
/f-ops-plan work, so this block was backfilled at cleanup (2026-09-22). Launch
|
|
19
|
+
time is approximate. Outcome is delivered because
|
|
20
|
+
docs/backlog/wire-debounce-flush-to-shutdown-hook.md predicts surfaces and the owner approved its
|
|
21
|
+
architecture.
|
|
22
|
+
~~~
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
## Launched — 2026-09-22T22:04Z
|
|
2
|
+
Branch: worktree-feature-require-caller-token-for-container-originated-requests
|
|
3
|
+
|
|
4
|
+
## Report — 2026-09-23T10:44Z
|
|
5
|
+
Outcome: delivered
|
|
6
|
+
Delivered: —
|
|
7
|
+
Blocked-on: —
|
|
8
|
+
Deploy needs: rebuild — container/build.sh, restart in a proven gap, wait for "Built derived agent image" (mrctl.ts + mrctl-http.ts are baked)
|
|
9
|
+
Files changed:
|
|
10
|
+
- docs/archive/permissions-and-config/2026-09-23-require-caller-token-for-container-originated-requests.md
|
|
11
|
+
- docs/archive/applicative-profiles/2026-07-01-caller-bound-capability-token.md
|
|
12
|
+
- docs/container-lifecycle.md
|
|
13
|
+
- docs/ideas/rotate-api-secret-after-caller-token-cutover.md
|
|
14
|
+
- docs/pending-updates/require-caller-token-for-container-originated-requests.md
|
|
15
|
+
- src/agent/container-env.ts
|
|
16
|
+
- src/agent/container-runner.ts
|
|
17
|
+
- src/cli/mrctl-http.ts
|
|
18
|
+
- src/cli/mrctl.ts
|
|
19
|
+
- src/core/api.ts
|
|
20
|
+
- src/core/routes/media.ts
|
|
21
|
+
- src/preflight/checks/roundtrip.ts
|
|
22
|
+
- tests/api-container-credential.test.ts
|
|
23
|
+
- tests/container-runner-create-args.test.ts
|
|
24
|
+
- tests/destructive-command-guards.test.ts
|
|
25
|
+
- tests/media-storage-route.test.ts
|
|
26
|
+
- tests/mrctl-http.test.ts
|
|
27
|
+
- tests/preflight-roundtrip.test.ts
|
|
28
|
+
Siblings must know:
|
|
29
|
+
- `buildAgentCreateArgs` now routes every env pair through `pushEnv`, which drops any `-e` whose `KEY=value` contains a host secret (`hostSecretValues(config)` in `src/agent/container-env.ts`) and reports the key via `onSecretStripped`. S6/S7 editing `container-runner.ts`: add env through `envPairs`/`extraEnv`, never a bare `args.push("-e", …)`.
|
|
30
|
+
- `reply()` no longer passes `API_SECRET`; `CALLER_TOKEN` is a container's only credential. Anything in-container that calls `/api` must send `x-mercury-token` (no bearer needed); `/api/console/*`, `/dashboard/*`, `/chat`, `/pre-build-ext-image` are unreachable from a container.
|
|
31
|
+
- `/api` identity is now trustworthy: a present token decides it, headers only behind the operator secret. sensitive-bugs-0922 S1/S5 (gated on this session) can narrow on `auth.callerId` without re-checking for header forgery.
|
|
32
|
+
- `src/config.ts` was NOT touched (no new key).
|
|
33
|
+
--- final report (verbatim) ---
|
|
34
|
+
~~~
|
|
35
|
+
S5 require-caller-token-for-container-originated-requests — squashed to LOCAL dev as 7aecf70, NOT pushed (owner approval required per CLAUDE.local.md; landing derives once the archive is on origin/dev).
|
|
36
|
+
- /api: two principals. Present x-mercury-token (empty counts) → verified or 401, never a fall-through; identity from the token. No token → Bearer API_SECRET + identity headers, logged "API request on the operator credential". 503 when no secret configured, either principal.
|
|
37
|
+
- reply() no longer passes API_SECRET; buildAgentCreateArgs strips any -e pair whose value contains apiSecret/chatApiKey/callerTokenKey/shadowApiSecret (envPairs and extension env), logging the key at error.
|
|
38
|
+
- mrctl: refuses with no credential (exit 1, "no credential — CALLER_TOKEN is not set …"); `mrctl disk` → GET /api/media/storage behind media.purge (admin-only — behaviour change for members).
|
|
39
|
+
- Preflight: token mode presents the caller token alone; headers mode is the operator path and its pass title says the token leg was not exercised.
|
|
40
|
+
- Docs: container-lifecycle two-principal section; archived caller-bound-token design carries a dated correction; residual idea docs/ideas/rotate-api-secret-after-caller-token-cutover.md (not before one week after live proof).
|
|
41
|
+
- Gate: ~/check-mercury.sh check → 12/12 links, 5829 pass / 9 skip / 0 fail. Every new guard negative-tested (deleted → red). Code review: no bugs, 3 small fixes applied. QA: 24/30 pass, 6 deferred MANUAL-VERIFY (live only), 0 fail.
|
|
42
|
+
- Deviations: branched from local dev (origin/dev lacked 2 local docs commits and the promotion — nothing pushed); tests/destructive-command-guards.test.ts needed CALLER_TOKEN in its stub mrctl env; mrctl-http.ts (baked) gained credentialHeaders.
|
|
43
|
+
- PLAN-PASSED(overlap): none — preflight overlap check was clean (exit 0).
|
|
44
|
+
~~~
|