Persist supervisor grants as active manifest versions #433
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Supervisor grants currently leave no trace in the manifest.
bot_bottle/supervise.pysays so outright:So today an approved
egress-allowwrites anAuditEntry(with a rendered diff) tosupervise_audit_entriesand hands the agent back{status, notes}— and that's it. The grant is real at runtime but invisible to the manifest. The declarative bottle definition underbottles/*.mdstill describes a bottle that never received the grant.That gives us two problems:
Proposal
Every grant that goes through the supervisor should translate into a modification of the active manifest, appended as a new version — an
active_manifest_versionstable in the existing SQLite store.Sketch, following the
AuditStore/TableMigrationsconventions inbot_bottle/audit_store.py:Append-only, one row per grant,
versionmonotonic perbottle_slug. Version 1 is the baseline captured at bottle start — the resolved manifest afterextends:chains (manifest_loader.load_bottle_chain_from_dir). Each approved proposal appends the next.parent_sha256chains versions so a tampered or skipped row is detectable, andsha256_hexalready exists insupervise.py.Rough scope:
ManifestVersionStorealongsideAuditStore, sameDbStore+TableMigrationspatternproposal_idOpen design question
Which artifact is the source of truth?
The manifest is human-authored per-file Markdown with
extends:chains resolved at load. If grants accumulate in SQLite, the resolved runtime manifest and the checked-in.mdfiles can disagree, and it isn't obvious which one wins on next start. Two directions:.mdfiles are the declarative baseline; the DB holds accumulated deltas layered on top at start. Grants persist across recreates for free, but the checked-in manifest quietly stops describing the running system — which is the thing we were trying to fix..mdstays authoritative. Versions are a record and a staging area; abot-bottle manifest promote-style command writes accepted grants back into the Markdown so they land in review. Grants don't silently persist, but the manifest stays the real declaration and drift is visible in git.I lean (b) — it keeps the manifest the single declarative source and puts grant persistence behind an explicit human step, which fits how the supervisor already works. But (a) is a better story for long-lived bottles where re-approving after every recreate is real friction. Worth settling before implementation, since it decides whether this table is authoritative state or a log.
Related