Skip to content

feat(rex): land the review-experiment epic work on main (PMAT-4524) - #5159

Open
noahgift wants to merge 1 commit into
mainfrom
84/rex-001-eight
Open

noahgift wants to merge 1 commit into
mainfrom
84/rex-001-eight

Conversation

@noahgift

Copy link
Copy Markdown
Contributor

Summary

Lands the review-experiment (rex) epic work on main as one commit (PMAT-4524).

  • aprender-review-experiment: new and changed modules, their tests,
    and the rex and replay examples (Qwen3.5 as the model, llama.cpp as
    the runtime). replay run --out writes its file whole, so a rerun
    replaces the s1-v2 rows and never appends to them.
  • contracts: new and amended contracts, with the ONT witness
    regenerated for the new relation set.
  • aprender-serve: top-K logprobs per generated step on the Qwen3.5
    hybrid chat path, and POST /v1/chat/prompt-ids mounted on that
    path only. The infer path refuses --logprobs for an APR or
    SafeTensors model before the load.
  • apr run: --logprobs K (at most 20, as top_logprobs on HTTP)
    records the K most likely next tokens and the encoded prompt ids
    in the --json and --stream documents (apr run: payload trace / --logprobs must record per-step top-k logits (no CLI path today; found on #4004) #4026). It is refused by name
    wherever it cannot be reported: text output, --benchmark (with or
    without --json) and --batch-jsonl. Recorded steps whose chosen
    tokens are not this run's generated tokens are refused, not
    reported. One exception: a turn that ended on a stop token may
    carry one trailing step more than its reply, the stop token the
    dense GGUF route drops from the reply; that one step is dropped.
  • Gate change: check_append_only_ledgers.sh now accepts a file under
    docs/audits/ that .gitattributes declares audit-golden (written
    whole by one writer) without a union merge, and FAILs one declared
    both ways. Only the bare attribute declares a golden. .gitattributes
    declares the review corpus and the PRM-S1 v2 rows golden and unions
    the rex-001 admission ledgers by glob. The self-test proves a real
    ledger is not golden, that the scan FAILs a golden+union tree and
    passes the golden-only control, and that the value forms are not
    golden.
  • The binding scanner now sees FALSIFY-TDC-009: a trailing comment on
    its attribute line hid the test fn.
  • Three functions split below the complexity bar, with no change in
    behaviour: apr's model resolver, its run and diagnostic
    dispatch, and the orchestrate tool-call envelope parser.
  • docs, evidence and scripts: the audit receipts and roadmap entries
    behind the above, and a read-only transcript-retention audit. The
    prm-04 parity capture carries <models>/ in place of two absolute
    weight paths; its receipt names that edit and both hashes.

Gate change (narrow)

scripts/check_append_only_ledgers.sh gains a declared audit-golden class. docs/audits/review-corpus/*.jsonl moves from must-union to audit-golden: the corpus is written whole by a single writer (one commit, 989cb01), and the guard never had a history check. New FAIL rows: a file declared both golden and union. Signed as a narrow gate change in its C314 round.

Test plan

Refs #4354
keep-open: #4354 is the rex epic; this PR lands one ticket of it (PMAT-4524), other rows stay open
ont-delta: resolves agent-trace-terms-v1 lane-independence-v1 review-b2-loop-v1 review-champion-challenger-v1 review-lane-perf-ratchet-v1 review-ledger-v1 review-ledger-v2 review-replay-v1 rex-pilot-projection-v1 rex-promotion-ladder-v1 rex-promotion-ladder-v2 sparse-logits-v1 trace-admission-prov-v1 trace-admission-secret-v1 trace-datacard-v1 trace-dedup-v1 trace-outcome-join-v1 trace-split-guard-v1 workload-profile-v1 (19 schema contracts enter contracts.nt; Contract nodes 1838 → 1857)

🤖 Generated with Claude Code

One commit over main, carrying the rex/001 work merged with main.

- aprender-review-experiment: new and changed modules, their tests,
  and the rex and replay examples (Qwen3.5 as the model, llama.cpp as
  the runtime). `replay run --out` writes its file whole, so a rerun
  replaces the s1-v2 rows and never appends to them.
- contracts: new and amended contracts, with the ONT witness
  regenerated for the new relation set.
- aprender-serve: top-K logprobs per generated step on the Qwen3.5
  hybrid chat path, and POST /v1/chat/prompt-ids mounted on that
  path only. The infer path refuses `--logprobs` for an APR or
  SafeTensors model before the load.
- apr run: `--logprobs K` (at most 20, as top_logprobs on HTTP)
  records the K most likely next tokens and the encoded prompt ids
  in the --json and --stream documents (#4026). It is refused by name
  wherever it cannot be reported: text output, --benchmark (with or
  without --json) and --batch-jsonl. Recorded steps whose chosen
  tokens are not this run's generated tokens are refused, not
  reported. One exception: a turn that ended on a stop token may
  carry one trailing step more than its reply, the stop token the
  dense GGUF route drops from the reply; that one step is dropped.
- Gate change: check_append_only_ledgers.sh now accepts a file under
  docs/audits/ that .gitattributes declares `audit-golden` (written
  whole by one writer) without a union merge, and FAILs one declared
  both ways. Only the bare attribute declares a golden. .gitattributes
  declares the review corpus and the PRM-S1 v2 rows golden and unions
  the rex-001 admission ledgers by glob. The self-test proves a real
  ledger is not golden, that the scan FAILs a golden+union tree and
  passes the golden-only control, and that the value forms are not
  golden.
- The binding scanner now sees FALSIFY-TDC-009: a trailing comment on
  its attribute line hid the test fn.
- Three functions split below the complexity bar, with no change in
  behaviour: apr's model resolver, its run and diagnostic
  dispatch, and the orchestrate tool-call envelope parser.
- docs, evidence and scripts: the audit receipts and roadmap entries
  behind the above, and a read-only transcript-retention audit. The
  prm-04 parity capture carries `<models>/` in place of two absolute
  weight paths; its receipt names that edit and both hashes.

Refs #4354

Agent: rex
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@noahgift noahgift added the owner:aprender-84 owning session (cop inbox claims) label Oct 11, 2026

This branch has not been deployed

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

Labels

owner:aprender-84 owning session (cop inbox claims)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant