Repository navigation
feat: Declare browser-capture outside the schema-inference denominator - #5223
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedNext included review available in 59 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (16)
💤 Files with no reviewable changes (4)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📜 Recent review details🧰 Additional context used🪛 ast-grep (0.45.3)devtools/schema_frontier.py[info] 115-115: use jsonify instead of json.dumps for JSON output (use-jsonify) tests/unit/schemas/test_source_inference.py[info] 605-605: use jsonify instead of json.dumps for JSON output (use-jsonify) 🔇 Additional comments (12)
📝 WalkthroughWalkthroughThe change declares browser-capture outside schema inference. Inference, frontier loading, and schema commits now reject it. Generated browser-capture packages are removed, tooling reports the exclusion, and tests verify the new boundaries. ChangesBrowser-capture inference exclusion
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant SchemaCommit
participant CommitOperator
participant SubjectRegistry
participant SchemaPackageStore
SchemaCommit->>CommitOperator: request browser-capture commit
CommitOperator->>SubjectRegistry: check inference exclusion
SubjectRegistry-->>CommitOperator: return exclusion reason
CommitOperator-->>SchemaCommit: reject with ValueError
SchemaCommit-->>SchemaPackageStore: no package written
Merge Risk: ⚪ Minimal · up to No actionable merge risk remains for this change. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 72.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 11 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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. A rabbit guards the schema gate, Comment |
browser-capture is a format this repository authors: `browser-extension/` writes it and `polylogue-browser-capture-native-host` reads it. Its shape is a decision changed together with its writer, not evidence to discover from a corpus, so no source-evidence adapter should exist for it. `source_inference.py` previously refused every browser-capture candidate at preflight with `browser_capture_adapter_unavailable` -- a reason that reads as unfinished work and produced a *non-empty* refused denominator (1,243 members in the recorded frontier). "We refused all 1,243" and "there were zero eligible" are different claims; only the second is proof of non-applicability. The declaration kernel now carries `inference_excluded_reason`, and every door into inference enforces it: - `parse_schema_source_input` / `inventory_schema_sources` / `infer_sources` raise `SchemaSubjectExcludedError` (also a `ValueError`), so no candidate can be inventoried, counted, sampled or reported eligible-then-unsupported; - the schema-source frontier refuses a declaration that gives the subject a root or a recorded baseline, so the recorded denominator is zero; - `devtools schema commit --provider browser-capture` refuses instead of writing a package; - `devtools schema frontier --list` / check report it as declared non-applicable with its reason, in text and JSON. The stale inferred package (v1, last_seen 2026-07-27, one sample) is retired: an inferred artifact for an authored format invites a "refresh" that must never happen. Its shipped replacement already exists and is now the completeness row's schema evidence -- the authored pydantic contract in `polylogue/browser_capture/models.py`, which the receiver enforces on every accepted capture. Verification: devtools test over the schema, frontier, commit-command and provider-completeness suites, 144 passed; devtools verify --quick, 21 gates ok; devtools render all --check, exit 0, no "out of sync". Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK
ecfce5b to
ef77443
Compare
…ence (#5444) ## Summary The schema commit route ran **no privacy review**, and no post-hoc gate could substitute for one — because the write itself strips the evidence. Bead: polylogue-tnqqt (AC7; bead not closed). ## Problem `operator/commit.py` persisted without any privacy review. That matters more than it sounds, because `replace_provider_packages` **strips `x-polylogue-values` as it writes**. Measured directly: committing a bundle whose `conversation_id` retains a UUID **succeeded**, and the persisted element was `{"type": "string"}` — the value silently dropped rather than the commit refused. `gate schema-privacy` therefore inspects bytes the leak has already been removed from. The gate was never going to catch this class. ## Solution `_commit_into` runs the registered predicate on the **in-memory** bundle and raises `SchemaCommitPrivacyError` before the write. **Two wrong placements were found and discarded before landing**, reported rather than hidden: 1. A *post-persist* audit — structurally incapable of catching this class. That is the "harness more permissive than production" trap. 2. Inside `persist_generated_provider_bundle` — this grew the schema-closure ratchet **558 -> 559** and `gate schema-closure` FAILED, which would have made every future privacy-predicate edit move the archive identity. ## Verification ``` devtools verify --quick -> PASSED (gate schema-closure ok) devtools render all --check -> exit 0, grep -c "out of sync" = 0 devtools test tests/unit/schemas/test_operator_commit.py -> PASSED devtools schema closure polylogue/schemas/operator/commit.py -> out ``` Derived `index` identity `4df1149f…` is **identical at base and head** — no rebuild-ordering constraint. Anti-vacuity executed, not asserted: removing the call produced `Failed: DID NOT RAISE SchemaCommitPrivacyError`, then restored. A second test proves the check **discriminates** rather than refusing everything. A `getattr(bundle, "package_schemas", {})` was also replaced with direct attribute access — the `getattr` default would have made the check silently vacuous forever under a rename. ## The rest of the bead was already satisfied Its notes are **stale**: they cite master `da37fcf4c` (PR #4830), but packages were regenerated since by **#5215, #5219, #5223, #5357, #5411**. The committed `provider-matrix.json` at head has 12 subjects, zero blockers, zero findings. - **AC1 / AC3 / AC5 / AC6** satisfied by already-committed work: `outcome_counts` is 8 `zero_diff`, 1 `generated`, 2 `proven_non_applicable`, 1 `declared_non_applicable` = 12, matching the denominator exactly; per-subject `denominator.conserves: true`. - **AC2** satisfied — `derive_provider_denominator()` derives at call time from `SCHEMA_SUBJECTS` + `origin_specs()`, no hard-coded count. Residual: hard-coded provider sets in `synthetic/wire_formats.py:39` and `build_batch.py:665` will not follow a new subject. - **AC4** satisfied — `SubjectOutcome` includes `not_run`, and cardinality comes from the denominator, not the receipts. - **AC8** satisfied at the aggregate matrix (all six bindings); **unsatisfied at per-package metadata** (only `input_manifest_digest`). Needs an operator reading of whether the aggregate suffices. - **AC9** not attempted — owned by polylogue-rrxe4.1, downstream. ## Inherited reds, named and not fixed 10 tests in `tests/unit/schemas/test_source_cache_reuse.py` and `test_promote_cluster_privacy_config.py` fail **identically at base and at head** — same 10 nodeids in both runs. Unrelated to this bead (source-evidence cache phases and default privacy-config generation) and a large separate scope. ## Residuals - The `db_path` generation path persists inside `generate_all_schemas` with no pre-strip seam; unguarded, and stated in the commit message. - **False docstring** at `provider_denominator.py:28-31` claims a closure test exists in `test_provider_denominator.py` — it does not. - **No gate detects the committed `provider-matrix.json` going stale** against head's generator fingerprints; its recorded `code_revision a5c893c8f` is not an ancestor of master. - `schema-inference-handoff.json` records four providers as `provider_without_wire_format` because `receipt.py:392` reads the narrow `PROVIDER_WIRE_FORMATS` rather than `PROVIDER_WIRE_ROUTES`, which its own docstring calls *"the authority for catalog coverage"*, discarding the declared specific reasons. Not fixed: correcting it would change a committed receipt that cannot be regenerated without private source. No operator material in the diff; fixtures are synthetic. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ToWqpkXotr573DiQex5vcy Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Summary
browser-capture is a format this repository authors —
browser-extension/writes it and
polylogue-browser-capture-native-hostreads it. Its shape is adecision changed together with its writer, not evidence to discover from a
corpus. It should never have been a schema-inference subject.
Problem
source_inference.pyrefused every browser-capture candidate at preflight withbrowser_capture_adapter_unavailable— a reason that reads as unfinished work,and one that produced a non-empty refused denominator: 1,243 members in the
recorded frontier.
"We refused all 1,243" and "there were zero eligible" are different claims.
Only the second is proof of non-applicability. The first invites someone to
finish the adapter that should not exist.
Solution
The declaration kernel carries
inference_excluded_reason, and every door intoinference enforces it:
parse_schema_source_input,inventory_schema_sourcesandinfer_sourcesraise
SchemaSubjectExcludedError(also aValueError), so no candidate canbe inventoried, counted, sampled, or reported eligible-then-unsupported.
or a recorded baseline, so the recorded denominator is zero, not
1,243-refused.
contract;
docs/browser-capture.mdstates where the shape is owned.Only the current shape is modelled. There is no historical-schema handling for
this subject, because we control the writer.
Verification
devtools verify --quick— exit 0, 21 gates okdevtools render all --check— exit 04f281442…Landing order
This touches
polylogue/core/schema_subjects.py, which #5219 also edits(that PR adds
member_prefixes/excluded_member_prefixesfor theclaude-ai/claude-design partition). Both are in the schema closure. They must be
sequenced, not merged in parallel; whichever lands second gets rebased onto the
first.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK
Summary by CodeRabbit