Skip to content

fix(security): require the owner's credential on loopback - #5704

Merged
Sinity merged 25 commits into
masterfrom
claude/bugsweep-sec
Sep 29, 2026
Merged

Sinity merged 25 commits into
masterfrom
claude/bugsweep-sec

Conversation

@Sinity

@Sinity Sinity commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Closes the fail-open security findings from the bug sweep: n3xdn, qut1/l6v61, dahse, dzk48, 8k10u, mdlft.

Problem

  • n3xdn: shell HTML (/, /sessions, /s/:id, /search, /w, /p, /a, assets) was served to any loopback client without a credential, and POST /api/web-auth/session minted a first-party cookie for any loopback request. Any local uid could read every archived transcript even with a bearer token configured.
  • qut1/l6v61: page scripts share the content script's realm; they could trigger captures with synthetic clicks and supply the identity a MAIN-world capture woke.
  • dahse: the Antigravity export reserved a port, released it, and handed it to the vendor server (a TOCTOU), and the server's loopback API took no credential.
  • dzk48: the agent-integration installer wrote native client configs before recording ownership; a crash in between left uninstall reporting a false clean.
  • 8k10u: the live-provider proof restored the operator's receiver settings only on its normal exit path, not on cancellation.
  • mdlft: schema commit could publish a package the promotion audit never saw, and the audit only inspected x-polylogue-values, not keys nested under other annotations.

Solution

  • Owner credential on loopback. With a token configured, shell HTML and web-credential bootstrap need the daemon bearer, a one-time sign-in ticket, or a valid cookie being rotated. POST /api/web-auth/ticket (bearer-only) mints a 60 s single-use ticket; the CLI's open paths pass it in the URL fragment, and an uncredentialed browser gets a sign-in page with no archive data. --api-allow-no-auth stays the explicit open opt-out.
  • Extension. Badge and ambient-surface controls act only on event.isTrusted; a MAIN-world capture may wake a freshness capture only for the conversation the tab URL names.
  • Antigravity. The vendor server picks its own port (-http_server_port=0), a per-run -csrf_token is sent on every request (the server answers 401 without it), and the port is read only from the discovery file naming our child's pid. Store discovery streams /nix/store once and finds the current lib/antigravity-ide layout.
  • Installer. A dry-run plan (conflicts raise before any write) is recorded as prepared operations before anything is applied; uninstall removes a present prepared effect and treats an absent one as never applied.
  • Proof. Dropped on rebase: fix: resolve confirmed Codex P1 findings on merged PRs (batch 1) #5683 already landed the same SIGTERM/SIGINT receiver restore on master (pendingReceiverRestore), so this PR keeps master's version and no longer carries its own copy or test.
  • Schema commit. Both routes run the promotion audit on the tree they wrote and restore the prior tree on a blocker; the audit now holds keys and strings under every x-polylogue-* annotation to the property-name and identifier bar, redacting offending keys even in paths. The committed provider tree audits clean.

Review rounds

  • Installer: removals are journaled beside prepared operations, and status() reports an interrupted install as blocking.
  • Schema commit: generation runs outside the tree lock. A refused publication rolls back by atomic exchange. A secret used as an annotation key is redacted before the finding path is built.
  • Antigravity: a discovery file must be newer than the launch.
  • Sign-in: tickets go through a /web-auth/sign-in exchange page that always clears the fragment. The ticket route has a typed OpenAPI operation. ChatGPT temporary-chat freshness hints are admitted by the temporary-payload predicate.
  • Refuted: moving the Antigravity CSRF token off argv. The vendor server accepts it only as -csrf_token, with no flagfile or other transport.

Verification

  • devtools test over the affected daemon, route-contract, openapi, web-auth, web-reader auth, installer, schema-commit, antigravity and CLI sign-in files: devtools test: PASSED (receipt 20260928T000719Z-focused-test-724806-aff04b59, after fixing 41 expectation failures from the first run).
  • Browser extension: vitest run 23 files, 415 passed.
  • devtools render all --check: no surface out of sync.
  • python -m polylogue.schemas.promotion_audit polylogue/schemas/providers: 0 blockers.
  • devtools schema closure: only polylogue/sources/parsers/antigravity.py is IN; this must land before the fresh build.

