Skip to content

feat: sleep-time janitor + scratch tier (items #3 and #5 part 2) - #288

Open
CryptoJones wants to merge 2 commits into
mainfrom
feat/omind-maintain
Open

feat: sleep-time janitor + scratch tier (items #3 and #5 part 2)#288
CryptoJones wants to merge 2 commits into
mainfrom
feat/omind-maintain

Conversation

@CryptoJones

@CryptoJones CryptoJones commented Aug 28, 2026

Copy link
Copy Markdown
Owner

The last two roadmap items from the 2026-08-27 consensus. Item #5's scratch
expiry is a maintain step, so the two ship together.

Item #3omind maintain (sleep-time janitor)

  • Consolidation is propose-only, always (even --apply).
  • Single janitor per vault — non-blocking flock mutex (new
    filelock.try_exclusive).
  • Refuses while a mesh sync / vault write is in flight — explicit write-lock
    probe.
  • Fail-closed pipeline — a failed step aborts the rest; --sync never runs
    after a failure.
  • GC / mesh-sync out of the default apply set (opt-in --sync); rollups
    opt-in
    (--rollup). Safe by default (dry run).
  • Index maintenance via the live incremental refresh (build-and-swap).
  • No vault report notes — stdout + state dir; --report-note is opt-in.

Item #5 part 2 — scratch tier

  • create-note gains scratch: bool; the note is written <title>.scratch.md
    — the suffix is the mark (no note-body field).
  • Still a top-level *.md, so search/listings find it.
  • Machine-local: mesh gitignores *.scratch.md — never committed or
    replicated. Opt-in replicate = create it as a normal note.
  • TTL expiry as a maintain step: scratch notes idle >7 days (by last
    modification) are archived, never deleted; reported on dry run, archived
    under --apply.

Verification

New maintain.py + scope-free; tests/test_maintain.py (9) and scratch
coverage in test_store.py. 1,029 tests / ruff / mypy --strict green
locally.
Independent of #287.

Note: repo CI has a pre-existing red state on main (an mcp dependency-drift
affecting ToolError text); this PR does not touch it.

Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/

🤖 Generated with Claude Code

)

One opt-in maintenance pass over a vault, built to the ratified invariants.

- Consolidation is propose-only, always — even --apply only proposes;
  propose-and-review is permanent.
- Single janitor per vault: a non-blocking flock mutex (new filelock.
  try_exclusive) refuses a second concurrent run.
- Refuses while a mesh sync (or any vault write) is in flight, via an explicit
  probe of the vault write-lock — not a guess.
- Fail-closed pipeline: a failed step aborts the rest, so the fleet-propagating
  --sync never runs after an earlier failure.
- GC / mesh-sync stays out of the default apply set (opt-in --sync); it is the
  only irreversible, fleet-wide step. Rollups are opt-in too (--rollup), never
  default. Safe by default: no flags = dry run, nothing in the vault changes.
- Index maintenance uses the live incremental refresh (build-and-swap; never
  empties the index in place under a concurrent searcher).
- No per-run report notes in the vault: the report goes to stdout + the state
  dir; --report-note is the only way one lands in the vault.

1,037 tests / ruff / mypy strict green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NbCqLsAJaoeCcyqnTs31Vk
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ea305f03-13b3-4b37-a14f-e1d6ba79b5b1


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Machine-local, auto-expiring scratch notes, marked by a `.scratch.md` filename
suffix (the option chosen for its minimal mesh footprint).

- create-note gains `scratch: bool`; a scratch note is written as
  `<title>.scratch.md`. The suffix IS the mark — no note-body field.
- Still a top-level `*.md`, so search and listings find it like any note.
- Machine-local by default: mesh gitignores `*.scratch.md`, so it is never
  committed or replicated (the "ephemeral + committed to permanent history is
  a contradiction" ruling). Opt-in replicate = create it as a normal note.
- TTL expiry is an `omind maintain` step: scratch notes untouched for 7 days
  (from LAST MODIFICATION — HAL9000's clock refinement) are ARCHIVED, never
  deleted. Reports on a dry run; archives under --apply. Machine-local, so it
  runs outside --sync.

Completes item #5 (the scoped-write interlock is #287). 1,029 tests / ruff /
mypy strict green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NbCqLsAJaoeCcyqnTs31Vk
@CryptoJones CryptoJones changed the title feat: sleep-time janitor omind maintain (roundtable-consensed, item #3) feat: sleep-time janitor + scratch tier (items #3 and #5 part 2) Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant