Repository navigation
test(api): prove facade writers refuse a daemon-owned archive - #5730
Conversation
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f7f784365
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9699782cb5
ℹ️ 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".
The embedded-facade durable writers moved to operations/facade_writers.py and check require_archive_write_authority before opening a tier, but no test drove that refusal, and api/archive.py kept an unused wrapper of the check. Add a test that runs three writers against an archive whose pidfile lock is held by another process, and delete the dead wrapper. The OpenAPI renderer overwrote every declaration's security with the auth-policy default, which erased the explicit cookie requirement on DELETE /api/web-auth/session (broken by #5550). #5720 special-cased that one route; keep any explicitly documented security instead. The rendered document is unchanged. 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
classify_pre_acquisition now raises RetryableSourceReadError for a read fault a later pass can clear, instead of letting a raw sqlite3/OS error escape. The full-ingest batch catches that typed fault, so it no longer needs a new except-sqlite3 handler or a degradation-baseline admission. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
…tired Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
9699782 to
ea5464f
Compare
Summary
Integrates orphaned branch
w10/s2and cleans up an inherited red on master. Three separate changes:_require_archive_write_authoritywrapper inapi/archive.py.RetryableSourceReadError, so the batch no longer adds anexcept sqlite3degradation site. Thebatch.pyanchor that fix: Codex review debt: surfaces (51 findings) #5727 admitted is removed from the degradation baseline.It also adds the missing
otel-genairow (tightness 95) to the detector table indocs/atlas/sources-parsers.md.Problem
w10/s2(70ee4e97c4) added lease checks to seven API mutation routes. Master already runs the equivalentrequire_archive_write_authoritycheck in each of those writers, now inoperations/facade_writers.py. No test drives that refusal, and the old wrapper inapi/archive.pyhas no callers.test_openapi_publishes_typed_first_party_credential_contractbroke at feat: Complete bounded intake and daemon-owned surfaces #5550 (da5346d). The renderer began overwriting every declaration'ssecuritywith the auth-policy default, which cleared the explicitwebCredentialCookierequirement onDELETE /api/web-auth/session. chore: batch polylogue-20260928-071715-abb675fe #5720 (960d0ec) fixed it by hard-coding that one method and path.except (OSError, sqlite3.Error)handler that degrades to retry inbatch.py, and fix: Codex review debt: surfaces (51 findings) #5727 admitted it to the degradation baseline.Solution
tests/unit/operations/test_facade_writer_authority.pyholds the daemon'sflockondaemon.pidfrom a separate process, which is the same tokenpolylogued runholds. It then drives the manual-continuation, context-ledger and comparative-judgment writers. Each writer must raiseArchiveWriterOwnershipErrornaming the PID, and must leave no*.dbin the archive root.render_openapiusesoperation.setdefault("security", ...). I compared every operation's security before and after, and the rendered document is identical.classify_pre_acquisitionconverts a retryable OS or SQLite read fault, including one from the readability probe, intoRetryableSourceReadError(path, cause). Non-retryable errors propagate unchanged, and a probe failure on bytes that are not a database leaves the exclusion standing.batch.pycatches the typed error, andproduction_baseline.pyrecords it asrevision_io_unavailable. New test:test_pre_acquisition_reports_a_retryable_read_as_its_typed_fault.batch.py,batch_support.pyandproduction_baseline.pyare in the derived schema closure. No rebuild has started (polylogue-reindex-2026.1is open).Verification
devtools test tests/unit/sources/test_live_batch_support.py tests/unit/sources/test_production_baseline.py tests/unit/sources/test_cold_build_generation.py tests/unit/operations/test_facade_writer_authority.py tests/unit/devtools/test_render_openapi.py:PASSED exit=0ci/circleci: quick-gateon the head.Residuals
user.dbto reach their check.🤖 Generated with Claude Code
https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg