mercury-agent 0.23.2 → 0.24.1
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 +16 -12
- 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 +621 -90
- 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,30 @@
|
|
|
1
|
+
## Launched — 2026-09-23T11:39Z
|
|
2
|
+
Branch: —
|
|
3
|
+
|
|
4
|
+
## Report — 2026-09-23T15:10Z
|
|
5
|
+
Outcome: delivered
|
|
6
|
+
Delivered: —
|
|
7
|
+
Blocked-on: —
|
|
8
|
+
Deploy needs: none
|
|
9
|
+
Files changed:
|
|
10
|
+
- docs/backlog/ratchet-shapes-the-summaries-named.md
|
|
11
|
+
- docs/ideas/ratchet-shapes-the-summaries-named.md (deleted — promoted)
|
|
12
|
+
- docs/ROADMAP.md (Inbox row → Next #20)
|
|
13
|
+
Siblings must know:
|
|
14
|
+
- The spec predicts 17 surfaces, all under scripts/, tests/, package.json and CLAUDE.md; no src/ file is edited. --rebuild must re-cut the implementation session against them.
|
|
15
|
+
- It edits package.json (the check:* scripts and the lint / lint:fix lists) and scripts/check.ts (LINKS). Any session touching either collides.
|
|
16
|
+
- The new gates scan src/ and examples/. Any item landing code there first changes the day-one baselines; the implementation session re-measures, so nothing blocks on it.
|
|
17
|
+
- Two candidate bugs were found by the measurement and are not filed (a planning session writes only its own doc): src/core/handler.ts:315 (the "denied" sendReply awaited outside any try) and src/core/media.ts:233 (no content-length means the whole body is buffered before the size check). OQ4 recommends /f-bug-report for both before /f-feature-dev.
|
|
18
|
+
- Open Questions 1–5 carry recommendations; the owner approved the Goal and the Architecture, but has not answered the questions one by one.
|
|
19
|
+
--- final report (verbatim) ---
|
|
20
|
+
~~~
|
|
21
|
+
/f-feature-planning ratchet-shapes-the-summaries-named — Goal approved, Architecture approved (2026-09-23).
|
|
22
|
+
Idea promoted to docs/backlog/ratchet-shapes-the-summaries-named.md; ROADMAP Next #20.
|
|
23
|
+
Design: scripts/lib/ratchet.ts (masking lexer, brace-depth block walker, scan, baseline diff, runGate) plus four
|
|
24
|
+
gates, check:early-return-no-log (A), check:bare-delivery-await (B), check:absent-allows (C) and
|
|
25
|
+
check:unbounded-race (D). Each has its own baseline and check.ts link, and each prints file:line and a fix line.
|
|
26
|
+
tests/check-ratchets.test.ts pins each post-mortem's pre-fix code as a fixture (9739fa0, 00ffdc0^, 1794a25^, bb3ca14^,
|
|
27
|
+
a24eb6d) and negative-tests each detector. The old gates are untouched. Dev-only: no deploy.
|
|
28
|
+
Planning measurement (not the baseline): A 0, B 1, C 5+4, D 0+17.
|
|
29
|
+
Next step: /f-ops-plan bench-patterns-0915 --rebuild, then /f-feature-dev ratchet-shapes-the-summaries-named.
|
|
30
|
+
~~~
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
## Launched — 2026-09-23T11:40Z
|
|
2
|
+
Branch: —
|
|
3
|
+
|
|
4
|
+
## Report — 2026-09-23T15:10Z
|
|
5
|
+
Outcome: delivered
|
|
6
|
+
Delivered: —
|
|
7
|
+
Blocked-on: —
|
|
8
|
+
Deploy needs: none
|
|
9
|
+
Files changed:
|
|
10
|
+
- docs/backlog/inventories-as-files.md
|
|
11
|
+
- docs/ideas/inventories-as-files.md (deleted — promoted)
|
|
12
|
+
- docs/ROADMAP.md (Inbox row → Next #19)
|
|
13
|
+
Siblings must know:
|
|
14
|
+
- The spec predicts 20 surfaces, all under tests/ plus CLAUDE.md and docs; none under src/, examples/, resources/ or scripts/. --rebuild must add the implementation session (/f-feature-dev inventories-as-files) against them.
|
|
15
|
+
- Read-only sources (src/config.ts, src/core/runtime.ts, the spawn files) are named in plain text on purpose, so they are not predicted as write surfaces; the inventories read them at test time.
|
|
16
|
+
- sensitive-bugs-0922 S1–S5: if this feature lands first, each fix that archives its bug doc turns tests/inventory-guard-axes.test.ts red, and that fix must rewrite its `none` cell to cite the new test. Intended; either landing order works.
|
|
17
|
+
- feed-watch-triaged-roundup: its triage.ts is a fifth pi spawn; whichever lands second adds the row to tests/inventories/pi-spawns.ts.
|
|
18
|
+
- CLAUDE.md's pi-spawn gotcha links docs/ideas/inventories-as-files.md, deleted by this session; implementation Step 7 repoints it (a planning session may not edit CLAUDE.md).
|
|
19
|
+
- S7 (ratchet-shapes-the-summaries-named) has no coupling to this spec; its Goal no longer reads an inventory.
|
|
20
|
+
--- final report (verbatim) ---
|
|
21
|
+
~~~
|
|
22
|
+
/f-feature-planning inventories-as-files — Goal approved, Architecture approved (2026-09-23).
|
|
23
|
+
Idea promoted to docs/backlog/inventories-as-files.md; ROADMAP Next #19.
|
|
24
|
+
Design: four typed-TS inventories in tests/inventories/ (pi-spawns 4, run-entries 12 occurrences / 7 calls,
|
|
25
|
+
host-limits 22 keys, guard-axes 5 legs × 12 axes), each with a two-way closure test built on a fail-closed
|
|
26
|
+
lexer + multi-line scan in tests/helpers/ (no AST, no new dependency); every gap names an open bug doc;
|
|
27
|
+
no line numbers stored; permanent negative controls plus recorded manual negatives. Tests + docs only →
|
|
28
|
+
deploy class none. Re-checked after S4 (shadow-own-credential): no effect on the four sets.
|
|
29
|
+
Next step: /f-ops-plan bench-patterns-0915 --rebuild, then /f-feature-dev inventories-as-files.
|
|
30
|
+
~~~
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Brief S1 — video understanding: a global extension that watches and listens
|
|
2
|
+
|
|
3
|
+
**Plan**: docs/plans/flat-0916/plan.md **Session**: S1 **Round**: 0 **Kind**: plan
|
|
4
|
+
**Item slug**: video-understanding-extension
|
|
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 flat-0916 S1
|
|
11
|
+
|
|
12
|
+
## Run
|
|
13
|
+
|
|
14
|
+
/f-feature-planning video-understanding-extension
|
|
15
|
+
|
|
16
|
+
## Scope notes
|
|
17
|
+
|
|
18
|
+
Read the idea in full — its "How It Might Work" table and "Numbers collected on 2026-09-15" are the architecture's raw material, and its six Open Questions are the decisions to settle with the owner (hook vs skill; where the visual track runs for provider `anthropic`; the Gemini free-tier privacy warning; whether quoted video gets its own lower cap; whether `voice-transcribe`'s provider code factors out or `video` depends on it; which extension owns `yt-dlp`). Key files: `src/adapters/whatsapp-media.ts` (`QUOTED_DOWNLOAD_TYPES`, L329), `examples/extensions/voice-transcribe/index.ts` (the transcriber providers and the `mercury.config` shape to mirror), `examples/extensions/pdf/` (the `mercury.cli` + `install:` shape), `src/extensions/image-builder.ts` (how `install:` becomes RUN lines in the derived image), `src/agent/container-env.ts` L88 (`MODEL_PROVIDER_ENV_VARS` — why `GEMINI_API_KEY` leaks in today; the extension must claim its own `hostOnly` keys instead), `src/config-file.ts` L205 (`media.max_size_mb`), `src/core/trigger.ts` L24 (`media_in_groups`), `examples/profiles/tel-aviv-flat-search/AGENTS.md` L148 (the paragraph the feature replaces — a facts rule: the card quotes the `[Video]` block, never "as you saw"). Any nested model call must follow the pi-spawn rule in `CLAUDE.md` (own the whole system prompt, the space's own leg) and the host-thread rule (a bound and a log line). Deploy class to state in the spec: the ingest line is a host restart; the `install:` string is a **derived-image rebuild** on the first container run; the profile paragraph is an `apply`. Live checks belong in `docs/pending-verification.md` under `## Plan flat-0916 / S1` only.
|
|
19
|
+
|
|
20
|
+
## Owned surfaces (predicted)
|
|
21
|
+
|
|
22
|
+
- (none yet — `docs/backlog/video-understanding-extension.md` is the deliverable)
|
|
23
|
+
|
|
24
|
+
## Do not touch
|
|
25
|
+
|
|
26
|
+
- Everything outside your item's doc and `docs/backlog/` — planning sessions write docs only. Plan `bugs-0915` owns `src/bridges/`, `src/core/conversation.ts`, `src/ops/shadow-snapshot.ts`, `src/ops/shadow-service.ts`, `src/storage/pi-auth.ts`; name them in your Architecture if you must, do not edit them.
|
|
27
|
+
- `docs/ROADMAP.md`: your command's Step 4.5 row is the one edit; you share the file with sibling planning sessions (this plan's S2 and `bench-patterns-0915` S4–S8) and there is no lock — planning sessions run one at a time for that reason.
|
|
28
|
+
- `examples/profiles/tel-aviv-flat-search/`: the implementation session revises it; you only name the change.
|
|
29
|
+
|
|
30
|
+
## Edges
|
|
31
|
+
|
|
32
|
+
- start-after: none (satisfied — `next` launched you)
|
|
33
|
+
- merge-after: none
|
|
34
|
+
|
|
35
|
+
## Overlap verdicts
|
|
36
|
+
|
|
37
|
+
none
|
|
38
|
+
|
|
39
|
+
> 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.
|
|
40
|
+
|
|
41
|
+
## Decisions answered
|
|
42
|
+
|
|
43
|
+
- none — no `Q` rows at build; the idea's open questions are yours to settle with the owner.
|
|
44
|
+
|
|
45
|
+
## Shared checkout (kind `plan`)
|
|
46
|
+
|
|
47
|
+
You share the primary checkout with sibling planning sessions — touch only your item's doc and the idea it promotes; `/f-feature-planning`'s ROADMAP row is fine; run **no git write command at all** (`add`, `commit`, `stash`, `checkout`, `pull`) — `next` hands the owner one commit line for Round 0.
|
|
48
|
+
|
|
49
|
+
## Environment
|
|
50
|
+
|
|
51
|
+
- Read `CLAUDE.md` → Worktree Setup and Gotchas before opening the worktree. Nothing from them is copied here. A planning session opens no worktree; `~/.bun/bin/bun`, never bare `bun`, for any probe you run.
|
|
52
|
+
|
|
53
|
+
## Report
|
|
54
|
+
|
|
55
|
+
Your command's final report is appended to `docs/plans/flat-0916/sessions/S1.md` by its report step (path resolved through `.claude/scripts/resolve-docs-root.sh docs/plans/probe.md` — in a public repo the plan folder lives only in the primary checkout, and an append into a missing directory must fail loudly, never create one inside the worktree). `work` verifies the append.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Brief S2 — feed-watch owns the roundup: a managed lane per space
|
|
2
|
+
|
|
3
|
+
**Plan**: docs/plans/flat-0916/plan.md **Session**: S2 **Round**: 0 **Kind**: plan
|
|
4
|
+
**Item slug**: feed-watch-owns-the-roundup
|
|
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 flat-0916 S2
|
|
11
|
+
|
|
12
|
+
## Run
|
|
13
|
+
|
|
14
|
+
/f-feature-planning feed-watch-owns-the-roundup
|
|
15
|
+
|
|
16
|
+
## Scope notes
|
|
17
|
+
|
|
18
|
+
Read the idea in full. Story one is the reconciled, managed roundup row (`feed-watch.roundup_cron` → one `tasks` row per enabled space, `managed_by`/`created_by` marker, dashboard read-only, extension-owned generic prompt); story two (floor + ceiling trigger on the residue count) is explicitly behind it — scope the Goal to one and name the other. The four Open Questions are the decisions to settle with the owner (reconcile on startup only vs on config change; schema column vs `created_by` + dashboard rule; migrating live row 621 without losing its cursor `last_digest_at:<spaceId>:roundup` and run history; whether the daily article stays profile-owned). Key files: `examples/extensions/feed-watch/index.ts` (`createTask` for the verify one-shots is the existing pattern; the `[feed-watch:digest:<lane>]` marker), `examples/extensions/feed-watch/config.ts` (the space-config keys), `examples/extensions/feed-watch/prompts/verify.md` (the generic-prompt precedent), `examples/profiles/football-reporter/tasks/roundup.md` and its `config.yaml` task entry (what becomes one config key), `src/storage/db.ts` (`tasks` columns — `created_by` exists), the dashboard's task routes (where "pause allowed, edit/delete not" is enforced), `src/profile/space-profile.ts` (`apply` refuses foreign task ids — the migration must not trip it). Decide **with the owner** where this lands: a `docs/backlog/` spec of its own, or an M2 row of `docs/goals/feed-watch-social-sources/roadmap.md` (the idea says M2-shaped; the roadmap's M2 is decomposed at the M1 checkpoint, which is a separate `/f-goal checkpoint` session, not yours). Deploy class: feed-watch reaches the box as the installed snapshot — restart + verify the installed copy; a `db.ts` column is a restart with a migration on boot. Live checks under `## Plan flat-0916 / S2` only.
|
|
19
|
+
|
|
20
|
+
## Owned surfaces (predicted)
|
|
21
|
+
|
|
22
|
+
- (none yet — `docs/backlog/feed-watch-owns-the-roundup.md` is the deliverable)
|
|
23
|
+
|
|
24
|
+
## Do not touch
|
|
25
|
+
|
|
26
|
+
- Everything outside your item's doc and `docs/backlog/` — planning sessions write docs only. Plan `bugs-0915` owns `src/bridges/`, `src/core/conversation.ts`, `src/ops/shadow-snapshot.ts`, `src/ops/shadow-service.ts`, `src/storage/pi-auth.ts`; name them if you must, do not edit them.
|
|
27
|
+
- `docs/ROADMAP.md`: your command's Step 4.5 row is the one edit; you share the file with sibling planning sessions (this plan's S1 and `bench-patterns-0915` S4–S8) and there is no lock — planning sessions run one at a time for that reason.
|
|
28
|
+
- `docs/goals/feed-watch-social-sources/decisions.md` and `roadmap.md`: never edit — if the owner chooses the M2 row, write the row text into your log's "Siblings must know" for the checkpoint session to place.
|
|
29
|
+
|
|
30
|
+
## Edges
|
|
31
|
+
|
|
32
|
+
- start-after: none (satisfied — `next` launched you)
|
|
33
|
+
- merge-after: none
|
|
34
|
+
|
|
35
|
+
## Overlap verdicts
|
|
36
|
+
|
|
37
|
+
none
|
|
38
|
+
|
|
39
|
+
> 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.
|
|
40
|
+
|
|
41
|
+
## Decisions answered
|
|
42
|
+
|
|
43
|
+
- none — no `Q` rows at build; the idea's open questions are yours to settle with the owner.
|
|
44
|
+
|
|
45
|
+
## Shared checkout (kind `plan`)
|
|
46
|
+
|
|
47
|
+
You share the primary checkout with sibling planning sessions — touch only your item's doc and the idea it promotes; `/f-feature-planning`'s ROADMAP row is fine; run **no git write command at all** (`add`, `commit`, `stash`, `checkout`, `pull`) — `next` hands the owner one commit line for Round 0.
|
|
48
|
+
|
|
49
|
+
## Environment
|
|
50
|
+
|
|
51
|
+
- Read `CLAUDE.md` → Worktree Setup and Gotchas before opening the worktree. Nothing from them is copied here. A planning session opens no worktree; `~/.bun/bin/bun`, never bare `bun`, for any probe you run.
|
|
52
|
+
|
|
53
|
+
## Report
|
|
54
|
+
|
|
55
|
+
Your command's final report is appended to `docs/plans/flat-0916/sessions/S2.md` by its report step (path resolved through `.claude/scripts/resolve-docs-root.sh docs/plans/probe.md` — in a public repo the plan folder lives only in the primary checkout, and an append into a missing directory must fail loudly, never create one inside the worktree). `work` verifies the append.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Decisions — plan flat-0916
|
|
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
|
+
|
|
8
|
+
> No rows at build (2026-09-16): both items are ideas whose open questions are design questions the planning sessions settle with the owner inside `/f-feature-planning`. Lane rows are added by `next` if a re-measure finds a foreign author in a predicted surface.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Plan: flat-0916
|
|
2
|
+
|
|
3
|
+
**Status**: Active
|
|
4
|
+
**Created**: 2026-09-16 **Last updated**: 2026-09-16
|
|
5
|
+
**Landing mode**: pr
|
|
6
|
+
**Max width**: 4
|
|
7
|
+
**Inputs**: flat-0916 video-understanding-extension feed-watch-owns-the-roundup
|
|
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.** The `tel-aviv-flat-search` space (profile `examples/profiles/tel-aviv-flat-search/`, applied 2026-09-15, live in the friends' group) is a notebook by design and produced two ideas on its first day: the friends send walk-through **videos** the bot must refuse (`AGENTS.md` L148, `docs/ideas/video-understanding-extension.md`), and the space is the stated second adopter of feed-watch, whose roundup lane is hand-wired per space (`docs/ideas/feed-watch-owns-the-roundup.md`). Both are ideas, so both are Round 0 by construction — their implementation sessions are added by `--rebuild` once the architectures exist. **Not in this plan, on purpose:** the apartment-source rungs of `feed-watch-social-sources` (Realta RSS, `nester_rent_telaviv`, the Yad2-alert mail bridge, the apartment-hunter profile row — `docs/goals/feed-watch-social-sources/roadmap.md` § Future milestones) are gated on `/f-goal checkpoint feed-watch-social-sources` decomposing M2; `--goal` would pull M1's "built"/"absorbed" rows as noise today. When the checkpoint has written the M2 stories to `docs/backlog/`, they join here with `--rebuild --add`. The profile's own five open live checks (`docs/pending-verification.md` L1936–1954) need the group, not a session.
|
|
13
|
+
|
|
14
|
+
## Items
|
|
15
|
+
|
|
16
|
+
| ID | Kind | Slug | Doc | Command | Round | Needs |
|
|
17
|
+
|----|------|------|-----|---------|-------|-------|
|
|
18
|
+
| S1 | plan | video-understanding-extension | docs/ideas/video-understanding-extension.md | /f-feature-planning video-understanding-extension | 0 | — |
|
|
19
|
+
| S2 | plan | feed-watch-owns-the-roundup | docs/ideas/feed-watch-owns-the-roundup.md | /f-feature-planning feed-watch-owns-the-roundup | 0 | — |
|
|
20
|
+
|
|
21
|
+
> Kind ∈ `feature` | `bug` | `refactor` | `plan` (a Round 0 planning session) | `story` (from `--goal`; runs `/f-feature-dev`).
|
|
22
|
+
> Needs = decision IDs from `decisions.md` that must be answered before this session may launch, or `—`.
|
|
23
|
+
> IDs are never renumbered; `--drop` moves a row to Deferred, `--add` takes the next unused ID.
|
|
24
|
+
|
|
25
|
+
## Edges
|
|
26
|
+
|
|
27
|
+
| From | To | Kind | Basis |
|
|
28
|
+
|------|----|------|-------|
|
|
29
|
+
|
|
30
|
+
> Kind ∈ `start-after` (To may not launch until From is landed) | `merge-after` (To may launch now, may not land until From is landed).
|
|
31
|
+
> Basis starts with `file:` (inferred from the collision map) or `semantic:` (asked) — never mixed in one row.
|
|
32
|
+
> 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.
|
|
33
|
+
> Semantic edges asked 2026-09-16: **none** (owner). Cross-plan: none — `bugs-0915` S3/S4 run in `src/bridges/`, `src/core/conversation.ts`, `src/ops/`, `src/storage/pi-auth.ts`; `bench-patterns-0915` S4–S8 are planning sessions with no surfaces. The implementation sessions added at `--rebuild` are re-cut against whatever is live then.
|
|
34
|
+
|
|
35
|
+
## Rounds
|
|
36
|
+
|
|
37
|
+
### Round 0 — unblock
|
|
38
|
+
|
|
39
|
+
| Session | Action | Clears |
|
|
40
|
+
|---------|--------|--------|
|
|
41
|
+
| — | owner commits this plan folder before the first launch (session logs are written into it) | the `sessions/` logs have a tracked home |
|
|
42
|
+
| S1 | plan video-understanding-extension — Goal + Architecture into `docs/backlog/`; settles hook-vs-skill, the visual-track provider and where it runs, the quoted-video cap, the `voice-transcribe` factoring and who owns `yt-dlp` (the idea's six open questions) with the owner | the implementation session(s), added by `--rebuild` |
|
|
43
|
+
| S2 | plan feed-watch-owns-the-roundup — Goal + Architecture; settles reconcile timing, the `managed` marker, the live-row-621 migration and whether the daily article stays profile-owned; decides with the owner whether it lands as a `docs/backlog/` spec or as an M2 row of `feed-watch-social-sources` | same |
|
|
44
|
+
|
|
45
|
+
> **One planning session at a time — across plans.** Every `/f-feature-planning` edits `docs/ROADMAP.md` (its Step 4.5) in the shared checkout with no lock, and `bench-patterns-0915` has five Round 0 sessions of its own. Open the next only after the previous one has reported, whichever plan it belongs to.
|
|
46
|
+
> **Do not open an implementation session until the Round 0 commit line has been run.** `plan-state.sh` derives a planning session `landed` the moment its Architecture predicts a surface, which is before its self-review and the owner's approval pause.
|
|
47
|
+
> **Expected collision at `--rebuild`, named now so nobody is surprised:** S1's implementation revises `examples/profiles/tel-aviv-flat-search/AGENTS.md` (the video paragraph) and the apartment-source adoption into the same space edits `AGENTS.md` and `config.yaml` too — a whole-file `start-after` edge, not a parallel pair.
|
|
48
|
+
|
|
49
|
+
### Round 1
|
|
50
|
+
|
|
51
|
+
| Session | Item | Predicted surfaces (count) |
|
|
52
|
+
|---------|------|----------------------------|
|
|
53
|
+
| — | none yet — the implementation sessions are added by `/f-ops-plan flat-0916 --rebuild` once the Round 0 docs are committed (and the M2 apartment stories by `--rebuild --add` after the feed-watch checkpoint) | — |
|
|
54
|
+
|
|
55
|
+
## Collision map
|
|
56
|
+
|
|
57
|
+
> Whole files, predicted; `docs/` and infrastructure paths are excluded exactly as `overlap-check.sh` excludes them (0 such paths ignored — both items predict no surfaces yet; the preflight was run on the idea docs only, 1 docs path ignored per item, no overlap).
|
|
58
|
+
|
|
59
|
+
| File | Sessions |
|
|
60
|
+
|------|----------|
|
|
61
|
+
|
|
62
|
+
## Predicted surfaces
|
|
63
|
+
|
|
64
|
+
### S1
|
|
65
|
+
|
|
66
|
+
### S2
|
|
67
|
+
|
|
68
|
+
## Adjudicated overlaps
|
|
69
|
+
|
|
70
|
+
> 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.
|
|
71
|
+
|
|
72
|
+
| Session | Branch (not in this plan) | Files | Verdict | Decided |
|
|
73
|
+
|---------|---------------------------|-------|---------|---------|
|
|
74
|
+
|
|
75
|
+
## Not ours
|
|
76
|
+
|
|
77
|
+
> Last measurement (`git log --since=14.days`, authors not in `Me`), 2026-09-16 on `origin/dev`. Re-measured on every `next`; this table is the snapshot the briefs were written from. No session has surfaces yet, so nothing intersects and no lane row exists; the two rows below are the prefixes the architectures are likely to name, recorded so `--rebuild` starts from them.
|
|
78
|
+
|
|
79
|
+
| File / area | Author | Basis |
|
|
80
|
+
|-------------|--------|-------|
|
|
81
|
+
| `src/extensions/image-builder.ts` (S1 may add the `install:` RUN lines here) | avishai tsabari (322 files in 14d) | co-owner of the tree, not a lane — every prior plan answered `ours`; re-ask only if the file is mid-change at `--rebuild` |
|
|
82
|
+
| `src/storage/db.ts` (S2 may add a `managed_by` column) | avishai tsabari | same |
|
|
83
|
+
| `examples/extensions/feed-watch/`, `examples/extensions/voice-transcribe/`, `src/adapters/whatsapp-media.ts`, `examples/profiles/` | — | no foreign commits in 14d |
|
|
84
|
+
|
|
85
|
+
## Deferred
|
|
86
|
+
|
|
87
|
+
| Item | Reason | Home |
|
|
88
|
+
|------|--------|------|
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Brief S1 — make the caller-token fallback a decision, not an if
|
|
2
|
+
|
|
3
|
+
**Plan**: docs/plans/p0-plan-0922/plan.md **Session**: S1 **Round**: 0 **Kind**: plan
|
|
4
|
+
**Item slug**: require-caller-token-for-container-originated-requests
|
|
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 S1
|
|
11
|
+
|
|
12
|
+
## Run
|
|
13
|
+
|
|
14
|
+
/f-feature-planning require-caller-token-for-container-originated-requests
|
|
15
|
+
|
|
16
|
+
## Scope notes
|
|
17
|
+
|
|
18
|
+
Settle the idea's four Open Questions with evidence before choosing a design:
|
|
19
|
+
- **Config flag or transport refusal.** The idea leans towards transport refusal: no new key and no allowlist.
|
|
20
|
+
- **runsc.** Does `containerRuntime: "runsc"`'s per-agent socket already constrain headers or paths?
|
|
21
|
+
- **Admin self-heal.** Is the config-admin self-heal in `src/core/permissions.ts` reachable with a forged `x-mercury-caller`? If so this is privilege escalation, and it should be said so in the Goal.
|
|
22
|
+
- **Console route.** Does `src/core/routes/console.ts` have its own identity model?
|
|
23
|
+
|
|
24
|
+
Preflight's header-mode roundtrip (`src/preflight/checks/roundtrip.ts`) is the one known legitimate token-less caller. Exempt it by its own principal, never by the *shape* of an absent header. That is the CLAUDE.md rule on whitelisting finite real values. The Architecture must list every leg that reaches identity (every route that calls `checkPerm`, plus `mrctl`, the capability broker and the console) and must end with the negative test: API secret, forged caller and no token must be denied, and deleting the check must turn the test red. **Related, not a dependency:** `bench-patterns-0915`/S6 (`sensitive-guard-one-read`) narrows on the same caller identity, so cite it. If the change adds a config key, it touches four sites (type, schema, allowlist, merge).
|
|
25
|
+
|
|
26
|
+
## Owned surfaces (predicted)
|
|
27
|
+
|
|
28
|
+
- (none yet — `docs/backlog/require-caller-token-for-container-originated-requests.md` is the deliverable)
|
|
29
|
+
|
|
30
|
+
## Do not touch
|
|
31
|
+
|
|
32
|
+
- Everything outside your item's doc and `docs/backlog/`. Planning sessions write docs only. Plan `p0-bugs-0922` owns `src/core/storage-cleanup.ts`, `src/storage/db.ts`, `src/core/reply-context.ts`, `src/agent/container-entry.ts`, `container/agent-package.json`, `resources/pi-extensions/subagent/index.ts` and `src/config.ts`. Name them in your Architecture; do not edit them.
|
|
33
|
+
- `docs/ROADMAP.md`: your command's ROADMAP row is the only edit. Sibling planning sessions share the file and there is no lock, which is why this plan runs its planning sessions one at a time.
|
|
34
|
+
|
|
35
|
+
## Edges
|
|
36
|
+
|
|
37
|
+
- start-after: none (satisfied — `next` launched you)
|
|
38
|
+
- merge-after: none
|
|
39
|
+
|
|
40
|
+
## Overlap verdicts
|
|
41
|
+
|
|
42
|
+
none
|
|
43
|
+
|
|
44
|
+
> 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.
|
|
45
|
+
|
|
46
|
+
## Decisions answered
|
|
47
|
+
|
|
48
|
+
- none
|
|
49
|
+
|
|
50
|
+
## Shared checkout (kind `plan`)
|
|
51
|
+
|
|
52
|
+
You share the primary checkout with sibling planning sessions. Touch only your item's doc and the idea it promotes; `/f-feature-planning`'s ROADMAP row is fine. Run **no git write command at all** (`add`, `commit`, `stash`, `checkout`, `pull`); `next` hands the owner one commit line for Round 0.
|
|
53
|
+
|
|
54
|
+
## Environment
|
|
55
|
+
|
|
56
|
+
- Read `CLAUDE.md` → Gotchas (and `docs/graceful-shutdown.md` where the item touches shutdown) before writing the Architecture. Nothing from them is copied here.
|
|
57
|
+
|
|
58
|
+
## Report
|
|
59
|
+
|
|
60
|
+
`/f-feature-planning` has no report step, so `work` appends this session's report to `docs/plans/p0-plan-0922/sessions/S1.md` (path resolved through `.claude/scripts/resolve-docs-root.sh docs/plans/probe.md`). The report is `delivered` once `docs/backlog/require-caller-token-for-container-originated-requests.md` predicts at least one surface.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Brief S2 — the run ledger cannot see a run that never finished
|
|
2
|
+
|
|
3
|
+
**Plan**: docs/plans/p0-plan-0922/plan.md **Session**: S2 **Round**: 0 **Kind**: plan
|
|
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 S2
|
|
11
|
+
|
|
12
|
+
## Run
|
|
13
|
+
|
|
14
|
+
/f-feature-planning ledger-misses-interrupted-runs
|
|
15
|
+
|
|
16
|
+
## Scope notes
|
|
17
|
+
|
|
18
|
+
Design the insert-at-start row for `task_runs` (`status='running'`), which `recordRun` then updates, plus the boot reconciliation that turns stale `running` rows into `interrupted`, plus retention-prune safety for in-flight rows. **Sibling in this plan:** S3 (`orphaned-run-recovery`) designs a startup sweep for interrupted *interactive* runs and lands after you. Per the CLAUDE.md rule that two code paths doing the same operation share one implementation, **write the boot-reconciliation seam as a contract S3 can extend** (one sweep with two consumers, not two sweeps), and state it under a "Contract for siblings" heading so S3 can read it. Also reuse or subsume what already runs at boot: missed-cron reporting (`631c3b5`). Schema changes land in `src/storage/db.ts`; there is no migrations directory. `interrupted` renders as its own badge and is counted separately from `error`.
|
|
19
|
+
|
|
20
|
+
## Owned surfaces (predicted)
|
|
21
|
+
|
|
22
|
+
- (none yet — `docs/backlog/ledger-misses-interrupted-runs.md` is the deliverable)
|
|
23
|
+
|
|
24
|
+
## Do not touch
|
|
25
|
+
|
|
26
|
+
- Everything outside your item's doc and `docs/backlog/`. Planning sessions write docs only. Plan `p0-bugs-0922` owns `src/core/storage-cleanup.ts`, `src/storage/db.ts`, `src/core/reply-context.ts`, `src/agent/container-entry.ts`, `container/agent-package.json`, `resources/pi-extensions/subagent/index.ts` and `src/config.ts`. Name them in your Architecture; do not edit them.
|
|
27
|
+
- `docs/ROADMAP.md`: your command's ROADMAP row is the only edit. Sibling planning sessions share the file and there is no lock, which is why this plan runs its planning sessions one at a time.
|
|
28
|
+
|
|
29
|
+
## Edges
|
|
30
|
+
|
|
31
|
+
- start-after: none (satisfied — `next` launched you)
|
|
32
|
+
- merge-after: none
|
|
33
|
+
|
|
34
|
+
## Overlap verdicts
|
|
35
|
+
|
|
36
|
+
none
|
|
37
|
+
|
|
38
|
+
> 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.
|
|
39
|
+
|
|
40
|
+
## Decisions answered
|
|
41
|
+
|
|
42
|
+
- none
|
|
43
|
+
|
|
44
|
+
## Shared checkout (kind `plan`)
|
|
45
|
+
|
|
46
|
+
You share the primary checkout with sibling planning sessions. Touch only your item's doc and the idea it promotes; `/f-feature-planning`'s ROADMAP row is fine. Run **no git write command at all** (`add`, `commit`, `stash`, `checkout`, `pull`); `next` hands the owner one commit line for Round 0.
|
|
47
|
+
|
|
48
|
+
## Environment
|
|
49
|
+
|
|
50
|
+
- Read `CLAUDE.md` → Gotchas (and `docs/graceful-shutdown.md` where the item touches shutdown) before writing the Architecture. Nothing from them is copied here.
|
|
51
|
+
|
|
52
|
+
## Report
|
|
53
|
+
|
|
54
|
+
`/f-feature-planning` has no report step, so `work` appends this session's report to `docs/plans/p0-plan-0922/sessions/S2.md` (path resolved through `.claude/scripts/resolve-docs-root.sh docs/plans/probe.md`). The report is `delivered` once `docs/backlog/ledger-misses-interrupted-runs.md` predicts at least one surface.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Brief S3 — recover orphaned agent runs after a hard process kill
|
|
2
|
+
|
|
3
|
+
**Plan**: docs/plans/p0-plan-0922/plan.md **Session**: S3 **Round**: 0 **Kind**: plan
|
|
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 S3
|
|
11
|
+
|
|
12
|
+
## Run
|
|
13
|
+
|
|
14
|
+
/f-feature-planning orphaned-run-recovery
|
|
15
|
+
|
|
16
|
+
## Scope notes
|
|
17
|
+
|
|
18
|
+
Two halves, from the idea:
|
|
19
|
+
- **(a) Single-instance guard.** Before designing one, check what already exists: `shadow up`'s port guard and the `MERCURY_SHADOW` data-dir refusal both prevent some forms of a second instance. Then decide pidfile or flock (question 1).
|
|
20
|
+
- **(b) Startup sweep.** Post a belated failure notice for runs that were mid-flight when the previous process died.
|
|
21
|
+
|
|
22
|
+
Question 2 (still in progress vs orphaned) has an easy answer on this box: on boot, the new process knows that nothing it did not start itself can still be running. Say so explicitly, and say what changes if the process ever runs as more than one instance. Where does the "⏳ Processing…" state live today? Trace it from the in-process crash-reply fix (`agent-run-dies-silently-no-error-reply-to-chat`). Every swallowed failure must log or reply (CLAUDE.md).
|
|
23
|
+
|
|
24
|
+
## Owned surfaces (predicted)
|
|
25
|
+
|
|
26
|
+
- (none yet — `docs/backlog/orphaned-run-recovery.md` is the deliverable)
|
|
27
|
+
|
|
28
|
+
## Do not touch
|
|
29
|
+
|
|
30
|
+
- Everything outside your item's doc and `docs/backlog/`. Planning sessions write docs only. Plan `p0-bugs-0922` owns `src/core/storage-cleanup.ts`, `src/storage/db.ts`, `src/core/reply-context.ts`, `src/agent/container-entry.ts`, `container/agent-package.json`, `resources/pi-extensions/subagent/index.ts` and `src/config.ts`. Name them in your Architecture; do not edit them.
|
|
31
|
+
- `docs/ROADMAP.md`: your command's ROADMAP row is the only edit. Sibling planning sessions share the file and there is no lock, which is why this plan runs its planning sessions one at a time.
|
|
32
|
+
|
|
33
|
+
## Edges
|
|
34
|
+
|
|
35
|
+
- start-after: none (satisfied — `next` launched you)
|
|
36
|
+
- merge-after: land only after S2 (`ledger-misses-interrupted-runs`) is landed. Its boot-reconciliation contract is the seam your startup sweep extends. Check with `/f-ops-plan next p0-plan-0922` before finishing the Architecture. If S2 is not landed yet, write the concurrency-guard half and leave the sweep as an explicit `depends on S2's contract` section.
|
|
37
|
+
|
|
38
|
+
## Overlap verdicts
|
|
39
|
+
|
|
40
|
+
none
|
|
41
|
+
|
|
42
|
+
> 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.
|
|
43
|
+
|
|
44
|
+
## Decisions answered
|
|
45
|
+
|
|
46
|
+
- none
|
|
47
|
+
|
|
48
|
+
## Shared checkout (kind `plan`)
|
|
49
|
+
|
|
50
|
+
You share the primary checkout with sibling planning sessions. Touch only your item's doc and the idea it promotes; `/f-feature-planning`'s ROADMAP row is fine. Run **no git write command at all** (`add`, `commit`, `stash`, `checkout`, `pull`); `next` hands the owner one commit line for Round 0.
|
|
51
|
+
|
|
52
|
+
## Environment
|
|
53
|
+
|
|
54
|
+
- Read `CLAUDE.md` → Gotchas (and `docs/graceful-shutdown.md` where the item touches shutdown) before writing the Architecture. Nothing from them is copied here.
|
|
55
|
+
|
|
56
|
+
## Report
|
|
57
|
+
|
|
58
|
+
`/f-feature-planning` has no report step, so `work` appends this session's report to `docs/plans/p0-plan-0922/sessions/S3.md` (path resolved through `.claude/scripts/resolve-docs-root.sh docs/plans/probe.md`). The report is `delivered` once `docs/backlog/orphaned-run-recovery.md` predicts at least one surface.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Brief S4 — wire message-debounce flushAll() to the shutdown hook
|
|
2
|
+
|
|
3
|
+
**Plan**: docs/plans/p0-plan-0922/plan.md **Session**: S4 **Round**: 0 **Kind**: plan
|
|
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 S4
|
|
11
|
+
|
|
12
|
+
## Run
|
|
13
|
+
|
|
14
|
+
/f-feature-planning wire-debounce-flush-to-shutdown-hook
|
|
15
|
+
|
|
16
|
+
## Scope notes
|
|
17
|
+
|
|
18
|
+
Decide flush or persist under a shutdown deadline (the idea's two Open Questions). The deadline is real: read the systemd unit's stop timeout and what `docs/graceful-shutdown.md` already budgets. A full LLM turn per pending batch will not fit. The likely answer is to persist the pending batches and replay them on the next boot as unread. If so, that replay is a boot-time consumer like `orphaned-run-recovery`'s sweep: design it as a separate call site that can later join a shared boot seam, and say so. Do not merge the ideas. Any bound on the shutdown path needs a log line for when it fires (the CLAUDE.md single-thread and bounds rules). The regression test starts a batch, triggers shutdown, and asserts the batch is not lost.
|
|
19
|
+
|
|
20
|
+
## Owned surfaces (predicted)
|
|
21
|
+
|
|
22
|
+
- (none yet — `docs/backlog/wire-debounce-flush-to-shutdown-hook.md` is the deliverable)
|
|
23
|
+
|
|
24
|
+
## Do not touch
|
|
25
|
+
|
|
26
|
+
- Everything outside your item's doc and `docs/backlog/`. Planning sessions write docs only. Plan `p0-bugs-0922` owns `src/core/storage-cleanup.ts`, `src/storage/db.ts`, `src/core/reply-context.ts`, `src/agent/container-entry.ts`, `container/agent-package.json`, `resources/pi-extensions/subagent/index.ts` and `src/config.ts`. Name them in your Architecture; do not edit them.
|
|
27
|
+
- `docs/ROADMAP.md`: your command's ROADMAP row is the only edit. Sibling planning sessions share the file and there is no lock, which is why this plan runs its planning sessions one at a time.
|
|
28
|
+
|
|
29
|
+
## Edges
|
|
30
|
+
|
|
31
|
+
- start-after: none (satisfied — `next` launched you)
|
|
32
|
+
- merge-after: none
|
|
33
|
+
|
|
34
|
+
## Overlap verdicts
|
|
35
|
+
|
|
36
|
+
none
|
|
37
|
+
|
|
38
|
+
> 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.
|
|
39
|
+
|
|
40
|
+
## Decisions answered
|
|
41
|
+
|
|
42
|
+
- none
|
|
43
|
+
|
|
44
|
+
## Shared checkout (kind `plan`)
|
|
45
|
+
|
|
46
|
+
You share the primary checkout with sibling planning sessions. Touch only your item's doc and the idea it promotes; `/f-feature-planning`'s ROADMAP row is fine. Run **no git write command at all** (`add`, `commit`, `stash`, `checkout`, `pull`); `next` hands the owner one commit line for Round 0.
|
|
47
|
+
|
|
48
|
+
## Environment
|
|
49
|
+
|
|
50
|
+
- Read `CLAUDE.md` → Gotchas (and `docs/graceful-shutdown.md` where the item touches shutdown) before writing the Architecture. Nothing from them is copied here.
|
|
51
|
+
|
|
52
|
+
## Report
|
|
53
|
+
|
|
54
|
+
`/f-feature-planning` has no report step, so `work` appends this session's report to `docs/plans/p0-plan-0922/sessions/S4.md` (path resolved through `.claude/scripts/resolve-docs-root.sh docs/plans/probe.md`). The report is `delivered` once `docs/backlog/wire-debounce-flush-to-shutdown-hook.md` predicts at least one surface.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Brief S5 — containers stop holding API_SECRET; container calls authenticate by caller token
|
|
2
|
+
|
|
3
|
+
**Plan**: docs/plans/p0-plan-0922/plan.md **Session**: S5 **Round**: 1 **Kind**: feature
|
|
4
|
+
**Item slug**: require-caller-token-for-container-originated-requests
|
|
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 S5
|
|
11
|
+
|
|
12
|
+
## Run
|
|
13
|
+
|
|
14
|
+
/f-feature-dev require-caller-token-for-container-originated-requests
|
|
15
|
+
|
|
16
|
+
## Scope notes
|
|
17
|
+
|
|
18
|
+
Follow the doc's Implementation Sequence, starting with the negative suite (red first, cases a–g). The owner decided `mrctl disk` for members is **admin-only**, via `media.purge` (Open Questions). **Deploy needs: rebuild.** It is image-class: `src/cli/mrctl.ts` is baked, so run `container/build.sh`, restart, then wait for the derived ext image `Built` line. Verify by grepping the image, never the repo. The box runs `headers` mode (no `MERCURY_CALLER_TOKEN_KEY`), so exercise token mode once in a shadow with a key set. If a key is minted, the global CLAUDE.md rule applies: remind the owner, in the same sitting, to write it into the gitignored local env file, and never paste the value anywhere. `src/config.ts` and `src/agent/container-runner.ts` are shared with S6 and S7, which start after you land. Add only what the doc names there.
|
|
19
|
+
|
|
20
|
+
## Owned surfaces (predicted)
|
|
21
|
+
|
|
22
|
+
- container/build.sh
|
|
23
|
+
- src/agent/container-entry.ts
|
|
24
|
+
- src/agent/container-env.ts
|
|
25
|
+
- src/agent/container-runner.ts
|
|
26
|
+
- src/cli/mrctl.ts
|
|
27
|
+
- src/config.ts
|
|
28
|
+
- src/core/api.ts
|
|
29
|
+
- src/core/auth.ts
|
|
30
|
+
- src/core/caller-token.ts
|
|
31
|
+
- src/core/routes/console.ts
|
|
32
|
+
- src/core/routes/media.ts
|
|
33
|
+
- src/core/routes/storage.ts
|
|
34
|
+
- src/preflight/checks/roundtrip.ts
|
|
35
|
+
- tests/api-chat-auth.test.ts
|
|
36
|
+
- tests/api-container-credential.test.ts
|
|
37
|
+
- tests/api.test.ts
|
|
38
|
+
- tests/console-routes.test.ts
|
|
39
|
+
- tests/container-runner-create-args.test.ts
|
|
40
|
+
- tests/media-storage-route.test.ts
|
|
41
|
+
- tests/mrctl-http.test.ts
|
|
42
|
+
- tests/preflight-roundtrip.test.ts
|
|
43
|
+
|
|
44
|
+
## Do not touch
|
|
45
|
+
|
|
46
|
+
- scripts/football-audit.ts, src/audit/ledger-queries.ts, src/core/boot-reconcile.ts, src/core/operator-alerts.ts, src/core/routes/dashboard.ts, src/core/runtime.ts, src/core/task-scheduler.ts, src/main.ts, src/storage/db.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)
|
|
47
|
+
- src/adapters/whatsapp.ts, src/agent/container-error.ts, src/bridges/whatsapp.ts, src/core/boot-reconcile.ts, src/core/chat-run-journal.ts, src/core/handler.ts, src/core/instance-lock.ts, src/core/runtime.ts, src/core/space-queue.ts, src/core/system-messages.ts, src/main.ts, src/storage/db.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)
|
|
48
|
+
- src/core/debounce.ts, src/core/handler.ts, src/core/pending-ingress.ts, src/core/runtime.ts, src/main.ts, src/storage/db.ts, src/types.ts, tests/debounce.test.ts, tests/handler.test.ts, tests/pending-ingress.test.ts, tests/shutdown.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: none
|
|
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/require-caller-token-for-container-originated-requests.md` as usual.
|
|
70
|
+
- `docs/pending-verification.md`: append only under `## Plan p0-plan-0922 / S5`.
|
|
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/S5.md` by its report step (path resolved through `.claude/scripts/resolve-docs-root.sh docs/plans/probe.md`). `work` verifies the append.
|