Residuals

  • The Antigravity CSRF token is visible in /proc/<pid>/cmdline to other local uids (no hidepid on this host; the vendor binary has no flag-file or env option).
  • MAIN-world capture content remains forgeable by XSS on an allowed origin (qut1's accepted property); temporary chats no longer receive MAIN-world freshness wakes.
  • The Playwright web-auth spec was updated for ticket sign-in but not run here (not part of CI).

Self-review

I reviewed the complete diff at the final head: fifteen commits across the security family, re-read against the code.

Loopback is not an authority (n3xdn)

  • With a token configured, shell HTML and the web-credential bootstrap require one of: the bearer, a one-time sign-in ticket, or a cookie bound to the peer uid.
  • Tickets are single-use and expire after 60 s. They are exchanged on a dedicated page and never appear in argv or a URL query (the CLI passes them in the fragment).
  • Peer identity is read from the accepted socket, once, and IPv6 peers are handled. The sign-in exchange bypasses proxies. --api-allow-no-auth is the explicit opt-out.

Page scripts cannot drive the extension (qut1/l6v61): controls act only on event.isTrusted, and a MAIN-world capture takes no identity from the page.

Antigravity language server (dahse)

  • The port is not reserved and then released. The child's own discovery file names its port.
  • Discovery accepts only files that are new or changed relative to a snapshot taken before launch (inode, mtime, ctime, size). This does not depend on timestamp resolution.
  • The RPCs carry the server's credential and bypass proxies. There is no discovery deadline while the child lives, and a failed start stops the child.

Installer ownership (dzk48)

  • Ownership is journalled before any native file is written.
  • Uninstall journals every planned removal before deleting, so a kill at any point converges on rerun.
  • Replaced clients are journalled, and rollback is atomic.

Schema publication (mdlft): schema commit publishes only the tree the promotion audit inspected. The exchange is atomic (renameat2, or renamex_np where that is absent), and the audit inspects annotations at any depth.

Verification (merge of origin/master 1beb2e5 at 1806d10; the only conflict was polylogue/cli/read_views/standard.py, where master deleted run_read_browser; resolved to master's version, and both remaining browser-open sites use signed_in_web_url):

  • agentctl job start polylogue verify_quick (job 2459): succeeded, 12 gates passed.
  • agentctl job start polylogue pytest_focused -- <installer, web_sign_in, daemon_http_security, route_contracts, web_auth, web_reader, render_openapi, schema_commit_audit_gate, antigravity_language_server, query_exec_laws> (job 2460): 1055 passed, 2 flaky (daemon-startup timeouts that passed alone), 5 failed. The same 5 fail identically on clean origin/master 1beb2e5 (job 2522): TestNoTokenLogging::test_no_token_in_log_or_print_calls (polylogue-rb7tx), three test_async_execute_query_archive_* in test_query_exec_laws.py, and test_archive_filter_kwargs_cover_every_storage_lowerable_spec_field.
  • Browser extension vitest run was not rerun after the merge: job 2564 sat in the bulk queue past the merge and was cancelled. The pre-merge run (415 passed) predates master's extension changes.

Residuals: 8k10u (the live-provider proof restoring receiver settings on cancellation) is tracked in its bead and is not in this diff.

🤖 Generated with Claude Code

https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T01:33:57.656755Z 33bced3 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bca496abfd

ℹ️ 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".

Comment thread polylogue/schemas/promotion_audit.py Resolved
Comment thread polylogue/schemas/operator/commit.py Resolved
Comment thread polylogue/daemon/http.py Resolved
Comment thread devtools/render_openapi.py Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a72641416c

ℹ️ 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".

Comment thread polylogue/schemas/operator/commit.py Resolved
Comment thread polylogue/schemas/promotion_audit.py Resolved
Comment thread polylogue/schemas/operator/commit.py Resolved
Sinity added a commit that referenced this pull request Sep 28, 2026
)

## Summary
The layering gate no longer rewrites tracked baselines during a run.
Stale layering and SQLite-degradation baseline entries become blocking
findings that name the fix command, `devtools gate layering
--prune-baselines`, the only route that writes.

## Problem
When a baseline entry no longer reproduced, the gate pruned
`docs/plans/layering-surface-baseline.json` and
`docs/plans/sqlite-degradation-baseline.json` in place. `devtools
verify` compares the Git-visible content before and after the run, saw
the change, and voided the result as `checkout_moved_during_run`. Every
branch carrying a stale entry therefore failed the hosted quick gate
with no code fault (bead polylogue-hzyyv). Reproduced locally on #5704's
head: `verify --quick` ended `checkout_moved_during_run`, with only
those two baselines modified.

## Solution
- `devtools/verify_layering.py`: new `--prune-baselines` flag. Without
it, stale entries are `layering_baseline_stale` /
`sqlite_degradation_baseline_stale` violations and nothing is written.
The ratchet property is kept: a fixed violation's exemption cannot
survive, because the gate fails until the shrink is committed.
- Tests updated to pass the flag where they exercised pruning, plus a
test that the plain gate leaves the baseline byte-identical.

## Verification
- `devtools gate layering` on master: passed, working tree unchanged.
- `devtools test tests/unit/devtools/test_layering_gates.py`: one
failure in the new test (an over-strict set assertion), fixed; rerun of
that test: PASSED.

## Residuals
Branches whose base predates #5698 now fail visibly with
`layering_baseline_stale` instead of a voided run; rebasing onto master
clears it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
@Sinity
Sinity force-pushed the claude/bugsweep-sec branch from a726414 to 78d4058 Compare September 28, 2026 08:07

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 78d4058145

ℹ️ 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".

Comment thread polylogue/cli/shared/web_sign_in.py Resolved
Sinity and others added 4 commits September 28, 2026 10:34
…ail-open paths

Loopback is not identity: shell HTML and web-credential bootstrap now need
the daemon bearer, a one-time CLI sign-in ticket, or a valid cookie
(n3xdn). Extension controls act only on trusted gestures and MAIN-world
wakes are bound to the tab's own conversation (qut1/l6v61). The
Antigravity export lets the vendor pick its port and requires a per-run
CSRF token (dahse). The installer records intended operations before
applying them (dzk48). The live-provider proof restores receiver settings
on cancellation (8k10u). Schema commit runs the promotion audit on what it
wrote and the audit covers nested annotations (mdlft).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
Annotation values get the same entropy predicate as enum values, with
field-name positions held to the property-name bar. Schema commit holds
the exclusive provider-tree lock across snapshot, write, audit and
rollback. Replacing clients and upgrades that reuse an operation identity
reconcile prepared records the same way uninstall does. A bookmark or
typed-URL navigation with a valid cookie reads the shell. OpenAPI declares
the bootstrap 401.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
- Installer: an install journals the operations it will remove beside
  the prepared ones, so a kill after an obsolete effect is deleted but
  before the final record converges on the next install instead of
  retaining the committed record as drift. status() reports a client
  with journaled, uncommitted work as interrupted and blocking.
- Schema commit: generation runs outside the exclusive tree lock; only
  the audited publication holds it (generate_all_schemas takes a
  persist hook). A refused publication is rolled back by atomic
  exchange with a same-filesystem snapshot, or by renaming a first
  publication out of the provider name, so readers never see a
  missing or partial tree.
- Promotion audit: a secret used as an annotation key is recognised
  before the finding path is built, so the path carries its redaction.
- Antigravity: a discovery file is accepted only if written at or
  after this launch, so a crashed server's file naming a reused pid
  cannot pin the client to a stale port.
- test_installer: replace a stale type-ignore with a typed cast.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01P8nGdByCWAzpk78ko2xza6
…route

- The CLI opens /web-auth/sign-in?next=<path>#polylogue-ticket=..., an
  exchange page served whether or not the browser already holds a
  credential. It always consumes and clears the fragment, then continues
  to a same-origin path. Before this, a credentialed browser got archive
  HTML that never read the fragment, so the unspent ticket stayed in the
  address bar and history.
- OpenAPI gains a hand-authored POST /api/web-auth/ticket operation: 201
  WebSignInTicketPayload, 401 and 403 typed errors, bearer security. The
  generated WebUI client is re-rendered to match.
- ChatGPT content script: a temporary-chat page, whose URL names no
  conversation, admits a native freshness hint when the payload
  declares itself temporary. This is the same predicate
  parseNativeCapture uses, so later temporary-chat turns can still wake
  a recapture.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01P8nGdByCWAzpk78ko2xza6
@Sinity
Sinity force-pushed the claude/bugsweep-sec branch from 78d4058 to 22a9b30 Compare September 28, 2026 08:36

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 22a9b30244

ℹ️ 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".

Comment thread polylogue/cli/shared/web_sign_in.py Resolved
Comment thread polylogue/daemon/http.py Resolved
Comment thread polylogue/schemas/operator/commit.py Resolved
Sinity and others added 2 commits September 28, 2026 16:26
… uid, publish audited schema trees atomically

- The one-time sign-in ticket is no longer handed to webbrowser.open() in
  the URL: on Linux that puts the full URL, including the ticket, in the
  spawned browser/xdg-open process's argv, readable by another local uid
  via /proc/<pid>/cmdline during the ticket's 60s lifetime. It is now
  written into an owner-only (mode 0600) local redirect HTML file, whose
  file:// URL carries only a filesystem path in argv; the redirect page's
  own JS performs the ticketed navigation.
- The web-credential cookie has no port scoping (RFC 6265 cookies never
  do), so a browser visiting another local uid's service on a different
  loopback port also attaches this cookie to that request; that uid's
  process can then replay it here with forged Host/Origin/Sec-Fetch-Site
  headers, none of which a raw client is bound to honor. The cookie is now
  additionally gated on the kernel's own /proc/net/tcp record of which uid
  owns the connecting socket, which nothing sent over the connection can
  forge.
- schema commit's audited-publish path used to write the generated tree
  directly to the live provider directory and audit it there; a kill
  between that write and the audit completing left the unaudited tree (a
  package that could carry a promotion blocker, including retained
  private material) as the tree subsequent reads see. It now renders into
  a same-filesystem staging directory, audits that staging tree, and
  publishes only on a pass via publish_provider_tree's atomic exchange, so
  the live tree only ever moves directly between two audited states.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
@Sinity

Sinity commented Sep 28, 2026

Copy link
Copy Markdown
Owner Author

Fixed all three findings in 0ccdbe4:

  • Sign-in ticket no longer reaches webbrowser.open()'s argv: it's written to an owner-only (mode 0600) local redirect HTML file whose file:// path is opened instead, with the ticketed navigation happening client-side.
  • The web-credential cookie is now additionally gated on /proc/net/tcp's own record of which uid owns the connecting socket (_peer_is_owner/_tcp_socket_owner_uid), closing the cross-port replay since Host/Origin/Sec-Fetch-Site are all forgeable by a raw client but the kernel's connection-table uid is not.
  • schema commit now renders into a same-filesystem staging directory, audits that tree, and publishes only on a pass via publish_provider_tree's atomic exchange — the live provider tree never observes an unaudited write.

Focused tests (web_sign_in, web_auth, daemon_http_security, daemon_events_endpoint, user_overlay_route_family, schema_commit_audit_gate) pass.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0ccdbe4b77

ℹ️ 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".

Comment thread polylogue/daemon/http.py Resolved
Comment thread polylogue/cli/shared/web_sign_in.py Resolved
Comment thread polylogue/schemas/operator/commit.py Resolved
Sinity and others added 2 commits September 28, 2026 17:23
Matches the existing pattern at _client_host: self.client_address's
inferred type already excludes non-tuple, so isinstance narrowing needs
an explicit object-typed local to stay meaningful to mypy instead of
being flagged as a redundant-expr on the "or".

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
Hosts without procfs decide web-cookie peer ownership through lsof, so
the WebUI works on macOS. The CLI waits for the sign-in ticket instead
of downgrading to an unsigned URL at a deadline. Schema commit staging
starts from the live provider tree so historical packages carry
forward. A drifted prepared-only installer operation that is no longer
requested is retained as drift instead of dropped untracked.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fa816c6621

ℹ️ 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".

Comment thread polylogue/daemon/http.py Resolved
Comment thread polylogue/daemon/http.py Resolved
Comment thread polylogue/daemon/http.py Resolved
Sinity added a commit that referenced this pull request Sep 28, 2026
## Summary

Second pass over P1 Codex review findings left open on PRs merged
2026-08-20..09-27 (tracked in polylogue-1tyq5). It fixes 17 findings
that still cite live code at `e20f6f5a3`.

## Problem

Several read and exit paths decided their outcome from the wrong facts:

- a search page reported `ok` over zero returned rows because it used
the query total;
- `stats` reported complete totals while the archive was still
converging;
- facets and judge listings exited 0 on empty or degraded outcomes;
- a missing daemon exited with an ad hoc 2, which is the `empty` code.

Other findings covered stale connection reuse, swallowed failures, and a
rate-limit misclassification:

- FTS bulk repair skipped unchanged sessions that were missing FTS rows.
- Thread-title reads treated any SQLite error as an absent table.
- Deferred insight invalidation reused a cached connection after the
index path was repointed.
- An unreadable ops ledger fell back to a legacy index answer.
- The browser extension treated a shared provider cooldown as a
transport failure.

## Solution

- **Search:** outcome from `len(hits)`; filter-only structured specs
list sessions; fallback ranks are absolute across offsets.
- **Stats:** outcome is `degraded` (`archive_not_converged`) while the
convergence warning applies.
- **Exits:** stats, facets, judge listings (including interactive) and
daemon-absence exit through `OUTCOME_EXIT_CODES` /
`FAILED_READ_EXIT_CODE`. Machine errors may carry an `outcome` document;
the schema is regenerated.
- **FTS repair:** targets changed sessions plus sessions missing FTS.
- **Thread titles:** absence is a table-presence check; every read error
propagates.
- **Insight invalidation:** opens a fresh connection on each delivery.
- **Preamble:** writer-ownership refusal is treated as unavailable
context.
- **Cursor lag:** an unreadable ops ledger is reported as unavailable.
- **Hook producer:** the carrier lock is an explicit `fcntl.flock` pair.
- **Browser extension:** a shared cooldown takes the rate-limit route. A
resolved rate-limited failure records the cooldown, using the default
delay when there is no Retry-After.

## Disposition summary (second pass, 748 findings)

| Class | Count |
|---|---|
| BEAD | 347 |
| ROUTED | 248 |
| OBSOLETE | 92 |
| FIXED-LATER | 36 |
| FIXED | 17 |
| INVALID | 5 |
| OBSOLETE-FRESHV1 | 3 |

- **BEAD:** filed as 39 grouped child beads, `polylogue-1tyq5.1`–`.39`,
each listing its findings.
- **ROUTED:** the open PR that owns those lines.

## Verification

- Final head `dc8f0c84d` (rebased on master): `devtools test` over the
17 changed or affected test files → `devtools test: PASSED exit=0` with
348 passed and no reruns. The files are the FTS repair, thread state,
search builder/contract/cursor, write effects, machine main, exit codes,
judge, display label, output schemas, cursor lag, embedding progress,
hook producer, terminal outcomes, operation audit, and JSON output
tests.
- After the last review round (typed outcome, seeded-search exclusion,
receipt withdrawal): `devtools test` over output schemas, search
builder, machine main, embedding progress, operation audit and terminal
outcomes → `devtools test: PASSED exit=0`.
- Browser extension (vitest): background, backfill and browser_action →
180 passed. The new bare-429 test fails when the old null-delay guard is
restored.
- `mypy` on the changed production and test files: no issues.
- Two tests are red from before this PR and not fixed here:
-
`test_convergence_surface_contract.py::test_converging_archive_surfaces_share_materialization_counts`
fails with `KeyError: 'raw_materialization'` at its `status` step.
-
`test_preamble.py::test_declared_claim_survives_judgment_preamble_and_reboot_ref`
now needs a daemon for `judge_assertion_candidate`.

The embedding config stub was missing `sinex_mode`; that is fixed
forward here.

## Residuals

- F090 (failed embedding backfill replays as `indeterminate`): the
partial fix was withdrawn after review. A truthful failed receipt needs
the result contract, the lifecycle outcome and a bounded error changed
together, and is recorded on polylogue-1tyq5.15.
- Hosted quick gate: every gate reports `ok`, but the run is voided with
`checkout_moved_during_run` in CI. This also happens on #5704, another
PR that touches `browser-extension/`, while #5703 without extension
changes passes. It is inherited and not caused by this diff.

- Schema-identity closure: `surfaces/payloads.py`,
`archive/write_effects.py`, `storage/sqlite/agent_thread_state.py` and
`sources/hook_producer.py` are IN the derived closure (`devtools schema
closure`). Landing this moves the derived identity, so it must land
before a fresh rebuild starts, not during one.
- Two inherited red tests above are not fixed here.

- 347 findings remain as beads, not fixes. Six P1 groups carry
high-severity items: work events, ingest integrity, parsers,
single-writer residue, destructive operations, and raw authority.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e2d6dbc9bf

ℹ️ 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".

Comment thread polylogue/daemon/peer_identity.py Resolved
Comment thread polylogue/daemon/http.py Resolved
Comment thread polylogue/schemas/operator/commit.py Resolved
Comment thread polylogue/cli/shared/web_sign_in.py Resolved
Comment thread polylogue/cli/shared/web_sign_in.py Resolved
Sinity added a commit that referenced this pull request Sep 28, 2026
## Summary

The patterns gate trusts an exemption that any parent of `HEAD` already
carried, so a PR whose tip merges `master` no longer fails for
`master`'s own baseline additions.

## Problem

`_trusted_baseline` read the committed baseline from `HEAD^` only. On a
PR whose head is a merge of `master`, `HEAD^` is the PR's previous tip,
so every exemption `master` added since the PR last merged it counts as
growth. The quick-gate of #5739 (a one-line hook change merged with
`master` at f2562c3) failed with `patterns: committed baseline grew`
over dozens of `master`'s own entries (`diagnosis=gate_input_error`);
#5643, #5696 and #5704 fail the same way.

## Solution

Read the baseline at every parent (`git rev-parse HEAD^@`) and trust
each entry at the largest count any parent carried. A merge resolution
that adds an entry present in neither parent is still growth.

## Verification

`devtools test tests/unit/devtools/test_verify_patterns.py` on a
checkout of origin/master 82e84ec with this change: 9 passed, 1
failed. The new
`test_merging_the_base_branch_does_not_count_its_exemptions_as_growth`
passes; it fails with first-parent-only trust. The failing
`test_displacing_a_baselined_match_does_not_trip_the_gate` fails the
same way on unpatched master (IndentationError in its synthetic file)
and is recorded in polylogue-rb7tx.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b47d374d31

ℹ️ 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".

Comment thread polylogue/schemas/operator/commit.py Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fbce6f2606

ℹ️ 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".

Comment thread polylogue/schemas/promotion_audit.py Resolved
Comment thread polylogue/daemon/http.py Resolved
Sinity and others added 2 commits September 29, 2026 02:12
…timestamps, document shell auth

Antigravity language-server RPCs carry the CSRF token and now bypass any
environment proxy. A well-formed x-polylogue-generated-at timestamp no longer
blocks schema commit. The daemon and security docs describe the credentialed
shell and its sign-in flow.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ea56562c54

ℹ️ 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".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 33bced3807

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

# Conflicts:
#	polylogue/cli/read_views/standard.py
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@Sinity
Sinity merged commit 054cdb6 into master Sep 29, 2026
2 of 3 checks passed
@Sinity
Sinity deleted the claude/bugsweep-sec branch September 29, 2026 08:13
Sinity added a commit that referenced this pull request Sep 29, 2026
## Summary

Lands the verified part of ChatGPT worker 11's pass over Codex review
findings in `polylogue/sources` (parts 7-8) and `polylogue/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:

- OTel GenAI: a structured, numeric or boolean `gen_ai.tool.call.result`
becomes an empty result block, and span fields outside the projected set
(end time, links, trace state, flags, dropped counts) are missing from
`otel_span_evidence`.
- Revision backfill: the frozen-shard lookup hand-formats
`origin:native_id` without the identity helper's strip, so a padded
native id raises `ShardRefusedError`. 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.
- Source cut: staging can be created inside a bound source root. Two
SQLite ids sharing a stem (`state.first`, `state.second`) both map to
`state.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.
- Source census: a directly configured file counts as zero candidates,
symlinks and FIFOs drop out of the denominator, `inspection_bytes`
claims read I/O it never measured, and an lstat fault silently drops a
candidate from the production walk.
- Schemas: the audit's package exemption misses provider aliases (`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. `SchemaCommitPrivacyError` and
`SchemaArchiveEvidenceError` escape the devtools `ValueError` boundaries
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 `$ref` sibling declarations.

