Repository navigation
fix: close worker-11 source and schema review debt - #5807
Merged
Merged
Conversation
Serialize structured OTel tool results and keep unprojected span fields in evidence; census a directly configured file and refused non-regular entries, propagate lstat faults; refuse source-cut staging inside a bound root, keep dotted source IDs distinct, reclaim only marker-owned staging, and verify archive members against member bytes; bind frozen shard rows through the archive session identity and probe owned-generation emptiness without final-layout validation. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
Fold content-bearing names into an existing dynamic map and audit fields retained beside a collapsed map; canonicalize audit provider aliases; route privacy and missing-evidence refusals through the CLI ValueError boundary; pass the configured archive location from the module CLI; key parsed relation annotations by content; select sibling unions, keep the dynamic-key marker across allOf, and keep $ref sibling declarations in drift observation. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
…nerations Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
…name An lstat fault on one entry no longer aborts the whole source walk: a supported-name candidate that cannot be inspected stays in the walk so its per-file read records the failure on the cursor, and unsupported names are filtered before any lstat. Archive-member reacquisition reads each member by name, as the cut itself does, instead of refusing duplicate names the cut published; a malformed coordinate stays a cohort error rather than a mutation. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Sinity
enabled auto-merge (squash)
September 29, 2026 08:14
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. |
Sinity
disabled auto-merge
September 29, 2026 08:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lands the verified part of ChatGPT worker 11's pass over Codex review findings in
polylogue/sources(parts 7-8) andpolylogue/schemas(beads polylogue-1tyq5.96, .97, .86, .87; 71 findings). 22 fixes are kept, each with a regression test that fails on master. The other 49 are recorded below as fixed-already, stale or not reached.Problem
The kept findings reproduce on current master:
gen_ai.tool.call.resultbecomes an empty result block, and span fields outside the projected set (end time, links, trace state, flags, dropped counts) are missing fromotel_span_evidence.origin:native_idwithout the identity helper's strip, so a padded native id raisesShardRefusedError. The owned-generation emptiness probe validates the final index layout, so a generation with deferred secondary indexes reports schema skew instead of the nonempty-generation refusal.state.first,state.second) both map tostate.jsonl. Any sibling directory with the request prefix is deleted as orphaned staging. Archive-member items are checked against the whole ZIP's size and digest, so every intact archive cut is reported as mutated.inspection_bytesclaims read I/O it never measured, and an lstat fault silently drops a candidate from the production walk.XAI,GROK). A content-bearing property name beside an existing dynamic map is kept as a literal property, and the annotation audit skips named fields retained beside a collapsed map.SchemaCommitPrivacyErrorandSchemaArchiveEvidenceErrorescape the devtoolsValueErrorboundaries as tracebacks. The module schema CLI resolves the archive from the generation directory. Relation annotations are cached by object id, so an in-place edit is ignored. The drift walk drops an allOf base's union branch, loses the dynamic-keys marker across unannotated conjuncts, and discards$refsibling declarations.Solution
sources/parsers/otel_genai.py: a non-string result is serialized as sorted JSON (absent stays absent); evidence carriesunprojected_span_fields.sources/revision_backfill.py: the lookup usesidentity_law.session_id; the probe opens withvalidate_index_layout=False.sources/source_snapshot.py:execute_source_cutrefuses a destination overlapping a bound directory root (resolved paths). The SQLite export name appends.jsonl. Staging carries an owner marker naming the request; reclamation deletes only marked, non-symlink directories, and the marker is removed before publication.reacquire_candidatehashes each archive member by name from the copied ZIP, opening each ZIP once.sources/source_walk.py: the census resolves file-or-directory like_resolve_source_paths, takes supported-name entries before the regular-file filter, records walk errors, and reportscandidate_bytes(renamed and documented as entry size)._walk_source_pathskeeps a supported-name candidate whose lstat fails, so the per-file read records the failure on the cursor instead of the scan reporting it as absent; unsupported names are filtered before any lstat.schemas/audit/workflow.py: canonicalizes the provider before the subject lookup.schemas/audit/checks.py: counts named fields beside a collapsed map.schemas/generation/dynamic_keys.py: beside an existing map only individually dynamic names fold into it.schemas/operator/commit.py,schemas/sampling_db.py: both refusal types derive fromValueError.schemas/operator/schema_inference.py: passes the configuredArchiveLocation.schemas/synthetic/relation_solver_runtime.py: the cache key is a SHA-256 of the canonical JSON, parsed from that snapshot.schemas/validator.py: the allOf base selects its union branch first, a dynamic-keys marker on any conjunct survives the merge, and$refsiblings join the resolved node.Worker changes not landed:
message_parentas a derived topology capability in_otel_genai_spec, the finding's second option, so removing the parent mapping would contradict the declared contract. Recorded as fixed-already._walk_source_paths, so one vanished or unreadable entry (even an unsupported temp file) aborted the whole source scan. Replaced by keeping the candidate for the per-file failure route.reacquire_candidaterefused duplicate ZIP member names, which the cut itself publishes; it now reads by name as the cut does.Verification
agentctl job start polylogue verify_quick --workspace /realm/worktrees/salvage-w11→ job 2600 at head 152a132:verify: PASSED exit=0.agentctl job start polylogue pytest_focused --workspace /realm/worktrees/salvage-w11 -- <24 test files>→ job 2602 at head 152a132:805 passed, 3 failed. The 3 failures (test_common_live_batch_retries_a_failed_vendor_conversion,test_dynamic_key_maps_do_not_emit_drift_warnings,test_antigravity_brain_metadata_sidecar_is_rejected_from_live_and_schema_routes) fail the same way on unmodified master (job 2551). The earlier head 649039f gave807 passed, 3 failed(job 2550); 152a132 merges fix(sources): fix parser, source-walk and fingerprint review findings #5798, fix: close worker-13 MCP, surface and excision review findings #5779 and fix(security): require the owner's credential on loopback #5704, which overlap this diff only insource_walk.py(fix(sources): fix parser, source-walk and fingerprint review findings #5798's directory-link cycle guard, compatible with the lstat change),revision_backfill.pyandcommit.py(disjoint hunks).29 failed, 781 passed: all 26 new or changed regression cases for the kept findings plus the 3 master failures above. The two control parameters (padded_native_id=False,deferred_indexes=False) pass on both heads, as intended.Selection:
tests/unit/core/test_synthetic_relations.py tests/unit/devtools/test_schema_commit_command.py tests/unit/devtools/test_schema_lab_commands.py tests/unit/schemas/test_audit_declared_packages.py tests/unit/schemas/test_drift_walk_resolution.py tests/unit/schemas/test_promotion_monotonicity.py tests/unit/sources/parsers/test_otel_genai.py tests/unit/sources/parsers/test_otel_genai_contract.py tests/unit/sources/test_origin_specs.py tests/unit/sources/test_revision_backfill.py tests/unit/sources/test_source_snapshot.py tests/unit/core/test_schema_validation.py tests/unit/core/test_audit.py tests/unit/core/test_schema_laws.py tests/unit/schemas/test_historical_payload_resolution.py tests/unit/schemas/test_source_structure_witnesses.py tests/unit/sources/test_agent_memory_documents.py tests/unit/sources/test_antigravity_source_acquisition.py tests/unit/sources/test_artifact_taxonomy.py tests/unit/sources/test_source_laws.py tests/unit/sources/test_source_root_admission.py tests/unit/daemon/test_antigravity_conversation_acquisition.py tests/unit/pipeline/test_resilience.py tests/unit/pipeline/test_ingest_outcomes.pySelf-review
with_suffixon a source id occurs once insource_snapshot.py; the other export branch already appends. Staging reclamation has one caller. The session-id format in_required_shard_prepared_rowswas the only hand-builtorigin:native_idon the shard path. Both devtools schema boundaries catchValueError, so rebasing the two refusal types coversschema commit,schema generateand every other caller; no intermediateexcept ValueErroron the sampling or commit path swallows them (the drift check catchesExceptionand reports WARNING, unchanged).SourceInferenceErrorandSchemaFrontierErrorare otherRuntimeErrorrefusals; they belong to not-reached findings and are left as residuals.reacquire_candidateholds its ZIP handles in anExitStack, so an exception closes them.archive.read. The relation cache serializes the annotation list it already held in memory.inspection_bytesis renamed, not aliased; it had no production reader. A crashed staging directory without a marker is kept rather than deleted (fail closed). The overlap guard refuses rather than relocating staging.SourceRootCensus.inspection_bytesis gone; its only reader was a test, updated here. No monkeypatch target was removed.parse_payload,backfill_historical_revision_evidence,execute_source_cut/reacquire_candidate,census_source_root,_resolve_source_paths,audit_provider,merge_observed_structure_schemas/check_annotation_coverage, theschema_commit/schema_generate/schema_inferenceentry points,_RelationConstraintSolverandSchemaValidator.validate.census_source_root,reacquire_candidateandcut_source_inputshave no production caller yet (unfinished code, not obsolete); the tests exercise them directly.Derived-identity closure
These changed files are in
docs/plans/schema-closure-baseline.json, so the derived identity moves and this must land before the fresh rebuild:polylogue/schemas/generation/dynamic_keys.py,polylogue/schemas/sampling_db.py,polylogue/schemas/validator.py,polylogue/sources/parsers/otel_genai.py,polylogue/sources/revision_backfill.py,polylogue/sources/source_snapshot.py,polylogue/sources/source_walk.py. The OTel result-block text and evidence payload are hashed parser output, so OTel sessions re-derive.Per-finding dispositions
Counts: 22 fixed, 0 dropped as not real, 21 fixed-already, 2 stale, 0 refuted, 26 not reached.
Per bead: .96 4 fixed / 7 fixed-already / 1 stale / 13 not reached. .97 8 / 0 / 1 / 4. .86 7 / 12 / 0 / 6. .87 3 / 2 / 0 / 3.
polylogue/sources/parsers/local_agent.py:236polylogue/sources/parsers/otel_genai.py:250_otel_genai_specin polylogue/sources/origin_specs.py now declaresmessage_parentas a derived topology capability (span.parentSpanId -> parent span output:0), the finding's second option; the parent mapping and the capability contract agreepolylogue/sources/parsers/otel_genai.py:297_messages_for_span: a non-string decoded result is serialized as sorted JSON; an absent attribute stays absentpolylogue/sources/parsers/otel_genai.py:389_span_evidence_event: every span field outside the projected set is kept underunprojected_span_fieldspolylogue/sources/prepared_jsonl.py:556polylogue/sources/prepared_jsonl.py:649polylogue/sources/prepared_message_sink.py:539polylogue/sources/retained_assembly.py:236polylogue/sources/revision_backfill.py:905polylogue/sources/revision_backfill.py:941polylogue/sources/revision_backfill.py:1626polylogue/sources/revision_backfill.py:1626polylogue/sources/revision_backfill.py:2352polylogue/sources/revision_backfill.py:2402_required_shard_prepared_rows: keys the lookup throughidentity_law.session_id, the helperprepare_session_shardusespolylogue/sources/revision_backfill.py:2530_owned_generation_is_empty: the read-only probe opens withvalidate_index_layout=Falsepolylogue/sources/revision_backfill.py:2752polylogue/sources/revision_backfill.py:2842polylogue/sources/revision_backfill.py:2921polylogue/sources/revision_backfill.py:3028polylogue/sources/revision_backfill.py:3279polylogue/sources/revision_backfill.py:3710polylogue/sources/source_acquisition_components.py:370polylogue/sources/source_acquisition_components.py:516polylogue/sources/source_parsing.py:49polylogue/sources/source_parsing.py:303parse_sources_archivewere removed by #5787 (mutations route through the daemon); no API sequential writer assigns a generic raw IDpolylogue/sources/source_parsing.py:452polylogue/sources/source_parsing.py:455polylogue/sources/source_parsing.py:455parse_sources_archive) that skipped the evidence gate was removed by #5787polylogue/sources/source_root_admission.py:58polylogue/sources/source_snapshot.py:866execute_source_cut: refuses a destination whose staging parent is inside, or which contains, a bound directory root (resolved, so aliases count)polylogue/sources/source_snapshot.py:917execute_source_cut: appends.jsonlto the full source id instead of replacing its suffixpolylogue/sources/source_snapshot.py:969_reclaim_orphaned_stagingdeletes only marked, non-symlink directories; the marker is removed before publicationpolylogue/sources/source_snapshot.py:992reacquire_candidate: archive-member items are verified against the member bytes read by name from the copied ZIPpolylogue/sources/source_walk.py:54census_source_root: a directly configured file is the one candidate, as in_resolve_source_pathspolylogue/sources/source_walk.py:60candidate_bytesand documented as candidate entry size, not read I/O (the finding's second option)polylogue/sources/source_walk.py:149census_source_root: supported-name entries are taken before the regular-file filter; links and FIFOs count as unsupportedpolylogue/sources/source_walk.py:151_walk_source_paths: an uninspectable supported-name candidate stays in the walk so its per-file read records the failure on the cursor; the census records it as unexplainedpolylogue/sources/sqlite_snapshot.py:344polylogue/schemas/audit/workflow.py:59_package_not_required_reason: canonicalizes the provider token before the subject lookuppolylogue/schemas/generation/dynamic_keys.py:27polylogue/schemas/generation/dynamic_keys.py:194_merge_observed_structure_pair: beside an existing map only individually dynamic names fold into it; static names staypolylogue/schemas/generation/dynamic_keys.py:195check_annotation_coverage: named fields retained beside a collapsed map are still countedpolylogue/schemas/generation/workflow.py:119polylogue/schemas/generation/workflow.py:185polylogue/schemas/generation/workflow.py:185polylogue/schemas/operator/commit.py:62SchemaCommitPrivacyErrorderives fromValueError, the command boundary's refusal typepolylogue/schemas/package_publication.py:46polylogue/schemas/packages.py:106polylogue/schemas/runtime_registry.py:764polylogue/schemas/runtime_registry.py:776polylogue/schemas/runtime_registry.py:816polylogue/schemas/sampling_db.py:66cli_main: passesArchiveLocation.resolve(config.archive_root)polylogue/schemas/sampling_db.py:318SchemaArchiveEvidenceErrorderives fromValueErrorpolylogue/schemas/source_inference.py:559polylogue/schemas/source_inference.py:612polylogue/schemas/source_inference.py:640polylogue/schemas/source_inference.py:763polylogue/schemas/source_inference.py:1267polylogue/schemas/source_inference.py:1273polylogue/schemas/source_inference.py:1298polylogue/schemas/source_inference.py:1301polylogue/schemas/source_inference.py:1334polylogue/schemas/synthetic/relation_solver_runtime.py:80_parsed_annotations: keyed by a SHA-256 of the canonical JSON and parsed from that snapshotpolylogue/schemas/validator.py:110_schema_branch_for_value: the allOf base selects its own union branch before mergingpolylogue/schemas/validator.py:114_schema_branch_for_value: an explicit dynamic-keys marker on any conjunct survives the allOf mergepolylogue/schemas/validator.py:116polylogue/schemas/validator.py:125_resolve_local_ref:$refsibling declarations join the resolved observation nodepolylogue/schemas/validator.py:307polylogue/schemas/validator.py:344polylogue/schemas/validator.py:368polylogue/schemas/validator.py:368Residuals
omitted_current_structure_witness_countinschemas/packages.py. Whether committed packages still need that read is a separate cleanup.🤖 Generated with Claude Code
https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg