Context
The current local approval path proves exact input binding and one-time consumption, while production hosts need restart-safe storage without coupling Maqam to one database.
Scope
Define a minimal durable approval-store interface and a deterministic in-memory conformance suite that third-party adapters can run.
Acceptance criteria
- The contract covers create, read, consume-once, expire, revoke, and compare-and-set behavior.
- Approval identity remains bound to run, tool, canonical input hash, reviewer decision, expiry, and relevant policy context.
- Two concurrent consumers cannot both succeed.
- Restart fixtures prove an unconsumed record can resume and a consumed record cannot replay.
- Corrupt, unknown-version, expired, revoked, and partially written records fail closed.
- Storage errors are typed and never downgrade into an in-memory allow path.
- The reference conformance suite runs offline on Node 20, 22, and 24.
- Migration/versioning expectations and adapter author guidance are documented.
- The existing in-memory implementation remains usable for local examples.
Boundaries
Do not add a production database dependency, hosted service, default encryption claim, or distributed-consensus claim. Durable adapters remain explicit host responsibilities.
Contribution flow
- Comment on this issue before starting so effort is not duplicated.
- Fork the repository and create a focused branch in the fork.
- Add implementation, deterministic tests, and documentation in the same pull request.
- Open the pull request against
main; maintainers review and merge after required checks pass.
A normal contribution must not bump the package version, create a tag, publish to npm, add live secrets, or weaken fail-closed behavior.
Context
The current local approval path proves exact input binding and one-time consumption, while production hosts need restart-safe storage without coupling Maqam to one database.
Scope
Define a minimal durable approval-store interface and a deterministic in-memory conformance suite that third-party adapters can run.
Acceptance criteria
Boundaries
Do not add a production database dependency, hosted service, default encryption claim, or distributed-consensus claim. Durable adapters remain explicit host responsibilities.
Contribution flow
main; maintainers review and merge after required checks pass.A normal contribution must not bump the package version, create a tag, publish to npm, add live secrets, or weaken fail-closed behavior.