Skip to content

Define a durable approval-store contract and conformance suite #20

Description

@AjnasNB

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

  1. Comment on this issue before starting so effort is not duplicated.
  2. Fork the repository and create a focused branch in the fork.
  3. Add implementation, deterministic tests, and documentation in the same pull request.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is neededsecurity-boundaryChanges or documentation affecting trust boundaries

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions