Repository navigation
feat(legibility): render public claims from FINDING assertions, not a hand ledger - #3065
Conversation
|
Warning Review limit reached
Next review available in: 38 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 ignored due to path filters (8)
📒 Files selected for processing (21)
✨ 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: 922aa2297a
ℹ️ 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".
… hand ledger Problem: docs/public-claims.yaml (schema external-claims-ledger/v2) was a hand-maintained YAML file, a second durable claims store parallel to the FINDING assertion substrate that PR #2791's canonical judgment lifecycle already governs. polylogue-3tl.16 asks for public claims to be a rendered projection over FINDING rows, judgment/supersession state, and a shared evidence-integrity verdict instead. Solution: polylogue/insights/measurement/public_claims.py computes one PublicClaimProjection per stable claim key from list_public_finding_inputs() (new adapter in storage/finding_provenance.py) plus an injected EvidenceIntegrityProvider.verdict_for() seam (polylogue-37t.14 is not yet landed, so a missing verdict fails closed as unresolved, never fresh/supported). Four presets (readme/launch/findings-page/ verified-export) filter the same computed rows -- status is computed once, not per surface. devtools/public_claims.py + new devtools/render_public_claims.py replace the old YAML-validator with a render/check command; docs/public-claims.yaml becomes a generated verified-export compatibility view. Seeds the three current claim-vs-evidence headline findings plus the flight-recorder capability statement via new PublicClaimDeclaration fields on the existing additive polylogue.finding.v1 assertion payload (no user-tier schema migration -- these are additive JSON fields on an already-JSON column). Originated as external-agent packet ann-05-claims-view-r01 (GPT Pro wave 2, snapshot 536a53e), unreviewed. Verified independently: - Confirmed against live source (not the packet's claim) that no second durable claims table exists and no schema migration is required for the new FindingAssertion fields. - git apply --check against current origin/master (12+ commits ahead of the packet's snapshot) failed on 3 of 29 files. Two (docs/plans/topology-target.yaml, docs/topology-status.md) are generated docs that drifted from unrelated intervening commits -- regenerated via `devtools render topology-projection` + `render topology-status` rather than force-applying stale content. The third (user_write.py) conflicted on one import line added by PR #3051 (`feat: harden archive continuity closure`) landing after the packet's snapshot; reconciled by hand (7 of 8 hunks applied clean via git apply --reject, the import line added manually). - Independently reproduced devtools verify public-claims --json (4 claims, 9 artifacts, 3 monitored surfaces, 0 problems) and devtools verify layering (0 violations) -- both match the packet's own claimed output exactly. - The packet flagged test_archive_tiers_api_archive_debt_reads_archive_consistency as a pre-existing "database source_debt is locked" failure unrelated to its patch. Reproduced this independently on the unrelated ann-01 worktree (clean master plus an unrelated feature) to confirm it is a genuine baseline/environmental flake, not something this patch introduced. Verification: - devtools test tests/unit/insights/measurement/test_public_claims.py tests/unit/storage/test_public_claims_projection.py tests/unit/devtools/test_public_claims.py -> 31 passed - devtools test tests/unit/scenarios/test_demo_archive_convergence.py tests/unit/storage/test_archive_tiers_assertions.py tests/unit/devtools/test_generated_surfaces.py tests/unit/devtools/test_release_readiness.py tests/unit/devtools/test_render_docs_surface.py tests/unit/devtools/test_project_motd.py tests/unit/daemon/test_standing_queries.py tests/unit/cli/test_import.py -> 84 passed - devtools test (6 affected tests/unit/api/test_facade_contracts.py cases) -> 6 passed, 1 pre-existing unrelated flake classified above - ruff format --check / ruff check on all 16 touched Python files -> clean - mypy --strict on all 13 touched production/test modules -> Success, no issues - devtools render all --check -> exit 0, no drift (includes regenerated topology projection/status) - devtools verify public-claims --json -> ok, 0 problems - devtools verify layering -> 0 violations - devtools verify --quick -> exit_code 0 Ref polylogue-3tl.16 Co-Authored-By: Claude <[email protected]>
…topology/public-claims after rebase
922aa22 to
236eab6
Compare
…nce (#3093) ## Summary Stacked on #3090 (needs `report["evidence"]["member_refs"]` added there). Represents each claim-vs-evidence report run as durable archive evidence — a content-addressed AnalysisDefinition, an AnalysisRun receipt, and Finding rows — instead of just a committed `report.json`. ## Problem `polylogue-rxdo` (It.12/It.13 scope correction) requires that queries and analyses be first-party data structures in Polylogue, not a bespoke devtools side-pipeline. The rxdo QUERY-evidence core (content-addressed query identity, canonical-plan evaluator, watched names, result manifests, durable refs) already landed via #2813/#2826/#2899, and the `FindingAssertion`/`PublicClaimDeclaration` write kernel + public-claims projection already landed via #3065 (`polylogue-3tl.16`) — but nothing had ever actually written a real `FindingAssertion` into the operator's live `user.db`; the "3 seeded findings" mentioned in 3tl.16's notes only exist in a throwaway temp archive used by `render public-claims`'s no-`--archive-root` fallback. This PR adds the smallest finding materialization over the landed core, per the addendum's It.13 hard boundary (no metric/pattern/cohort/ experiment definition objects, no registries, no scheduler). ## Solution `devtools/claim_vs_evidence_evidence.py`: - **AnalysisDefinition identity** — `build_query_definition()` registers the structured-failure-followup selection (predicate, classification/ sensitivity scope, `n_min`, handler-class taxonomy, a bumpable `CLASSIFIER_DEFINITION_VERSION`) as a content-addressed `QueryObject` via `put_query`. Deliberately not a DSL-executable plan — the paired next-turn/window-3 lookahead has no predicate-grammar representation — but stable provenance identity, matching the "durable identity JSON is provenance, not source syntax to reverse-compile" doctrine already stated in `convergence_standing_queries.py`. - **AnalysisRun receipt** — matched `tool_result` refs become a `ResultSetManifest` (`exactness=capped`, `persistence_class=finding`); an `EvaluationReceipt` binds the run to source/user/index tier generations and the runtime build. Both are content-addressed *including* `now_ms`, so a retried call at the same instant is a safe no-op, while a genuinely later regeneration correctly records a new run instead of colliding with the first. - **Finding rows** — the headline rate is written as an `AssertionKind.FINDING` (`finding_kind="claim-vs-evidence"`, already a registered kind) wired to the identities above. `public_claim` stays `None` unless the run's own `n_min`/classified-outcome gates are satisfied — an unpublishable run still gets an honest private evidence record, never a fabricated public rate through the existing public-claims projection. - **Privacy stamp** — reuses the existing `PublicClaimDeclaration.disclosure` field (`public` only when publishable, otherwise no declaration at all) rather than inventing new privacy/retention machinery; `rxdo.2`'s excision/dependency-resolver layer stays explicitly out of scope. Writes go through `open_daemon_connection` — the same connection helper `polylogue/daemon/convergence_standing_queries.py` uses for its own standing-query materialization — via a new opt-in `--materialize-evidence` flag on `devtools workspace claim-vs-evidence` (off by default; report generation stays read-only unless explicitly requested). Not a bare `sqlite3.connect` against the live `user.db`, and not a generic finding registry/metric/pattern/cohort/experiment system/scheduler. ## Verification - `devtools test tests/unit/devtools/test_claim_vs_evidence_evidence.py tests/unit/devtools/test_claim_vs_evidence.py tests/unit/storage/test_public_claims_projection.py` — 23 passed. - `mypy --strict` on both touched devtools modules — clean. - `devtools verify --quick` — green. - **Live smoke test**: ran `--materialize-evidence` against the actual live archive with the daemon running concurrently (pid confirmed alive throughout, no lock contention). Registered 1 `QueryObject`, 1 `ResultSetManifest` (20 members), 2 `EvaluationReceipt`s (two runs a few seconds apart), 2 private `FINDING` assertions. `list_public_finding_inputs()` correctly returns zero rows — today's n=20 result is honestly not publishable, and the projection reflects that rather than a fabricated rate. Ref polylogue-rxdo.13 Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Codex <[email protected]> Co-authored-by: Claude Fable 5 <[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. |
|
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. |
|
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
Implements polylogue-3tl.16:
docs/public-claims.yamlstops being ahand-maintained ledger and becomes a generated projection over
AssertionKind.FINDINGrows, the canonical judgment/supersessionlifecycle (PR #2791), and a bounded evidence-integrity verdict seam for
the not-yet-landed
polylogue-37t.14evaluator.Problem
docs/public-claims.yaml(schemaexternal-claims-ledger/v2) was asecond durable claim store maintained by hand, parallel to the FINDING
assertion substrate. A claim's public status could drift from what the
judgment lifecycle actually supports, and README/launch/findings-page
copy had no single source of truth to render from.
Solution
polylogue/insights/measurement/public_claims.py:project_public_claims()computes one
PublicClaimProjectionper stable claim key fromlist_public_finding_inputs()(new read adapter instorage/finding_provenance.py), the FINDING/judgment/supersessionfacts, and an injected
EvidenceIntegrityProvider.verdict_for()seam.A missing verdict fails closed as
unresolved, neverfresh/supported. Four presets (
readme,launch,findings-page,verified-export) only filter the one already-computed projection-- status is never recomputed per surface.
polylogue/storage/sqlite/archive_tiers/user_write.py: additivePublicClaimDeclaration+source_epoch/evaluation_ref/frame_reffields on the existing
polylogue.finding.v1JSON payload. Nouser-tier schema migration -- these are new keys in an already-JSON
column.
devtools/public_claims.py(existing validator, rewritten) +new
devtools/render_public_claims.py: render/check command,registered in
generated_surfaces.py/command_catalog.py/docs_surface.py/release_readiness.py.docs/public-claims.yamlis now the generated
verified-exportcompatibility view.category.local-evidence-systemcapability statement viapolylogue/scenarios/corpus.py.private-held/unsupported evidence, verified by real negative tests
(see Verification), not just read from the packet's own claims.
Provenance and independent verification
Originated as external-agent packet
ann-05-claims-view-r01(GPT Prowave 2, snapshot
536a53efac0cbe4a2473ad379e4db49ef3fce74d,unreviewed). Verified adversarially rather than trusting its
TESTS.md:exists and no schema migration is needed for the new
FindingAssertionfields.git apply --checkagainst currentorigin/master(12+ commitsahead of the snapshot) failed on 3 of 29 files:
docs/plans/topology-target.yaml/docs/topology-status.mdhaddrifted from unrelated intervening commits (both are generated) --
regenerated with
devtools render topology-projection+render topology-statusinstead of force-applying stale content.polylogue/storage/sqlite/archive_tiers/user_write.pyconflictedon one import line added by PR feat: harden archive continuity closure #3051, landed after the packet's
snapshot. Reconciled by hand: 7 of 8 hunks applied clean via
git apply --reject, the import added manually.devtools verify public-claims --json(4claims, 9 artifacts, 3 monitored surfaces, 0 problems) and
devtools verify layering(0 violations) -- both match the packet'sown claimed output exactly, not just re-asserted from its prose.
test_archive_tiers_api_archive_debt_reads_archive_consistency("database source_debt is locked") as a pre-existing baseline
failure unrelated to its patch. Reproduced this independently on an
unrelated worktree (clean master plus an unrelated annotations
feature) to confirm it's a genuine environmental flake, not
something introduced here.
Verification
Not run: the full non-quick
devtools verify(testmon inner loop) andthe post-merge heavy CI
testsuite; per-PR CI intentionally skips it.Follow-ups intentionally deferred
polylogue-37t.14(the shared evidence-integrity evaluator) is notyet landed. This PR defines the narrow consumer interface
(
EvidenceIntegrityProvider.verdict_for) it must implement; thethree seeded findings currently render
unknown · unresolvedbecause no verdict/canonical judgment has been supplied yet -- this
is the honest default, not a placeholder bug.
README.md,docs/demos.md,docs/findings/claim-vs-evidence.md; a future tracked launch-postsource should be registered against the
launchpreset when it exists.Ref polylogue-3tl.16