## Solution

- `sources/parsers/otel_genai.py`: a non-string result is serialized as
sorted JSON (absent stays absent); evidence carries
`unprojected_span_fields`.
- `sources/revision_backfill.py`: the lookup uses
`identity_law.session_id`; the probe opens with
`validate_index_layout=False`.
- `sources/source_snapshot.py`: `execute_source_cut` refuses 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_candidate` hashes 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 reports `candidate_bytes`
(renamed and documented as entry size). `_walk_source_paths` keeps 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 from `ValueError`.
- `schemas/operator/schema_inference.py`: passes the configured
`ArchiveLocation`.
- `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 `$ref`
siblings join the resolved node.

Worker changes not landed:

- 96.02 (OTel parent edges): master now declares OTel `message_parent`
as 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.
- The worker's lstat fix propagated the error out of
`_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.
- The worker's `reacquire_candidate` refused 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 gave `807 passed, 3 failed` (job 2550); 152a132 merges
#5798, #5779 and #5704, which overlap this diff only in `source_walk.py`
(#5798's directory-link cycle guard, compatible with the lstat change),
`revision_backfill.py` and `commit.py` (disjoint hunks).
- Proof that the tests fail without the fixes: the branch's test files
copied onto unmodified master 1beb2e5 and run with the same selection
as job 2551: `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.py`

## Self-review

- **Sibling sites.** `with_suffix` on a source id occurs once in
`source_snapshot.py`; the other export branch already appends. Staging
reclamation has one caller. The session-id format in
`_required_shard_prepared_rows` was the only hand-built
`origin:native_id` on the shard path. Both devtools schema boundaries
catch `ValueError`, so rebasing the two refusal types covers `schema
commit`, `schema generate` and every other caller; no intermediate
`except ValueError` on the sampling or commit path swallows them (the
drift check catches `Exception` and reports WARNING, unchanged).
`SourceInferenceError` and `SchemaFrontierError` are other
`RuntimeError` refusals; they belong to not-reached findings and are
left as residuals.
- **Cancellation and shutdown in loops.** No new loop waits or sleeps.
`reacquire_candidate` holds its ZIP handles in an `ExitStack`, so an
exception closes them.
- **Unbounded reads.** Member verification streams in 1 MiB chunks
rather than `archive.read`. The relation cache serializes the annotation
list it already held in memory.
- **Fail-open fallbacks and compatibility shims.** None added.
`inspection_bytes` is 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.
- **Removed symbols.** `SourceRootCensus.inspection_bytes` is gone; its
only reader was a test, updated here. No monkeypatch target was removed.
- **Tests prove the production route.** The tests drive `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`, the
`schema_commit`/`schema_generate`/`schema_inference` entry points,
`_RelationConstraintSolver` and `SchemaValidator.validate`.
`census_source_root`, `reacquire_candidate` and `cut_source_inputs` have
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.

| key | disposition | evidence | test |
|---|---|---|---|
| 96.01 #4724 `polylogue/sources/parsers/local_agent.py:236` |
fixed-already | polylogue/sources/parsers/local_agent.py:564-565
(displayContent is extracted before the empty-message guard.) | - |
| 96.02 #5530 `polylogue/sources/parsers/otel_genai.py:250` |
fixed-already | worker fix rejected: `_otel_genai_spec` in
polylogue/sources/origin_specs.py now declares `message_parent` as a
derived topology capability (span.parentSpanId -> parent span output:0),
the finding's second option; the parent mapping and the capability
contract agree | - |
| 96.03 #5530 `polylogue/sources/parsers/otel_genai.py:297` | fixed |
polylogue/sources/parsers/otel_genai.py `_messages_for_span`: a
non-string decoded result is serialized as sorted JSON; an absent
attribute stays absent |
tests/unit/sources/parsers/test_otel_genai.py::test_dispatch_preserves_structured_tool_results
|
| 96.04 #5530 `polylogue/sources/parsers/otel_genai.py:389` | fixed |
polylogue/sources/parsers/otel_genai.py `_span_evidence_event`: every
span field outside the projected set is kept under
`unprojected_span_fields` |
tests/unit/sources/parsers/test_otel_genai.py::test_dispatch_retains_unprojected_span_fields_in_evidence
|
| 96.05 #5584 `polylogue/sources/prepared_jsonl.py:556` | not reached |
polylogue/sources/prepared_jsonl.py:734 (Numeric native IDs remain
excluded from metadata capture. The f95 carrier file differs from the
upload; no partial metadata edit is supplied.) | - |
| 96.06 #5610 `polylogue/sources/prepared_jsonl.py:649` | not reached |
polylogue/sources/prepared_jsonl.py:650 (Per-Grok-session scratch rows
still allocate pages in the shared sealed preparation database. A real
scratch-lifetime/store separation remains, not a VACUUM workaround.) | -
|
| 96.07 #5610 `polylogue/sources/prepared_message_sink.py:539` | not
reached | polylogue/sources/prepared_message_sink.py:1205-1209 (The
streaming ChatGPT mapping reader still presents a leading UTF-8 BOM to
ijson. No reader/fixture change is supplied.) | - |
| 96.08 #4969 `polylogue/sources/retained_assembly.py:236` | not reached
| polylogue/sources/retained_assembly.py:230-236 (Windows sidecar
coordinates still use host-dependent Path handling. Cross-platform
coordinate parsing remains.) | - |
| 96.09 #5548 `polylogue/sources/revision_backfill.py:905` | not reached
| polylogue/sources/revision_backfill.py:4442-4551 (Retryable
preparation/infrastructure exceptions are still converted into semantic
census failure text. The complete worker-to-controller failure route is
not changed.) | - |
| 96.10 #5548 `polylogue/sources/revision_backfill.py:941` | not reached
| polylogue/sources/revision_backfill.py:1332-1357 (Prepared authority
promotion still needs the coherent membership-outcome update, including
previously observed authority. No half-update is supplied.) | - |
| 96.11 #4993 `polylogue/sources/revision_backfill.py:1626` | not
reached | polylogue/sources/revision_backfill.py:2326-2414;3396-3408
(Frozen evidence still constructs prepared-session shards inline on the
controller path. Worker preparation/transport ownership remains.) | - |
| 96.12 #4993 `polylogue/sources/revision_backfill.py:1626` | not
reached | polylogue/sources/revision_backfill.py:2326-2414;3396-3408
(Duplicate cited coordinate, distinct storage/lifetime obligation:
unused historical prepared shards are still materialized. No
cleanup/lifetime fix is supplied.) | - |
| 96.13 #5585 `polylogue/sources/revision_backfill.py:2352` |
fixed-already |
polylogue/sources/revision_backfill.py:2427-2465;2819-2880 (Census uses
raw-ID pages and resumes/rebinds expiring source frames.) | - |
| 96.14 #4993 `polylogue/sources/revision_backfill.py:2402` | fixed |
polylogue/sources/revision_backfill.py `_required_shard_prepared_rows`:
keys the lookup through `identity_law.session_id`, the helper
`prepare_session_shard` uses |
tests/unit/sources/test_revision_backfill.py::test_frozen_inactive_generation_replays_through_sealed_session_shards[padded_native_id=True]
|
| 96.15 #5435 `polylogue/sources/revision_backfill.py:2530` | fixed |
polylogue/sources/revision_backfill.py `_owned_generation_is_empty`: the
read-only probe opens with `validate_index_layout=False` |
tests/unit/sources/test_revision_backfill.py::test_owned_nonempty_generation_refuses_cold_build_deferral[deferred_indexes=True]
|
| 96.16 #5594 `polylogue/sources/revision_backfill.py:2752` | not
reached | polylogue/sources/revision_backfill.py:2490-2542;2828 (The
raw-ID page bound does not bound membership-join fanout. Paging the
joined result without losing logical-source memberships remains.) | - |
| 96.17 #4993 `polylogue/sources/revision_backfill.py:2842` |
fixed-already |
polylogue/sources/revision_backfill.py:4135-4165;4345-4374
(Required-shard refusal for lineage slicing has an explicit
canonical-write degradation; the strict prepared-carrier path remains
retryable.) | - |
| 96.18 #4982 `polylogue/sources/revision_backfill.py:2921` | not
reached | polylogue/sources/revision_backfill.py:4411-4415 (The terminal
global FTS corruption condition can still fail a selected replay unit
because of unrelated existing corruption. No narrower verification-scope
change is supplied.) | - |
| 96.19 #4382 `polylogue/sources/revision_backfill.py:3028` |
fixed-already | polylogue/sources/revision_backfill.py:6335-6343 (Spill
reparse passes the archive source connection to replay-safe enrichment.)
| - |
| 96.20 #4941 `polylogue/sources/revision_backfill.py:3279` |
fixed-already |
polylogue/sources/revision_backfill.py:6310-6319;6335-6343 (Both spill
routes recover the original source path and pass it into enrichment.) |
- |
| 96.21 #5432 `polylogue/sources/revision_backfill.py:3710` |
fixed-already | polylogue/sources/revision_backfill.py:4927-4955
(Prefetch hits are removed before representative selection and executor
dispatch.) | - |
| 96.22 #4275 `polylogue/sources/source_acquisition_components.py:370` |
not reached | polylogue/sources/source_acquisition_components.py:447
(Plain-file admission evidence is not yet carried across every sibling
acquisition route. ZIP/Drive provenance closure remains.) | - |
| 96.23 #4174 `polylogue/sources/source_acquisition_components.py:516` |
not reached | polylogue/sources/source_acquisition_components.py:623-689
(ZIP split-payload indexing still needs correction for grouped inline
documents. No acquisition-file edit is supplied.) | - |
| 96.24 #4634 `polylogue/sources/source_parsing.py:49` | not reached |
polylogue/sources/source_parsing.py:38-49 (Decoded positive session
evidence can still be overridden by the pathname classification. No
admission-policy edit is supplied.) | - |
| 96.25 #4883 `polylogue/sources/source_parsing.py:303` | stale |
polylogue/pipeline/services/archive_ingest.py and
`parse_sources_archive` were removed by #5787 (mutations route through
the daemon); no API sequential writer assigns a generic raw ID | - |
| 97.01 #4452 `polylogue/sources/source_parsing.py:452` | not reached |
polylogue/sources/source_parsing.py:469 (Antigravity vendor prepass and
saved JSON exports can still yield competing copies. Precedence and
retained provenance must be solved together.) | - |
| 97.02 #4452 `polylogue/sources/source_parsing.py:455` | not reached |
polylogue/sources/parsers/antigravity/census.py;polylogue/sources/source_parsing.py:408
(Antigravity source census still lacks the saved export-document role.
The role and its consumers are not changed.) | - |
| 97.03 #4452 `polylogue/sources/source_parsing.py:455` | stale | the
sequential API writer (`parse_sources_archive`) that skipped the
evidence gate was removed by #5787 | - |
| 97.04 #4732 `polylogue/sources/source_root_admission.py:58` | not
reached | polylogue/sources/source_root_admission.py:48 (Ancestor-only
refusal does not exclude a foreign archive nested below a selected
directory. Discovery pruning plus explicit refusal accounting remains.)
| - |
| 97.05 #4441 `polylogue/sources/source_snapshot.py:866` | fixed |
polylogue/sources/source_snapshot.py `execute_source_cut`: refuses a
destination whose staging parent is inside, or which contains, a bound
directory root (resolved, so aliases count) |
tests/unit/sources/test_source_snapshot.py::test_cut_refuses_staging_inside_source_before_mutating_it
|
| 97.06 #4945 `polylogue/sources/source_snapshot.py:917` | fixed |
polylogue/sources/source_snapshot.py `execute_source_cut`: appends
`.jsonl` to the full source id instead of replacing its suffix |
tests/unit/sources/test_source_snapshot.py::test_sqlite_cut_keeps_dotted_source_ids_distinct
|
| 97.07 #4441 `polylogue/sources/source_snapshot.py:969` | fixed |
polylogue/sources/source_snapshot.py: staging carries an owner marker
naming the request; `_reclaim_orphaned_staging` deletes only marked,
non-symlink directories; the marker is removed before publication |
tests/unit/sources/test_source_snapshot.py::test_cut_reclaims_only_staging_it_owns
|
| 97.08 #4441 `polylogue/sources/source_snapshot.py:992` | fixed |
polylogue/sources/source_snapshot.py `reacquire_candidate`:
archive-member items are verified against the member bytes read by name
from the copied ZIP |
tests/unit/sources/test_source_snapshot.py::test_archive_cut_reacquires_member_bytes_and_detects_member_mutation
|
| 97.09 #4432 `polylogue/sources/source_walk.py:54` | fixed |
polylogue/sources/source_walk.py `census_source_root`: a directly
configured file is the one candidate, as in `_resolve_source_paths` |
tests/unit/sources/test_origin_specs.py::test_root_census_includes_a_directly_selected_file
|
| 97.10 #4432 `polylogue/sources/source_walk.py:60` | fixed |
polylogue/sources/source_walk.py: the metric is renamed
`candidate_bytes` and documented as candidate entry size, not read I/O
(the finding's second option) |
tests/unit/sources/test_origin_specs.py::test_root_census_includes_a_directly_selected_file
|
| 97.11 #4788 `polylogue/sources/source_walk.py:149` | fixed |
polylogue/sources/source_walk.py `census_source_root`: supported-name
entries are taken before the regular-file filter; links and FIFOs count
as unsupported |
tests/unit/sources/test_origin_specs.py::test_root_census_accounts_for_rejected_nonregular_candidates
|
| 97.12 #4788 `polylogue/sources/source_walk.py:151` | fixed |
polylogue/sources/source_walk.py `_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 unexplained |
tests/unit/sources/test_origin_specs.py::test_source_walk_keeps_uninspectable_candidate_and_census_records_it
|
| 97.13 #4879 `polylogue/sources/sqlite_snapshot.py:344` | not reached |
polylogue/sources/sqlite_snapshot.py:406;polylogue/sources/live/watcher.py:1286
(Physical watcher tokens can remain stale when acquisition itself
establishes an idle WAL. Snapshot/watcher cursor rebasing must be
changed together.) | - |
| 86.01 #5411 `polylogue/schemas/audit/workflow.py:59` | fixed |
polylogue/schemas/audit/workflow.py `_package_not_required_reason`:
canonicalizes the provider token before the subject lookup |
tests/unit/schemas/test_audit_declared_packages.py::test_audit_aliases_preserve_declared_package_exemptions
|
| 86.02 #4835 `polylogue/schemas/generation/dynamic_keys.py:27` |
fixed-already | polylogue/schemas/generation/dynamic_keys.py:35-71
(Required arrays are recursively canonicalized before structure
hashing.) | - |
| 86.03 #5277 `polylogue/schemas/generation/dynamic_keys.py:194` | fixed
| polylogue/schemas/generation/dynamic_keys.py
`_merge_observed_structure_pair`: beside an existing map only
individually dynamic names fold into it; static names stay |
tests/unit/schemas/test_promotion_monotonicity.py::test_observed_merge_rehomes_content_keys_beside_an_existing_dynamic_map
|
| 86.04 #5277 `polylogue/schemas/generation/dynamic_keys.py:195` | fixed
| polylogue/schemas/audit/checks.py `check_annotation_coverage`: named
fields retained beside a collapsed map are still counted |
tests/unit/schemas/test_promotion_monotonicity.py::test_collapsed_object_keeps_retained_fields_visible_to_annotation_audit
|
| 86.05 #4828 `polylogue/schemas/generation/workflow.py:119` |
fixed-already | polylogue/schemas/generation/workflow.py:99-105
(Provider and input provider tokens are canonicalized before selection.)
| - |
| 86.06 #4836 `polylogue/schemas/generation/workflow.py:185` |
fixed-already | polylogue/schemas/generation/workflow.py:175-193 (Source
witness overflow is propagated to the schema extension and manifest
lower bound.) | - |
| 86.07 #4835 `polylogue/schemas/generation/workflow.py:185` |
fixed-already | polylogue/schemas/generation/workflow.py:165-178 (Reused
versions retain prior exact structure witnesses.) | - |
| 86.08 #5444 `polylogue/schemas/operator/commit.py:62` | fixed |
polylogue/schemas/operator/commit.py: `SchemaCommitPrivacyError` derives
from `ValueError`, the command boundary's refusal type |
tests/unit/devtools/test_schema_commit_command.py::test_schema_commit_renders_typed_refusals_as_json[privacy]
|
| 86.09 #4828 `polylogue/schemas/package_publication.py:46` |
fixed-already | polylogue/schemas/package_publication.py:36-46 (The
publication snapshot enumerates all retained files, not JSON alone.) | -
|
| 86.10 #4837 `polylogue/schemas/packages.py:106` | fixed-already |
polylogue/schemas/packages.py:105-111 (The requested historical-key read
is already present. No migration or compatibility code is added by this
batch.) | - |
| 86.11 #4837 `polylogue/schemas/runtime_registry.py:764` |
fixed-already | polylogue/schemas/runtime_registry.py:762-790 (Refresh
takes maxima across prior manifest, prior schema, and incoming coverage
counters.) | - |
| 86.12 #4836 `polylogue/schemas/runtime_registry.py:776` |
fixed-already | polylogue/schemas/generation/dynamic_keys.py:74-127 (The
capped source-witness partition excludes shorter archive structure IDs;
archive IDs are retained without this cap.) | - |
| 86.13 #4838 `polylogue/schemas/runtime_registry.py:816` |
fixed-already | polylogue/schemas/runtime_registry.py:909-919 (Retained
historical packages pass through witness/counter synchronization before
publication. No migration is added.) | - |
| 86.14 #4854 `polylogue/schemas/sampling_db.py:66` | fixed |
polylogue/schemas/operator/schema_inference.py `cli_main`: passes
`ArchiveLocation.resolve(config.archive_root)` |
tests/unit/devtools/test_schema_lab_commands.py::test_schema_module_cli_preserves_configured_archive_location
|
| 86.15 #4854 `polylogue/schemas/sampling_db.py:318` | fixed |
polylogue/schemas/sampling_db.py: `SchemaArchiveEvidenceError` derives
from `ValueError` |
tests/unit/devtools/test_schema_commit_command.py::test_schema_commit_renders_typed_refusals_as_json[archive_evidence];
tests/unit/devtools/test_schema_lab_commands.py::test_schema_generate_handles_missing_archive_evidence
|
| 86.16 #4828 `polylogue/schemas/source_inference.py:559` |
fixed-already | polylogue/schemas/source_inference.py:569-591 (An
explicitly selected file is resolved before non-following file-type
inspection.) | - |
| 86.17 #4847 `polylogue/schemas/source_inference.py:612` |
fixed-already | polylogue/schemas/source_inference.py:643-689
(Unrecognized logical-export filenames are bound using the export header
member.) | - |
| 86.18 #4899 `polylogue/schemas/source_inference.py:640` | not reached
| polylogue/schemas/source_inference.py:679 (A recognized basename can
still win over an authoritative logical-export header. Header-first
acquisition identity remains.) | - |
| 86.19 #4936 `polylogue/schemas/source_inference.py:763` | not reached
| polylogue/schemas/source_inference.py:1549 (ZIP sidecars still enter
unconditional export-array expansion, unlike equivalent plain structured
documents. No ZIP strategy change is supplied.) | - |
| 86.20 #4936 `polylogue/schemas/source_inference.py:1267` | not reached
| polylogue/schemas/source_inference.py:SourceEvidenceRecipe (The
source-evidence recipe still permits reuse of pre-envelope-preservation
cache output. Must change with the actual observation semantics, not
silently accept the old cache.) | - |
| 86.21 #4847 `polylogue/schemas/source_inference.py:1273` |
fixed-already | polylogue/schemas/source_inference.py:1384-1406
(Logical-export DDL is reconstructed for declared not-null and
primary-key column metadata.) | - |
| 86.22 #4923 `polylogue/schemas/source_inference.py:1298` | not reached
| polylogue/schemas/source_inference.py:1373 (Live SQLite table/column
observations still lack one explicit read transaction covering the
complete observation.) | - |
| 86.23 #4923 `polylogue/schemas/source_inference.py:1301` | not reached
| polylogue/schemas/source_inference.py:1373 (Read-only WAL input
without SHM still needs a writable, WAL-preserving temporary snapshot
adapter. Immutable main-image fallback would lose evidence and is not
added.) | - |
| 86.24 #4847 `polylogue/schemas/source_inference.py:1334` | not reached
|
polylogue/schemas/source_inference.py:_collect_database_schema_candidate
(Identical database reacquisitions still retain path-derived
logical-source identities and double-count evidence. No guessed native
identity or broad deduplication is added.) | - |
| 86.25 #4634
`polylogue/schemas/synthetic/relation_solver_runtime.py:80` | fixed |
polylogue/schemas/synthetic/relation_solver_runtime.py
`_parsed_annotations`: keyed by a SHA-256 of the canonical JSON and
parsed from that snapshot |
tests/unit/core/test_synthetic_relations.py::test_relation_solver_honors_in_place_annotation_changes_between_generations
|
| 87.01 #4912 `polylogue/schemas/validator.py:110` | fixed |
polylogue/schemas/validator.py `_schema_branch_for_value`: the allOf
base selects its own union branch before merging |
tests/unit/schemas/test_drift_walk_resolution.py::test_validation_selects_a_sibling_union_before_allof_observation
|
| 87.02 #4912 `polylogue/schemas/validator.py:114` | fixed |
polylogue/schemas/validator.py `_schema_branch_for_value`: an explicit
dynamic-keys marker on any conjunct survives the allOf merge |
tests/unit/schemas/test_drift_walk_resolution.py::test_validation_preserves_dynamic_annotation_across_unannotated_conjuncts
|
| 87.03 #4912 `polylogue/schemas/validator.py:116` | not reached |
polylogue/schemas/validator.py:309 (The observation-only allOf merge is
still reused by empty-array normalization and can lose type constraints.
The three drift-walk edits do not claim to solve this.) | - |
| 87.04 #5413 `polylogue/schemas/validator.py:125` | fixed |
polylogue/schemas/validator.py `_resolve_local_ref`: `$ref` sibling
declarations join the resolved observation node |
tests/unit/schemas/test_drift_walk_resolution.py::test_validation_keeps_local_ref_sibling_declarations
|
| 87.05 #4829 `polylogue/schemas/validator.py:307` | fixed-already |
polylogue/schemas/validator.py:514-609;polylogue/pipeline/services/validation_runtime.py:57-66
(PayloadValidation retains the chosen probe samples/results and
consumers use them without another full validation.) | - |
| 87.06 #4830 `polylogue/schemas/validator.py:344` | fixed-already |
polylogue/schemas/validator.py:528-565 (Rejected candidates stop on the
first invalid record; only the initial fallback candidate is completed
if no candidate accepts.) | - |
| 87.07 #4830 `polylogue/schemas/validator.py:368` | not reached |
polylogue/schemas/validator.py:587-597 (Accepted historical schema
selection still preserves package_default as its reason and can cause
false unseen_shape classification.) | - |
| 87.08 #4830 `polylogue/schemas/validator.py:368` | not reached |
polylogue/schemas/validator.py:587-597 (Duplicate cited coordinate,
separate review comment: accepted historical resolution still needs
distinct truthful classification. No reason-enum/interface change is
supplied.) | - |

## Residuals

- 26 findings stay not reached and open in their beads (listed above).
- 86.10 is fixed-already, but the fix it asked for is a dual read of the
old key `omitted_current_structure_witness_count` in
`schemas/packages.py`. Whether committed packages still need that read
is a separate cleanup.
- The source-cut and census functions are exercised only by tests until
an acquisition owner calls them.
- Three focused tests fail identically on master (see Verification);
they are not touched here.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant