Skip to content

fix(docs): move learn probe row into capabilities/ and refresh stamp - #2573

Merged
abrichr merged 1 commit into
mainfrom
gemini/fix-main-capabilities-stamp
Nov 23, 2026
Merged

abrichr merged 1 commit into
mainfrom
gemini/fix-main-capabilities-stamp

Conversation

@abrichr

@abrichr abrichr commented Nov 23, 2026

Copy link
Copy Markdown
Member

Summary

Fixes broken main (tests/test_build_capabilities.py::test_the_committed_stamp_matches_the_page_the_sources_build).

PR #2413 merged after #2518 with a hand-edited learn probe row in CAPABILITIES.md. This PR moves that exact row verbatim into capabilities/04-the-core-a-checked-entry-every-time/0395-learn-per-request-bookkeeping-from-read-only-requests.md and refreshes capabilities/CAPABILITIES.md.sha256 (CAPABILITIES.md and llms-full.txt remain byte-for-byte unchanged).

Verification

  • pytest -q tests/test_build_capabilities.py -> 12 passed
  • python scripts/build_capabilities.py --check -> OK
  • python scripts/build_capabilities.py --guard -> OK
  • python scripts/build_capabilities.py --check-pr origin/main -> OK
  • gitleaks detect --no-git -> 0 leaks

@abrichr

abrichr commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Grok
Reviewed-Head: bb2eb1c

Head confirmed open and unchanged versus this SHA. I claimed the review in openadapt-internal#211 (7092597531). This is a 2-file docs fix: it does not bump a package version or release metadata.

#2413 left a hand-edited learn probe row in CAPABILITIES.md without a matching capabilities/ source file, so capabilities/CAPABILITIES.md.sha256 no longer matched the page and test_the_committed_stamp_matches_the_page_the_sources_build (guard()) failed on main. I independently verified:

  • The new row file is a single table line in section 04-the-core-a-checked-entry-every-time, numbered 0395 so it assembles between existing 0390 (Learn, then enforce) and 0400 (Catch a lost update), which is exactly where the committed page already has it.
  • The row body is verbatim the line already on CAPABILITIES.md (four columns: Capability / Status / Evidence / Where). CAPABILITIES.md and llms-full.txt are unchanged versus main.
  • Assembling the PR's capabilities/ tree produces a byte-identical CAPABILITIES.md (164523 bytes). The updated stamp is the sha256 of that page: 93e2f3c7e6f63fe1c2bc96a55ee62c99a582690971839a0e84e250ce01d421da. guard() returns 0 and python scripts/build_capabilities.py --check passes. The previous stamp e43b0296... was the stale pre-feat(flow): learn per-request bookkeeping from read-only requests #2413 hash, which is why main was red.

Residual, not blocking: the Status cell still says (this PR) because the row was copied verbatim from the already-landed #2413 hand-edit, and this PR correctly does not change the published page. A later row edit can name #2413. The filename slug is slightly longer than build_capabilities._slug() (...-requests suffix); assemble only orders by number, so this is fine.

Review only; I will not merge this PR.

@abrichr
abrichr merged commit 1eef7b9 into main Nov 23, 2026
50 checks passed
@abrichr
abrichr deleted the gemini/fix-main-capabilities-stamp branch November 23, 2026 05:47
@abrichr

abrichr commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Claude
Reviewed-Head: bb2eb1c

Cross-vendor review of the P0 main fix; Gemini wrote it. The diff is two lines: it adds the missing source line for the #2413 learn-probe row (0395-learn-per-request-bookkeeping-from-read-only-requests.md) and updates capabilities/CAPABILITIES.md.sha256. CAPABILITIES.md is byte-identical to main, so the sources now build the page main already holds and no row is lost. build_capabilities.py --check exits 0 at this head. Merge it as soon as the required checks are green, to turn main green.

Note: the separate HOME-dependent flow test_cli_surface failure is fixed by #2572.

abrichr added a commit that referenced this pull request Nov 23, 2026
…lt (#2423)

* flow: encrypt recordings, bundles and runs at rest by default (WIP)

Envelope encryption: each sealed set has its own data key, wrapped with age
(X25519, pyrage) for this computer's device key (OS keychain through keyring,
0600 file fallback with a warning), optional organization recipients and
shares. Configured passphrase keys keep the v1 header. at-rest status, share
and shred. Receipts read encrypted runs and stay over the plaintext report
digest.

* flow: key hierarchy per the evidence-encryption memo

Sealed-set v3 now wraps each set's data key with HPKE (P-256, HKDF-SHA256,
AES-256-GCM) to a per-set bucket key, whose record is wrapped to the device
runtime key (only while written), the device viewer key, organization keys
(P-256 or RSA-OAEP-3072) and a solo recovery key. Files are Tink
AES256_GCM_HKDF_1MB streams, checked against Tink. Organization mode comes
from a machine policy and fails closed without its recipient and archive.
Hardware providers are interfaces with test doubles. Shred destroys the
tracked bucket-key copies. age and the share verb are gone.

