Skip to content

fix(witan): stop defaulting cleanup to --keep 10 ahead of omnigraph 0.13 - #465

Merged
blarghmatey merged 2 commits into
mainfrom
omnigraph-013-cleanup-retention-help
Oct 8, 2026
Merged

blarghmatey merged 2 commits into
mainfrom
omnigraph-013-cleanup-retention-help

Conversation

@blarghmatey

Copy link
Copy Markdown
Member

What are the relevant tickets?

N/A (witan task tk-update-cleanup-help-text-and-maintenance-wrapper-314a6a, part of the omnigraph 0.13 upgrade, spec in #461 D7)

Description (What does it do?)

witan cleanup and witan-code cleanup default to --keep 10 and describe it as versions per table. That is what omnigraph 0.11 does. From 0.12, --keep N retains the newest N graph commits of every live branch, so after the pin bump the default would cut a store to its last ten writes.

With neither bound given, both commands now keep the last 30 days (maintenance.CLEANUP_OLDER_THAN). That is the policy the Stop hook already passes, and ol-infrastructure's deployed cleanup job uses --older-than 30d alone as well. --older-than on its own no longer adds an implicit --keep 10.

The help text, the dry-run message, the READMEs and OmnigraphClient.cleanup's docstring describe both bounds in graph commits, and say what 0.11 does where it differs, so the text is true before and after the pin.

witan optimize and witan cleanup against an http(s) store used to run the CLI into its own "direct (storage-native) command" error. They now print why there is nothing to do and exit 0, as witan-code already did. Both messages note that from 0.12 the server's serve lock refuses direct maintenance anyway, and that the data tier's maintenance job runs it in a stop window (spec D5).

Not changed: OmnigraphClient.cleanup passes --confirm but not --yes, which the CLI wants for a non-interactive cleanup of an s3:// store. That is the same on 0.11 and is filed as tk-omnigraphclient-cleanup-passes-confirm-but-not-y-404d02.

How can this be tested?

  • On omnigraph 0.11.0: just test-witan-core 712 passed, just test-witan-council 1432 passed, just test-witan-code 683 passed.
  • omnigraph cleanup --help on both binaries: 0.11.0 says "Number of recent versions to keep per dataset", 0.13.0 says "Number of recent graph commits to keep on every live branch".
  • omnigraph optimize --server … is refused as a direct-storage command on 0.11.0 and 0.13.0, and cleanup --server … on 0.13.0.
  • docs/reference/cli.md is regenerated with just docs-gen.

https://claude.ai/code/session_01Mfmuz4DTn557AV8V17o98A

`witan cleanup` and `witan-code cleanup` default to `--keep 10` and
describe it as versions per table. From omnigraph 0.12 `--keep N` retains
the newest N graph commits of every live branch, so after the pin bump the
default would cut a store to its last ten writes.

With neither bound given, both now keep the last 30 days
(`maintenance.CLEANUP_OLDER_THAN`), the policy the Stop hook and the
deployed maintenance job already use. The help text, the dry-run message
and the READMEs describe both bounds in graph commits.

`witan optimize`/`cleanup` against an http(s) store ran the CLI into its
own "direct (storage-native) command" error. They now say why there is
nothing to do, as witan-code already did, and both messages note that from
0.12 the server's `serve` lock refuses direct maintenance anyway.

Claude-Session: https://claude.ai/code/session_01Mfmuz4DTn557AV8V17o98A
Copilot AI balanced review requested due to automatic review settings October 8, 2026 18:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The publishable witan-core documentation change is missing its required changelog fragment.

1 open finding
What changed in this PR

Updates cleanup retention semantics for omnigraph 0.12+ while preserving compatibility with 0.11.

Changes:

  • Defaults unbounded cleanup to the existing 30-day policy.
  • Makes HTTP(S) maintenance commands safe no-ops.
  • Updates tests, documentation, and release notes.
File Description
packages/​witan-core/​witan_core/​omnigraph.py Corrects cleanup retention documentation.
mcp/​servers/​witan/​witan/​cli/​maintenance.py Changes defaults and remote-store handling.
mcp/​servers/​witan/​tests/​test_maintenance.py Tests retention defaults and HTTP(S) no-ops.
mcp/​servers/​witan/​README.md Documents cleanup behavior.
mcp/​servers/​witan/​changelog.d/​20261008_140151_blarghmatey_omnigraph_013_cleanup_retention_help.md Records witan changes.
mcp/​servers/​witan-code/​witan_code/​cli.py Aligns witan-code cleanup behavior.
mcp/​servers/​witan-code/​tests/​test_maintenance.py Tests witan-code retention defaults.
mcp/​servers/​witan-code/​README.md Documents witan-code cleanup behavior.
mcp/​servers/​witan-code/​changelog.d/​20261008_140152_blarghmatey_omnigraph_013_cleanup_retention_help.md Records witan-code changes.
docs/​reference/​cli.md Regenerates CLI reference documentation.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/witan-core/witan_core/omnigraph.py
The cleanup docstring change in this branch is in the publishable witan-core package and had no fragment under packages/witan-core/changelog.d.

Claude-Session: https://claude.ai/code/session_01Mfmuz4DTn557AV8V17o98A
@blarghmatey
blarghmatey merged commit 3e27c06 into main Oct 8, 2026
20 checks passed
@blarghmatey
blarghmatey deleted the omnigraph-013-cleanup-retention-help branch October 8, 2026 19:37
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.

2 participants