Repository navigation
feat(demo): measure completion claims against tool outcomes - #2795
Conversation
|
Warning Review limit reached
Next review available in: 52 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c1e926683f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Adversarial review — iteration 1Findings and fixes:
Verification: The live aggregate remains intentionally unquoted: the live archive read did not complete, so publishing an X/Y number would be dishonest. |
Adversarial review — iteration 2Independent review found and this branch fixed:
Verification: The live metric is still deferred honestly: runtime capability and documentation are present, but no current live X/Y receipt is committed until a read completes. |
Adversarial review — iteration 3Independent hostile review found and this branch fixed:
Verification: Survived scrutiny: all action outcome decisions remain based on paired typed tool-result blocks, not assistant prose; every headline bucket still partitions the selected denominator. |
Adversarial review — iteration 4Independent hostile review found and this branch fixed:
Verification: focused completion-claim suite passed (13 tests); Survived scrutiny: receipt evidence preserves the archive's three-valued outcome truth; repaired is reserved for a typed, ordered, same-tool-and-command successful outcome. |
Adversarial review — iteration 5 (clean)Fresh clean-room review of What survived scrutiny:
This reaches the requested clean-review fixpoint. No merge and no Bead state change were performed. |
Final acceptance-criteria matrix
No Beads were closed or claimed. |
Regenerate the topology projection after adding the deterministic cohort compiler.\n\nCo-Authored-By: Codex <[email protected]>
Problem: the deterministic receipts proof showed one contradiction but could not state a reproducible completion-claim sample frame or aggregate headline.\n\nWhat changed: compile an origin-stratified deterministic cohort manifest for declared completion-language candidates, then classify each only from typed action outcomes. The result reports unsupported and contradicted-then-repaired denominators with block evidence references.\n\nCompatibility: completion language is a declared lexical population, not an assertion that every assistant statement is a completion claim.\n\nRef polylogue-67ac\n\nCo-Authored-By: Codex <[email protected]>
Route completion-claim receipt lookup through messages_fts before block lookup, avoiding a generic complete/finished corpus scan. Verified: tests/unit/demo/test_demo_completion_claims.py — 2 passed; quick gate passed. Co-Authored-By: Claude <[email protected]>
Problem: completion-claim receipts could omit is-error-only outcomes, include protocol text, overstate a prior action as support, and raise if its FTS evidence was unavailable.\n\nWhat changed: require assistant-authored material and fresh FTS, retain every typed outcome, record an evidence-state fingerprint, and keep unavailable evidence inside the receipt's typed failure result. Document the explicit local live-archive invocation.\n\nCompatibility: a prior outcome now remains a neutral observation instead of support for a completion claim.\n\nRef polylogue-67ac\n\nCo-Authored-By: Codex <[email protected]>
Problem: the fixture receipts command could not run its completion cohort against an ordinary operator archive because it first required fixture-specific sessions.\n\nWhat changed: add an explicit completion-claims-only route that emits the cohort directly, while retaining the default deterministic fixture proof.\n\nRef polylogue-67ac\n\nCo-Authored-By: Codex <[email protected]>
Problem: completion claim evidence was ordered by tool invocation, and the aggregate concealed neutral or unrepaired evidence states.\n\nWhat changed: order actions by their paired result message, expose every classification bucket in the headline, and fingerprint the selected typed evidence separately from the sample manifest.\n\nRef polylogue-67ac\n\nCo-Authored-By: Codex <[email protected]>
Problem: completion receipts rendered only counts, ignored transcript variants, and could match two actions with absent command evidence as a repair. What changed: expose percentage headline fields, compare claim and outcome by the canonical message/block ordering tuple, and require a nonempty canonical command for a repair match. Exercise all three paths through the seeded archive. Ref polylogue-67ac
Problem: strict typing could not establish the dynamic headline payload field types. What changed: validate count and percentage payload values before formatting the human receipt. Ref polylogue-67ac
Problem: nullable typed outcome fields were rendered as known false values, and a blank tool name could satisfy repair identity. What changed: retain NULL is_error as unknown in evidence output and require a nonempty tool name and command for repair classification. Add seeded archive regressions for both evidence gaps. Ref polylogue-67ac
72a729c to
787beac
Compare
…807,2780,2790,2791,2795,2802,2806,2809 uwk3, jph5 (rigor-contracts #2783), bby.17 (web-cockpit #2793), dmp (terminal-note #2801), ra3w (basetemp-fix #2807), r4no/bkff/r2kb (extension-redesign #2780) fully satisfied — closed. nhjs (#2793), peo (daemon-forensics #2802), 4g3n (#2780), 67ac/212.11 (demo-corpus #2795), rsad (mcp-ergonomics #2790, real gaps remain per 5-iteration adversarial cap), 9e5.8.4/jnj.7 (provider-origin #2806), mrxt/37t.12/p5g/rxdo.4 (annotation-judgment #2791), s7ae.8/20d.2 (live-performance-2 #2809) partially satisfied — noted with disposition, left open. Also discovered and documented the actual root cause of this session's recurring bead-revert incidents: bd reimports the live database from .beads/issues.jsonl on every CLI invocation, so a write not immediately exported is lost the moment the next bd command runs. Every mutation in this commit was individually export-verified against that behavior. Co-Authored-By: Claude <[email protected]>
…2885) ## Summary Adds `devtools demo real-slice-screen`, a read-only extraction + privacy screening harness for candidate real-archive session slices, plus the harness's own test coverage. This is the "harness/fixture machinery" half of polylogue-212.11's real-archive-data extension; the actual candidate slice and its privacy write-up are a separate, deliberately-unmerged artifact (see Verification below) awaiting operator spot-check before any real content is folded into `polylogue/scenarios/`. ## Problem polylogue-212.11 ("one shared deterministic proof world for all flagship demos") has already landed 37 declared constructs on a fully-synthetic Incident 14:32 corpus (PRs #2662, #2674). Per explicit operator direction, the shared proof world should also draw on a real, representative slice of the operator's own archive (`/realm/db/polylogue`) rather than staying synthetic-only — "the point is representative data, not full determinism." That requires a privacy-vetting step. The bead's own instructions are explicit that this step must **not** be autonomous: a candidate slice has to be pulled, screened, and handed to the operator as a flagged, reviewable artifact before it becomes a permanent shared fixture. This PR ships the reusable machinery for that step; it does not itself promote any real content into the product tree. ## Solution - **`devtools/proof_world_real_slice.py`** — given one or more session ids (or a refs file) and a real archive root, opens the archive read-only via `Polylogue.get_session()` (the API's `ArchiveStore.open_existing(..., read_only=True)` default — never mutates the source archive), flattens each session's message text + structured block payloads to plain text, and runs a pattern screen: - **secret/credential shapes**: AWS access key ids, generic `key=value`/`key: value` credential assignments, bearer tokens, `BEGIN ... PRIVATE KEY` blocks, OpenAI-style `sk-...` keys, Slack tokens, SSH public keys, JWT-shaped strings. - **PII-adjacent shapes**: email addresses, `/home/<user>` paths, IPv4 addresses — with a small allowlist for common test placeholders (`[email protected]`, `127.0.0.1`, `0.0.0.0`, ...) so the report isn't dominated by noise from ordinary test fixtures. - Any secret-pattern hit -> `flagged`; any non-allowlisted PII hit (with no secret hit) -> `review`; otherwise `clean`. - Writes `SCREENING_REPORT.md` (per-session verdict + truncated match samples), `manifest.json`, and per-session `transcripts/*.txt` to an arbitrary output directory. It never writes into `polylogue/scenarios/` or any other product fixture path — promoting a slice stays a distinct, explicit, human-gated step. - Registered as `devtools demo real-slice-screen` in `devtools/command_catalog.py` (category `workspace`); `docs/devtools.md` regenerated via `devtools render devtools-reference`. - `tests/unit/devtools/test_proof_world_real_slice.py`: pure-function coverage of the pattern scanner and verdict logic (including the allowlist), the text-flattening helper, report rendering, CLI argument handling, and an end-to-end read path against a `SessionBuilder`-seeded archive that plants a real AWS-key-shaped string and asserts it is both read back correctly and flagged. ### What this PR does *not* do - It does not fold any real archive content into the shared demo corpus. I ran the harness against 5 candidate sessions from the operator's own archive (their own dev-work sessions on this very repository — flaky-test hunting, pipeline-idempotency test design, and two issue implementations) and wrote up the result (0 flagged, 3 "review" — all traced to test placeholders/loopback IPs/the operator's own home path in their own tool-output truncation messages, not third-party data — 2 fully clean) as a distinct, gitignored artifact under `.agent/scratch/real-slice-vetting-2026-07-14/` (`OPERATOR-SUMMARY.md`, `SCREENING_REPORT.md`, `manifest.json`, `transcripts/`). That directory is **not** part of this diff — `.agent/scratch/*` is gitignored — and is left in place for a quick operator spot-check per the task's explicit instruction that this step "should NOT be treated as fully autonomous." - The remaining declared-but-unimplemented AC items from the bead notes (parser v1/v2 dual interpretation, typed cross-source 14:32 event hooks) are unaffected by this PR and remain open follow-up scope on polylogue-212.11 — see the bead's own notes history (PRs #2662/#2674/#2795). - No raw provider JSON/JSONL bytes were extracted from the archive's blob store; the harness reads normalized message text via the `Polylogue` API. If/when the slice is approved, a follow-up should decide whether real parser-replay fidelity (raw bytes) or the normalized text is the right fixture-generator input — that decision is out of scope here. ## Verification ``` devtools test tests/unit/devtools/test_proof_world_real_slice.py tests/unit/devtools/test_command_catalog.py -> 19 passed in 37.41s devtools verify --quick -> exit_code 0 (ruff format/check, mypy --strict, render all --check, topology/layering/closure-matrix/manifests/ci-workflows/doc-commands/ test-infra-currency/test-clock-hygiene/pytest-timeout-overrides/ degrade-loudly all ok) ``` Anti-vacuity: `test_screen_session_reads_real_archive_and_flags_planted_secret` drives the real production path (`Polylogue.get_session` against a `SessionBuilder`-seeded archive, not a mock/stub) and fails if `scan_text`'s secret-pattern set is emptied, or if `screen_session` stops calling it. Ref polylogue-212.11. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added a read-only command to extract and privacy-screen candidate archive sessions. - Supports selecting sessions directly or from a references file. - Generates screening reports, structured results, and transcript files. - Detects credential-like content and personally identifying information, with redacted secret samples. - **Documentation** - Added the new workspace command to the developer tools catalog. - **Tests** - Added coverage for detection, redaction, verdicts, file handling, reporting, and command-line validation. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude <[email protected]>
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Adds a deterministic, origin-stratified completion-claim cohort to
polylogue demo receipts. Each sampled claim resolves only against typed tool outcomes and carries block-level evidence references.Ref polylogue-67ac
Problem
The deterministic receipt showed one contradiction, but could not name a reproducible completion-claim population, sample selection, denominator, or aggregate unsupported/repaired rates.
Solution
is_error-only outcomes. A generic prior outcome is neutral; only a same-command failed→successful sequence iscontradicted_then_repaired.demo receipts, and document the explicit local live-archive path.Verification
POLYLOGUE_PYTEST_TMPDIR=/realm/tmp/polylogue-pytest python -m devtools test tests/unit/demo/test_demo_completion_claims.py— 13 passed.python -m devtools verify --quick— passed: format, lint, strict mypy, generated surfaces, topology, layering, schema, and policy gates passed.polylogue demo seed,polylogue demo verify, andpolylogue demo receipts --completion-claims-only --format jsonagainst an isolated/realm/tmparchive — passed; seeded denominator 2, with 0.0% unsupported and 50.0% contradicted-then-repaired.contradicted_without_recorded_repair; moving a result to a later variant makes the claim unsupported; removing tool-input command or tool-name identity forbids a repair match; nullingis_errorpreserves unknown; missing FTS refuses publication. Removing the corresponding production timing, identity, null-preservation, or FTS checks makes those tests fail.Acceptance matrix
polylogue-67acpolylogue-212.11