* flow: report a locked encrypted run clearly; tests for the key hierarchy

seal verify says report_locked, not subject_mismatch, when no key here opens
an encrypted run. The quickstart makes the device key before its workers
start. Tink interop and hierarchy tests; default-mode tests now expect sealed
output.

* flow: sealed bundles never yield plaintext runs; legacy plaintext runs continue plaintext; desktop encryption test

* benchmark: quickstart timing with everything encrypted by default

* flow: refuse passphrase rewrap of v3 sets; mypy fixes

* flow: keep __main__ growth small; RFC 9180 derivation vector; no internal references

* flow: encrypt undo prior state and narration inside sealed sets; branch teach reads encrypted runs

Found by running the reader suites under the real default
(OPENADAPT_TEST_DEFAULT_AT_REST=1).

* docs: link the capability row to #2423

* flow: open key records with the binary-safe opener (Windows descriptor contract)

* flow: register the quickstart timing data in the public artifact inventory

* flow: keep __main__.py from growing; at-rest command tables and helpers live in cli_at_rest

* flow: keyring stays in the keychain extra (install weight); pip install openadapt already includes it

* tests: set the synthetic-data opt-out and the file key store session-wide

Module-scoped fixtures (an e2e recording compiled once per module) ran before
the per-test isolation and now sealed their output by default, under a key
the per-test home could not open.

* cli: route at-rest under the setup task in both task tables

* flow: at-rest subcommands refuse abbreviations; session test env set in pytest_configure and restored

* flow: address the Codex review of #2423

- An organization shred reports incomplete, exits non-zero and keeps a
  pending marker until the archive copy is deleted; shred again or
  at-rest archive finishes it.
- A named policy file that is missing refuses; on Windows an organization
  policy comes only from a machine source.
- at-rest archive sends pending key records after an outage, and the next
  set tries it before refusing at max_unarchived.
- record_desktop_capture follows the at-rest policy by default and refuses a
  capture_dir outside its private staging folder when encrypting.

* flow: bind key records to their archive, authenticate shreds, serialize bucket changes

- An archive counts as reachable only with its .openadapt-key-archive marker;
  Flow never creates the folder, writes records atomically, and records the
  archive each bucket went to (header and record). Shred and retry use that
  archive, never the current policy, and a missing marker is never deletion.
- Shred authenticates the header with a recipient key before choosing what to
  destroy, keeps progress in the header and a local pending marker, and says
  complete only after the store files and the archive copy are gone.
- One bucket lock serializes create, archive, close and shred, so a shredded
  record is never written back. max_unarchived is checked after the new
  record's own archive attempt (0 means synchronous), and a refused set
  leaves no record.
- Organization mode requires records: archive. A record that arrives in a
  header opens only with this computer's device keys or a recovery key.
- A lost device key no longer hides a valid recovery or organization key.
- Machine policy: each platform reads only its own sources, HKLM access
  denied is an error, and every policy file is checked root-owned and
  root-writable-only on the descriptor actually read.
- Refresh the eligibility connector lock.

* flow: keep run state, exports and recorders inside the at-rest policy

- Durable checkpoints (and rollback state) in a version 3 run use a key
  derived from the run's data key, whoever constructs the store, so a shred
  reaches them in backups too. A store without a key encrypts by default,
  and a downgraded run still sets its checkpoint key.
- --no-encrypt lasts for one command: the environment is restored however
  the command ends.
- Recorder and InteractiveRecorder default to the at-rest policy; an
  explicit encryption_key=None is refused in strict mode and ledgered
  otherwise. Direct desktop capture applies strict mode, the ledger and the
  organization policy before the recorder starts, and a plaintext staging
  folder that survives cleanup is an error, not a success.
- report-run --receipt writes records.json only inside an encrypted run (or
  under the recorded opt-out).
- local-seal verify reads an encrypted run's report in memory and is
  sealed-ready (and strict-safe on plaintext runs).
- api.replay reads the report through the sealed set.
- Hosted success reporting parses the bytes it decrypted; the client run id
  of an encrypted run is a structural file in its sealed index.
- Retention planning refuses a passphrase check on a version 3 run, where
  the passphrase plays no part.

* docs: archive marker, archive-only organization mode, shred authentication and run-keyed checkpoints

Move the encryption-at-rest changelog section to Unreleased: v3.4.0 shipped
without it.

* Regenerate the flow CLI surface snapshot (at-rest commands, --no-encrypt) and llms-full.txt

* test(flow): the records.json receipt test writes outside a run under the opt-out

* flow: seal rollback records in encrypted runs, bind solo sets to their device

- rollback writes its compensated marker and difference files through the
  run's sealed set when the run is encrypted (the default), and
  was_compensated reads the marker there; a run whose state can't be read is
  never treated as resumable.
- A key record carried in a header opens silently only with this computer's
  device key. A set that only the recovery code opens (which anyone who read
  recovery.pub.json could make) is refused until the person restores it:
  `openadapt-flow at-rest restore DIR --yes` rewraps it to this device and
  re-stamps the header, or OPENADAPT_RECOVERY_RESTORE=1 reads backups in place.
- CI: flow core unit shard 1 also runs the rollback, checkpoint and key
  suites with OPENADAPT_TEST_DEFAULT_AT_REST=1.
- Regenerate the CLI surface snapshot (at-rest restore) and llms-full.txt.

* fix(flow): use open_binary in key_hierarchy and satisfy mypy

* flow: durable resume and authority proofs work in encrypted runs

- DurableAuthority digests report.json through the run's sealed set (the
  bytes the continuation fenced), so prove_executor_outcome and the terminal
  check no longer fail on every encrypted run.
- A run cut off before its writer finalized (a crash or a killed leg) can be
  carried on: the next writer authenticates the header and adopts each file
  only if it authenticates under the set's key at its own path.
- CheckpointStore resolves the run's key when it is used, so a store made
  before its run became an encrypted set uses the run's key.
- was_compensated checks the marker's presence in either form without
  opening the set (the previous push treated an unfinalized run as
  compensated and refused its resume).
- The attended reject path rewrites the report through the sealed set.
- CI: the default-mode step also runs the durable and authority suites that
  pass in that mode.

* flow: an atomic report replace that keeps an encrypted run sealed (attended reject)

* flow: keep at_rest below sealed_set, fix mypy, keep capability row sources

- new_artifact_key moves to sealed_set (at_rest must not import upward).
- A type ignore for the unfinished-run resume key, as on the creation path.
- The checkpoint lifecycle test checks the refusal when the key is used.
- CAPABILITIES.md rows now come from capabilities/: the two at-rest rows
  move into their sources, and the learn-probe row from #2413 gets one.

* ci: a temporary informational job running the whole flow suite with encryption at rest on (#2423)

* test(flow): tamper durable state through the stores' own writers, so the intended refusal is checked in either mode

* flow: authoring, runtime validation and agent teach read and write encrypted recordings and runs

- AuthoringSession reads and stamps the recording's events.jsonl and
  meta.json, and writes admit.json, through the sealed set (the recorder
  seals by default).
- Runtime validation reads the run report in memory.
- Agent-teach evidence reads the sealed report and frames; writing that
  plaintext evidence folder is logged by default and refused in strict mode.
- Tests: under OPENADAPT_TEST_DEFAULT_AT_REST=1, one at-rest home per
  session (per worker), outside the tests' own directories.

* flow: distill and agent-teach candidates stay encrypted; default-mode test isolation

- distill_recording reads an encrypted recording in memory and writes the
  distilled recording encrypted (authoring compile distills by default).
- The agent-teach repair candidate is written through the sealed set.
- Tests: the default-mode skip list (tests/default_at_rest_skips.txt), and
  the sealed lock directory outside the tests' own directories.

* docs: drop the duplicate learn-probe row source (#2573 added it on main)

* flow: receipts and handoff follow-ups for encrypted runs; JIT drafts plaintext by design, ledgered

- Run receipts are written for encrypted runs (the default): receipt.json
  stays a structural file of the set, the private openings, card and
  follow-ups are sealed in it, and receipts and follow-ups serialize on a
  lock of their own (sealed_set.side_lock). Verification and the handoff
  list read them through the set.
- The JIT compile agent's capture (recording, draft bundle, signed records)
  is plaintext by design: named on stderr and in the ledger, refused in
  strict mode before recording, with the opt-out held for that capture only.
- distill: a type fix for mypy.
- Tests: the default-mode session home resolves symlinks.

* flow: more readers of encrypted runs and bundles (default-mode triage)

- The JIT capture's plaintext opt-out stack exists from construction, so a
  capture closed without entering still cleans up.
- verify_integrity hashes an encrypted bundle's assets in memory.
- The variant router reads the child run's report through the sealed set.
- The console shows an encrypted run's pending escalation.
- The approver-root pin (a key fingerprint, key directory and roster head,
  written before the run) is a structural file of a run set.

* ci: the default-at-rest suite is required on pull requests, with its triaged skips

- tests/default_at_rest_skips.txt: each test skipped under
  OPENADAPT_TEST_DEFAULT_AT_REST=1, with its reason (group a: the test reads
  or plants plaintext and the product correctly refuses; group b, open:
  attended approvals, drafts, business decisions and teach on encrypted
  input). The matcher takes a test, its class or its file.
- flow default at rest joins packages-gate (pull requests only).
- Merge origin/main and regenerate CAPABILITIES.md and llms-full.txt.

* test(flow): track tests/default_at_rest_skips.txt (*.txt is ignored)

* ci: the default-at-rest shards leave the wall-clock bound to flow core unit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant