Repository navigation
Description
Outcome
Brain Sync reports only Media awaiting review: N, never a list of files. Every undecided media file is a stable finding in the existing hygiene review, where the user can leave it pending, delete it, move it to a final location, persist it in place, or keep a permanent copy of conversation-linked scratch media. Each action is previewed, governed, journaled and undoable within the existing bounded retention, and the next ordinary sync reflects the result.
Why now
Before delivered #2780, sync listed individual media paths and invoked agent judgment for them. Current sync instead emits the aggregate mediaReportLine (packages/core/src/lib/sync/report.ts:81) and needsAgent (packages/core/src/cli/commands/sync.ts:221) no longer treats media alone as a reason to invoke the agent. The review and end-to-end children consume that delivered routing and the now-delivered governed effects from #2781; while the existing hygiene review (createHygieneReviewRoutes, packages/ui-server/src/routes/hygiene-review.ts:8) already has preview, receipts and Undo. Hygiene states are declared by HygieneState (packages/core/src/lib/hygiene.ts:50); #2780 added the fifth, kept.
The task specification had grown through seven design revisions and twelve rulings into four separately provable deliverables; it was converted to an epic on 2026-10-24.
Shared context
Maintainer rulings, recorded in the comments:
- Count-only reporting (A, 2026-10-13): routine report strings and UI show only the count; existing structured JSON media evidence stays; the count is additive and comes from the same reconciled inventory as review.
- Severity (B, 2026-10-13): MEDIA informational, LARGE warning; no urgency inferred from size, path, name or age; existing ordering of
docs/decisions/hygiene-review.md. - Leave pending (A, 2026-10-13): a per-pass deferral that keeps the item counted; a new pass may reselect it; timed Snooze stays separate.
- References (B, 2026-10-13): supported moves update a declared inventory of local Markdown link/image/reference-definition/file-link forms, documented frontmatter/HTML forms and host-owned artifact/share pointers; unsupported references refuse.
- Rollback (A, 2026-10-13): capture before mutation under the existing bounded journal retention (10 GiB shared cap), refuse if capture cannot fit, no guaranteed Undo window, no irreversible fallback.
- Ignore conflicts (B, 2026-10-13): Persist here may propose an explicitly approved adjustment of a conflicting
media.ignorerule; ignore-over-track precedence stays. - Tracking scope (B, 2026-10-13): exact-file tracking by default; broader rules only with explicit current/future match preview and approval.
- Rule syntax (M1 A, 2026-10-14): existing glob syntax, no negation exceptions.
- Bounds (Q1 A, 2026-10-14): configurable 50,000 notes, 256 MiB scanned note bytes, 4 MiB per note, 20 s scan, 500 references per finding, 200 rewritten notes per move, 1 MiB preview; honest refusal, never an incomplete inventory.
- Keep a permanent copy (Q2 B, 2026-10-14): a fifth action for conversation-linked scratch media; the original's bytes, path, pins and history are preserved; Move of a linked original is refused.
- Kept state (K1 A, 2026-10-15): a dedicated
keptstate incontext/hygiene/kept.md, read by offline sync and server review alike. - Count eligibility (K2 B, 2026-10-15): valid dismissed and snoozed media are excluded from the count, consistently with review eligibility.
Design chain. Rev 4 is the base five-action specification. Rev 5 replaces its §5.7, §8.1 and §9 and adds §11 and §12. Rev 6 folds in K1 A and K2 B, and rev 6.1 replaces rev 6 §3, §4.1 and §6.3 with the legacy-response policy and no-op proof. Earlier revisions and their reviews are history.
Inventory-policy ruling (maintainer, 2026-10-24, #2780): A/A/A/A. Add only conversation-pinned scratch media to ordinary assessment, including pins matching media.ignore; keep ignored non-scratch media and unpinned scratch excluded. Scratch findings are review-only and do not alter the routine count or add media.linked. Valid ready:false snapshots contribute listed positive evidence with an incomplete notice; invalid/missing/unreadable snapshots admit none and report pins-unknown. Default read bound: 5,000 distinct pinned paths with a trusted-host override and explicit incomplete reporting on overflow. No deletion permission or exhaustive-reference claim follows from incomplete evidence. Existing effect and ignore-over-track rules remain binding; that inventory implementation and parity proof are delivered through #2780; the later UI and integrated-flow proof remain separately required.
Constraints and non-goals
- No automatic cleanup, blanket tracking or ignoring, moves inferred from filenames, new media dashboard, second policy store, or host evaluation of brain-controlled TypeScript.
- Retained transcripts and history are never rewritten;
brain.dbis not authority. - Journal retention, writer gates, native managed storage and descriptor-safe path ownership bind (
docs/decisions/native-brain-storage.md,docs/decisions/governed-writable-workers.md). - Every contract change is additive per rev 6.1:
CONTRACT:commits, same-commit contract updates, minorcore,ui-sdkandui-serverchangesets. Removing or retyping an existing field needs its own ruling.
Breakdown
- core: build one media inventory with kept dispositions and count-only sync reporting for hygiene review #2780: the shared inventory, the approved narrow pinned-scratch admission policy, Leave pending, the
keptdisposition, count-only reporting and compatibility. - core: apply governed Delete, Move, Persist here and Keep a permanent copy effects for media findings with Undo #2781: delivered governed Delete, Move, Persist here and Keep a permanent copy effects, references, bounds, config edits and Undo. Its final audit controls landed through merged test: land epic #1777 batch — media Undo bytes, Q1 boundaries and copy recovery (#2781 slice 6) #3586 (
b3c959370e7843ef65e49bbca0c3ab589fce68c7), now on inspected main. The earlier integration-only and missing-audit-check handoffs are historical. - ui-react: review media findings with previews and the five actions in hygiene review #2782: delivered review UI, media preview and five-action interaction, closed 2026-11-06.
- core: verify media hygiene review end to end across CLI, server, worker and browser #2783: delivered integrated CLI, server, worker and browser verification, docs and the
/syncskill, by merged test(core): verify media hygiene review end to end across CLI, server, worker and browser #3722 (69e45194f3b17f9de4b43b91f8af732bb78bcfc1), closed 2026-11-08.
Follow-up #3591 (missing preview source, gone permanent copy's path) is not part of this epic: the maintainer detached it on 2026-11-10 as a standalone p3 issue that refers back here.
Definition of done
- Every native child is closed, with each child's own implementation and verification evidence.
- On an Odysseus fixture brain, sync reports only the count; each of the five actions runs from review with its preview, receipt and Undo; and a following ordinary sync shows the intended persistence and count, with offline CLI and server agreeing throughout.
- A normally ignored, conversation-linked scratch file reaches Keep a permanent copy as the recorded core: build one media inventory with kept dispositions and count-only sync reporting for hygiene review #2780 inventory-policy ruling specifies.
- Docs and the
/syncskill describe count-only reporting and the five actions.
2026-10-24: converted to an epic. The stacked revision-history body was consolidated into Shared context; scope, acceptance criteria and proof moved into #2780, #2781, #2782 and #2783. Every ruling is unchanged; the ignored/scratch admission gap is named and handed to #2780 as needs: design.
2026-10-24 triage at main 77f35ef1ba34e4fab7092ada5362ae799852ea24: Reconciled the current #2780 handoff with its later two-part proposal: the four inventory policy choices need a maintainer ruling, not another generic design request. Existing approved media effects, counts and compatibility rulings remain unchanged; no proposal is selected.
2026-10-24 maintainer reconciliation: folded the resolved child ruling into active context; historical proposal/triage notes remain history. No delivery or epic completion is inferred.
2026-10-29 triage at main cb5db6e901e9d3d312bd3a125e03be6140faf98f: Corrected the current needsAgent description: its media clause is interactive-only. The approved removal of that clause, count-only reports, all five review actions and the later pinned-scratch ruling remain unchanged; no implementation is claimed.
Triage 2026-11-03 (main 3d3516a02): #2780 is delivered on main (batch-1 lane PR #3316), so the hygiene-state pointer now cites the five-state union. Remaining children #2781–#2783 and the definition of done are unchanged.
2026-11-04 triage at main 53b862123d7b8e4c9d039859fabdc9fc6ad4cd36: Removed the contradictory pre-#2780 report/agent-routing claim after inspecting actual sync code; media effects, review and integrated verification remain open. No new runtime qualification or implementation is claimed.
2026-11-05 triage at main 35217d283b849b5ef81700d5d4c2ec7486405d12: reconciled #2781's completed final audit and actual main landing, the current three-open-child inventory and already-attached #3591; checked the report, routing, kept-state and effects source. Existing five-action design, release attribution and integrated #2783 definition of done remain. This pass ran no media effect or new runtime/browser suite and claims no full-epic completion.
2026-11-10 triage at main 3aadc8df5: #2782 and #2783 are closed as completed (#2783 through merged #3722). #3591 (p3) is the only open child. The integrated definition-of-done items have evidence on main, recorded in the dated comment; closing the epic is left to the maintainer.
Decision (maintainer, 2026-11-10): #3591 is detached and stays a standalone p3 issue; the epic closes as completed in milestone 0.45.0, on the evidence in the 2026-11-10 epic state comment.
Activity
schlessera commentedon Oct 13, 2026
Decision (maintainer, 2026-10-13): A — count-only routine reporting, preserving existing structured media evidence.
Routine Brain Sync strings/UI report Media awaiting review: N without per-file enumeration; hygiene review owns file decisions. Add a count while keeping supported JSON/assessment media fields/arrays and their semantics intact. Explicit diagnostics may still inspect those records. Both count and review derive from one reconciled pending-file inventory, without duplicate directory counts or lost pending state.
Updated the body. No breaking field removal is selected. Severity/pending-snooze mapping, reference/rollback support and rule/config approval remain open, so needs: decision stays alongside needs: design. Actual CLI/JSON/server/browser proof and additive contract updates remain required.
schlessera commentedon Oct 13, 2026
Design brief: media decisions in hygiene review (rev 1)
Source read at
f2c98da:packages/core/src/lib/sync/report.ts:renderReport. Its "Left for you" block emitsmedia: <path> (<size>)per file.packages/core/src/cli/commands/sync.ts:needsAgenthands media to the/syncagent on interactive terminals.packages/ui-react/src/components/activity/hygiene-review.tsx:HygieneFinding/HygieneCard, the repair radiogroup,EffectPreview,DispositionBarand recovery states.docs/decisions/hygiene-review.md: ordering, identity, fingerprints, R1–R3 Undo, ui-server: reconcile hygiene review when the shared Actions cap retires its card #1490 retirement, ui-server: refresh a stale hygiene review finding through the supported boundary #1493 refresh.1 · Sync reports a count, never a list
Human report, replacing every
media:line in "Left for you":completesync. It never changesstatusor the exit code. N = 0 prints nothing ("only lines with something to say").needsAgentdrops its media clause, so media alone no longer starts/sync. The skill stops asking per-file questions. Unknown files and conflicts still start it, unchanged.requestHygieneReview). No new chat block.2 · The media finding card
It reuses
HygieneCardin the current review flow, with the same strip, focus handoff, receipts, pause/resume, refresh and two-device rules.REVIEW, notMUST FIXand notINFO. Media is a decision, not a defect.INFOfindings are counted as "not shown" byHygieneEnd, so media at info severity would never be reviewed (R2).aapplies the selected, previewed option (D36).l= Leave pending.dis not bound on media cards.3 · The four actions
Leave pending. No file or rule change and no disposition record. The review moves on and the finding stays in N.
Persist here. Default effect: one exact-file
media.trackentry for this path.Preview:
media.ignoreoverlaps (ignore wins, so an overlapping glob is refused with the conflicting entry named), and excluded/sensitive paths that will not be tracked.Move to a final location… A contained destination path field, then Check preview:
Delete…
4 · Receipts, Undo and failure states
stale: "inbox/ithaca-map.png changed since the preview (2.4 → 2.6 MB). Nothing was written." + Refresh finding.refused: names the guard (symlink, protected path, collision, ignore conflict).unknown: after a reconnect, "Check again" queries the effect by id and never re-applies (idempotent).applying: all controls locked.5 · Ordering and entry
Contract notes
leftovers.media[]inbrain sync --json/run(diagnostic evidence). Addleftovers.mediaPending: number. Only the humanreportstring changes (R1).media-persist,media-move,media-delete) with previews/receipts/inverses, and areviewseverity rank.assessoutput is unchanged.Proof cases (Odysseus, offline CLI + server + browser, 320/1280, both themes)
--jsonstill carries the array and adds the count. An untracked directory with 2 images counts 2.Residual decisions (match the issue's list)
leftovers.media[]in JSON and addmediaPending(recommended) or take a breaking-contract ruling to remove the array.reviewbetween warning and info, with "Leave pending" = Later until the next human Start (recommended) or a dedicatedpendingdisposition with no snooze record.![[…]]/[[…]]and Markdown/[](…)relative paths (recommended). HTML<img>, frontmatter fields and code spans are refused, not rewritten.Mocks:
Media Review 1777.dc.html. Retention values shown are placeholders, not policy.schlessera commentedon Oct 13, 2026
Decision (maintainer, 2026-10-13): B — MEDIA informational, LARGE warning.
Use existing deterministic sync classification; reconcile overlapping file evidence without duplicate review items/counts. Do not infer urgency/deadlines from size/path/age. Existing severity/known-urgency/age/identity ordering and relevant-evidence disposition invalidation still bind; separate evidenced defects retain their own findings. Test the mapping, provenance, ordering/ties and unknown urgency.
Updated the body. Leave-pending/snooze behavior, reference/rollback support and rule approval remain open, so needs: decision stays alongside needs: design. Count-only reporting and the four requested actions remain settled requirements.
schlessera commentedon Oct 13, 2026
Decision (maintainer, 2026-10-13): A — Leave pending defers the item for the current review pass and continues.
Keep the media file/rules unchanged and the item counted unresolved. Persist a per-pass deferral in existing review operational state across refresh/reconnect/restart; a new pass can select it again. Resume/refresh is not silently a new pass. Relevant evidence changes invalidate obsolete deferral premises; unrelated changes do not. All-deferred completion must report remaining unresolved work honestly.
This is not dismiss/resolve/ignore/timed Snooze or an authority grant; explicit Snooze retains its separate due-time policy. Updated the body. Reference/rollback and rule approval remain open, so needs: decision stays with needs: design. Actual lifecycle/idempotency/count/unchanged-byte proof remains required.
schlessera commentedon Oct 13, 2026
Decision (maintainer, 2026-10-13): B — broader documented reference inventory for media moves.
Support local Markdown link/image/reference-definition/file-link forms plus declared frontmatter/HTML forms and host-owned artifact/share pointers. Specify exact parsers/resolution and preview bounded changes; no arbitrary string matching or inferred fields. Preserve unrelated bytes/code/labels and contained target semantics. Apply move and supported reference/pointer updates under existing governed authority, stale checks, locks, journal/Undo and recovery; unsupported or ambiguous known references refuse by default rather than silently breaking access.
Updated the body. Exact inventory and coordinated effect proof remain design work; binary rollback/expiration and rule/config approval remain open, so needs: decision stays with needs: design. Prior media/pending/report policies remain settled.
schlessera commentedon Oct 13, 2026
Decision (maintainer, 2026-10-13): A — media Delete/Move follows existing journal retention.
Capture and verify every byte/version and reference/pointer change required for rollback before applying the governed action, using the existing bounded retained-object accounting. Refuse the reversible action if that capture/reservation cannot be secured; this ruling does not authorize an irreversible fallback.
After completion, follow the existing retention and capacity-pressure eviction policy rather than pinning data for a new guaranteed Undo window. The shared journal cap remains 10 GiB, including temporary copies and metadata/headroom. The usual 30-day summary retention is not a guarantee that binary rollback contents remain available for 30 days. Explicitly retain required media bytes even when ignored scratch would otherwise receive metadata-only observation.
Before confirmation, explain that Undo depends on retained rollback data and may expire early under capacity pressure. Receipts expose current availability and any known expiry without inventing a guaranteed deadline. Recheck complete rollback data and stale source/destination/reference/rule premises when Undo is requested; expired/incomplete rollback refuses honestly without partial restoration or overwriting concurrent changes. Preserve existing reader leases, active-operation protection, authenticated access and accurate interrupted-operation recovery.
Test capacity refusal before mutation, retained binary/reference/pointer rollback, eviction/expiry disabling Undo, stale refusal and ignored-media byte capture. No new storage pool, cap, fixed retention guarantee or authority grant is introduced. Rule/config approval remains unresolved; keep needs: decision and do not mark agent-ready.
59 remaining items
Merge pull request #3316 from schlessera/epic/1777-media-hygiene
schlessera commentedon Nov 3, 2026
Epic state — 2026-11-03
keptdisposition, count-only reporting) is on main through batch-1 lane PR CONTRACT: feat(core): land epic #1777 batch 1 — media inventory and reference fingerprints for hygiene review #3316.epic/1777-media-hygiene(CONTRACT: feat(core): fingerprint media by a bounded scan of declared note references (#2781) #3328); CONTRACT: feat: governed Delete, Move, Persist here and Keep a permanent copy for media findings, with journal capture, compensation and Undo (#2781) #3421 is open against that branch./syncskill).Order is unchanged: #2781 → #2782 → #2783. The definition of done still needs #2783's integrated proof.
Merge pull request #3482 from schlessera/epic/1777-media-hygiene
Merge pull request #3565 from schlessera/epic/1777-media-hygiene
Merge pull request #3586 from schlessera/epic/1777-media-hygiene
schlessera commentedon Nov 5, 2026
Epic state — 2026-11-05 triage. #2780 inventory/counts and #2781 governed effects are delivered. The final #2781 audit controls landed on main through #3586 (
b3c959370e7843ef65e49bbca0c3ab589fce68c7), an ancestor of inspected main35217d283b849b5ef81700d5d4c2ec7486405d12. Remaining native work is #2782 (review UI), #2783 (integrated proof/docs) and supporting #3591 (missing-source and gone-copy copy, after #2782). The body now reflects this; all five actions, original/pin preservation, compatibility and bounded Undo requirements remain. This is source/merge reconciliation, with no new media-effect run, runtime/browser suite or full-epic completion.Merge pull request #3594 from schlessera/epic/1777-media-hygiene
schlessera commentedon Nov 8, 2026
2026-11-08: #2783, the integrated CLI, server, worker and browser verification plus docs and the
/syncskill, is delivered by #3722 (69e45194f) and closed. The remaining open child is #3591 (p3). This note doesn't close the epic.schlessera commentedon Nov 10, 2026
Epic state — 2026-11-10 triage (main
3aadc8df5)69e45194f3b17f9de4b43b91f8af732bb78bcfc1, an ancestor of the inspected main, closed 2026-11-08), and ui-react: hygiene-media stale-at-apply layout test intermittently hangs to its timeout #3657.Definition of done, checked against source:
packages/ui-server/tests/media-review-flow.test.tsandpackages/ui-react/tests/browser/hygiene-media-flow.layout.tsx, which run on an Odysseus brain.packages/ui-server/tests/media-review-flow.test.ts:200("Keep a permanent copy of linked, normally ignored scratch…")./syncskill:docs/media.md,docs/cli.mdandpackages/core/skills/sync/SKILL.mdwere updated in test(core): verify media hygiene review end to end across CLI, server, worker and browser #3722, and "Media awaiting review" appears in the docs and the integration contract.Recommendation: every item of the outcome has evidence on main except #3591's deferred copy refinement. I recommend detaching #3591 as a standalone p3 follow-up and closing this epic as completed with milestone 0.45.0. Keeping it open until #3591 lands is the other option. I have not closed or detached anything; that is the maintainer's call.
schlessera commentedon Nov 10, 2026
Decision (maintainer, 2026-11-10): detach #3591 and close this epic as completed, milestone 0.45.0.
Refs #1777./syncskill all have tests or docs on main3aadc8df5.