Repository navigation
fix(witan): stop defaulting cleanup to --keep 10 ahead of omnigraph 0.13 - #465
Merged
Merged
Conversation
`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
Contributor
There was a problem hiding this comment.
🟡 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.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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 cleanupandwitan-code cleanupdefault to--keep 10and describe it as versions per table. That is what omnigraph 0.11 does. From 0.12,--keep Nretains 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 30dalone as well.--older-thanon 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 optimizeandwitan cleanupagainst anhttp(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'sservelock refuses direct maintenance anyway, and that the data tier's maintenance job runs it in a stop window (spec D5).Not changed:
OmnigraphClient.cleanuppasses--confirmbut not--yes, which the CLI wants for a non-interactive cleanup of ans3://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?
just test-witan-core712 passed,just test-witan-council1432 passed,just test-witan-code683 passed.omnigraph cleanup --helpon 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, andcleanup --server …on 0.13.0.docs/reference/cli.mdis regenerated withjust docs-gen.https://claude.ai/code/session_01Mfmuz4DTn557AV8V17o98A