Skip to content

Acceptance key handling after #44: reject whitespace keys, demo key off by default, fail on invalid env key #53

Open

Description

@FetchDoge

REA's after-the-fact check of main 9809cc7 (#44) FAILED (seq 683, REA-CHECK-PR44-9809cc7.md). The fallback key itself is gone, and old demo-key signatures are rejected. Two bars fail.

Keys item. Merging needs Marcus Richards' own yes plus an independent REA check.

Owner: Launch. Due: Oct 22.

Pass bar (written before the work)

  1. The verifier and ledger constructors reject a whitespace-only key, including one of 32 bytes or more, with a test.
  2. The demo key is an explicit opt-in flag, off by default. server.py in mock mode (including --db), demo.py, demos/*, python -m permit and trace.py exit with a non-zero code when no valid key is set and the flag is absent, with a test for each entry point.
  3. A key set through env but invalid (missing, 31 bytes, or whitespace) raises an error even when the demo flag is on.
  4. In --db mode with the demo flag, the key does not change silently across a restart. It either persists in a 0600 file or refuses to start, and the docs say which.
  5. The stale docstring at ledger.py:13 is fixed, and the sign_acceptance API change is noted in the CHANGELOG or README.
  6. The full suite passes plain and under -O. Every new test fails on 9809cc7 and passes on the fix.

Also: the README license badge says MIT, but LICENSE is Apache-2.0 (#51). Fix the badge in the same PR or a separate docs PR.

Activity

  1. FetchDoge commented on Oct 19, 2026

    @FetchDoge
    OwnerAuthor

    Fix is up as PR #55 (branch fix/acceptance-key-53, head 76317cf).

    Evidence against the pass bar:

    1. Whitespace-only keys rejected by ReleaseVerifier, DurableReleaseVerifier, and sign_acceptance, with tests.
    2. --demo-key flag (off by default) on server.py (mock incl. --db), demo.py, demos/*, python -m permit, trace.py; subprocess test per entry point proves non-zero exit without a key or the flag.
    3. Configured-but-invalid env/explicit key raises even with the demo flag; fallback only when nothing is configured.
    4. --db --demo-key persists the key in a 0600 <db>.demo-key sidecar; restart test proves the file is byte-identical across restarts. README documents the sidecar.
    5. ledger.py docstring fixed; README notes the sign_acceptance API change. License badge already read Apache-2.0 (docs: relicense under Apache-2.0 and add NOTICE #51), no change needed.
    6. All 29 new tests fail on 9809cc7 and pass on the branch; full suite 428 passed, 1 skipped, plain and under -O.

    Left unmerged per the keys-item gate in this issue: needs Marcus Richards's own yes plus an independent REA check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions