Skip to content

chore: Delete the unreachable raw-authority frontier apply path - #5081

Merged
Sinity merged 1 commit into
masterfrom
chore/delete-unreachable-raw-authority-apply
Sep 14, 2026
Merged

Sinity merged 1 commit into
masterfrom
chore/delete-unreachable-raw-authority-apply

Conversation

@Sinity

@Sinity Sinity commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Summary

Delete the raw-authority frontier apply/recover/validate chain, which has
been unreachable from production since PR #5002. 12 files, +16/−2,443.

The inspect/census side is untouched and remains production-reachable.

Problem

polylogue-6kur ("Eliminate repair as a product concept") requires that no
public generic repair, cleanup, doctor-apply, or break-glass route remains.
The generic repair framework (storage/repair.py) is gone, but a generic
actuator route survived as dead code:

PR #5002 ("Retire the all-valid raw materialization scanner from production")
deleted the legacy _run_raw_materialization_pass wholesale, and with it the
only call site of _converge_raw_authority_frontier:

-            frontier_repaired = _converge_raw_authority_frontier(config, limit=min(limit, 8))

Nothing in the #5027 derivation-kernel rewrite re-wired it. At this head the
caller list is empty at every level:

  • _converge_raw_authority_frontier — referenced only by its own definition
    and one test that called it directly.
  • _emit_raw_materialization_pass — same; the raw_materialization_pass
    event it shaped has no other emitter anywhere in the tree.
  • maintenance.raw_authority.apply_frontier / recover_interrupted_frontier
    / _validate_frontier_apply_report — reachable only from the above.
  • raw_reconciler.apply_raw_authority_frontier and friends — reachable only
    from those.

So the last thing in the tree that could execute a historical repair
strategy was already incapable of being invoked. It was a generic repair
actuator kept alive only by its own tests.

Solution

Delete the dead closure, computed with a reachability analysis seeded from
every symbol referenced outside the two storage modules:

  • daemon/cli.py: _converge_raw_authority_frontier, _emit_raw_materialization_pass
  • maintenance/raw_authority.py: apply_frontier, _validate_frontier_apply_report, recover_interrupted_frontier
  • storage/raw_reconciler.py: apply_raw_authority_frontier, recover_interrupted_raw_authority_frontier, validate_raw_authority_frontier_apply_report, _validate_raw_authority_frontier_apply_counts, RawAuthorityFrontierApplyReport, _apply_strategy, _preview_plan_ids, _terminalized_preview_items, _state_counts
  • storage/raw_convergence.py: the _apply_* / _stage_* / _finalize_* / _restore_* strategy actuators for browser-capture origin, duplicate raw identity, and quarantined accepted raw

Deliberately retained, because it is still the only route to something
real and still production-reachable: the whole inspect/census side —
inspect_raw_authority_frontier, _classify_frontier, the three
inspect_* strategies, the maintenance raw-authority-frontier|census|detail|blockers
commands, mutate-resolve-raw-authority-blocker, the readiness payload
fields, and the MCP census resources. Operators can still see the frontier
and its blockers; they just cannot invoke an actuator that no production
route could reach anyway.

Tests covering the removed route were deleted, not weakened — no test was
skipped, xfailed, loosened, or stubbed. Where a test mixed inspect and apply
assertions, only the apply half was removed and the test kept its real
inspect checks (four such tests, three renamed to match what they now prove).
Atlas citations into daemon/cli.py were re-verified and their line ranges
corrected against the new content.

Verification

devtools test tests/unit/storage/test_raw_authority_ledger.py tests/unit/storage/test_quarantined_accepted_raw_repair.py tests/unit/storage/test_duplicate_raw_identity_repair.py tests/unit/storage/test_browser_capture_origin_repair.py tests/unit/storage/test_quarantine_repair_budget.py tests/unit/product/test_raw_authority.py
  => 102 passed, 1 warning in 114.96s   (devtools test: PASSED exit=0 diagnosis=pytest_passed)

devtools test tests/unit/daemon/test_daemon_cli.py
  => 104 passed, 1 warning in 43.92s    (devtools test: PASSED exit=0 diagnosis=pytest_passed)

devtools verify --quick
  => all 15 gates ok, exit 0            (incl. oracle-integrity, consumer-reachability, layering, schema-manifest)

Anti-vacuity: a scripted reachability closure over both storage modules
reports zero unreachable module-level definitions after the deletion, and a
tree-wide grep for every deleted symbol across polylogue, tests,
devtools and docs returns nothing.

Residuals (honest)

  • This moves the derived schema identity. storage/raw_convergence.py is
    IN the closure per devtools schema closure. It must land before the
    fresh rebuild starts, never during one.
  • devtools gate atlas still reports the daemon/00-core sections as
    stale.
    This is structural, not ignorable-by-choice: the stamp is a commit
    SHA, so a PR that edits an anchored file can never stamp itself, and a
    squash merge changes the SHA again. Master is already red on this gate for
    the same reason (docs/structured-logging.md after chore: Enforce the prose-logging form the old ratchet could not see #5074). The anchors
    in this PR were re-verified by hand and their line ranges corrected; only
    the verified: stamp is unchanged. atlas is not a --quick gate.
  • This does not close polylogue-6kur. It advances AC 1/2. The durable
    raw-authority census/plan/blocker tables, the operator-facing census
    commands, and the three historical inspect strategies all survive; their
    disposition belongs to polylogue-2x6xu and depends on the operator's
    archive-wipe decision.
  • Remaining repair vocabulary in the tree (FTS membership convergence,
    stale-observation reconciliation) names live derivations, not a repair
    product; renaming belongs to polylogue-z07nu.
  • Pre-existing and untouched: docs/design/raw-decision-authority.md cites
    raw_convergence.py:4608-6194, anchors that died when the engine was
    removed in chore: Port raw-authority proofs before deleting the legacy convergence… #5005/refactor: Rewrite convergence around a domain-owned derivation kernel #5027.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK

PR #5002 removed the legacy raw-materialization pass wholesale, taking with
it the only call site of `_converge_raw_authority_frontier`. Nothing in the
#5027 derivation-kernel rewrite re-wired it, so the entire raw-authority
frontier apply/recover/validate chain has been unreachable from production
since then: dead code that still presented a generic "repair" actuator.

Delete it, with an enumerated (empty) caller list at every level. The
inspect/census side is untouched and remains production-reachable through
`maintenance raw-authority-frontier|census|detail|blockers`, the readiness
payload and the MCP census resources.

Removed: daemon `_converge_raw_authority_frontier` / `_emit_raw_materialization_pass`;
`maintenance.raw_authority` apply_frontier / _validate_frontier_apply_report /
recover_interrupted_frontier; `raw_reconciler` apply_raw_authority_frontier /
recover_interrupted_raw_authority_frontier / validate_raw_authority_frontier_apply_report /
RawAuthorityFrontierApplyReport and their private helpers; and the
`raw_convergence` _apply_*/_stage_*/_finalize_*/_restore_* strategy actuators.

Advances polylogue-6kur (AC 1/2) and polylogue-reindex-ws-f.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK
@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.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 16 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 7e7f5809-27bd-4b39-84c8-cbbb6089fd4c

📥 Commits

Reviewing files that changed from the base of the PR and between f90c94d and 2cb084a.

📒 Files selected for processing (12)
  • docs/atlas/00-core.md
  • docs/atlas/daemon.md
  • polylogue/daemon/cli.py
  • polylogue/maintenance/raw_authority.py
  • polylogue/storage/raw_convergence.py
  • polylogue/storage/raw_reconciler.py
  • tests/unit/daemon/test_daemon_cli.py
  • tests/unit/product/test_raw_authority.py
  • tests/unit/storage/test_browser_capture_origin_repair.py
  • tests/unit/storage/test_duplicate_raw_identity_repair.py
  • tests/unit/storage/test_quarantined_accepted_raw_repair.py
  • tests/unit/storage/test_raw_authority_ledger.py

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Sinity
Sinity merged commit ab81d4e into master Sep 14, 2026
3 checks passed
@Sinity
Sinity deleted the chore/delete-unreachable-raw-authority-apply branch September 14, 2026 15:41
Sinity added a commit that referenced this pull request Sep 14, 2026
…5084)

## Summary

`devtools gate atlas` is red on master. #5080 and #5081 both edited
`polylogue/daemon/cli.py`, which is anchored by `docs/atlas/daemon.md`
and `docs/atlas/00-core.md`, and neither PR re-verified the sheets. That
is my omission — CLAUDE.md requires running `devtools gate atlas` when
changing anchored code.

## Problem

Six sections reported `stale`. Two distinct causes:

- Five `daemon.md` anchors plus one in `00-core.md` still cited
pre-change line numbers. The net shift is **−71**, not the +7 that #5080
alone would suggest — #5081's deletion also touched the file.
- One anchor (`cli.py:1612-1637`) pointed at the raw-authority frontier
drain that #5081 deleted outright, so it could not be renumbered at all.

## Solution

Anchors were relocated by **locating the originally-cited block in the
current file by content**, using the verified-stamp commit as the source
of truth, rather than by arithmetic on line numbers. The
convergence-debt citation was re-pointed at
`_drain_convergence_debt_once` (`cli.py:1614-1636`), which still
supports the sheet's claim: debt identity is stage-scoped and the drain
excludes `derived`, `fts`, `fts_readiness`, `raw_parse_recovery` and
`embed`, which is exactly the assertion that FTS, embeddings, raw
parsing and session profiles no longer use debt rows as publication
authority.

Stamps then advanced to `ab81d4e5cc06`.

## Verification

```
devtools gate atlas
Atlas citations and verification stamps are current

devtools verify --quick
15/15 gates ok
```

## Residuals

The stamp is a commit SHA, so a PR that edits an anchored file can never
stamp itself — the sheet goes stale again the moment this merges if
another anchored file changes first. That is structural, and it is why
this kind of PR trails the change rather than accompanying it.

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

https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sinity added a commit that referenced this pull request Sep 21, 2026
The apply half of the raw-authority repair product was removed in #5081,
which left the worse residue: a census that still classified every accepted
head into an "executable" repair plan, named a RawAuthorityActuator for each,
minted operator-judgment assertions, and published durable blockers promising
a remedy no code in the tree could run. `_APPLY_DISPATCHED_ACTUATORS` even
documented itself as mirroring `_apply_raw_authority_plan` and a guard test,
neither of which exists.

Delete the promise rather than re-plumbing it:

- `polylogue/storage/raw_convergence.py` (2,915 lines): the three historical
  incident strategies (quarantined accepted raw, browser-capture origin
  mismatch, duplicate raw identity). They prove cohorts of the pre-2026-09-07
  archive, which the fresh-start ruling does not migrate; the duplicate-raw
  strategy is structurally unprovable post-#2729 because it requires a
  native-id-inclusive raw the current writer never emits.
- `RawAuthorityActuator`, `_EXECUTABLE_STATES`, `_APPLY_DISPATCHED_ACTUATORS`,
  `RawAuthorityFrontierItem.executable`, `executable_plan_count`, the
  strategy-override bridge, and the `safely_rekeyable` / `duplicate_alias` /
  `conflicting_authority_needs_judgment` states.
- The operator-judgment loop (`_record_judgment_candidate`,
  `_apply_judgment_dispositions`) and its `--assertion-id` /
  `--judgment-disposition` CLI, protocol, actuator and spec surface.
- `ReconstructedRawRow` / `insert_reconstructed_raw_row`: the one declared
  exemption from `admit_raw_observation`, whose only caller was the
  browser-origin copy-forward repair.

What survives is a read-only frontier census: every non-current state is an
explicit retryable obligation ordinary acquisition discharges, or a typed
permanent refusal. `raw_authority_blockers` and its readers are untouched.

`raw_convergence.py` was a declared materializer-fingerprint root, so this
moves the derived schema identity and must land before a rebuild starts.
Closure shrinks 558 -> 555 members.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015WCh9YW3cRfsg3CZBKU7Fq
Sinity added a commit that referenced this pull request Sep 21, 2026
…romise

`docs/architecture.md` rule 5 told every future contributor to put "detect
and fix rows that violate an invariant the write path should have prevented"
in `maintenance/` -- the generic repair product, institutionalized in the
placement rules and in direct contradiction of CLAUDE.md. Nothing in
`maintenance/` at head is that: it holds conservation proofs, censuses, blob
disposition, embedding preservation and archive verification.

Rule 5 now describes what `maintenance/` actually is and names the three
owners a write-path invariant violation can have -- the schema, the producer,
or a canonical derivation -- with the choice taking precedence over
placement. The worked examples follow: the orphaned-`messages` sweeper has no
subject, because `messages.session_id` is a cascading FK.

`docs/maintenance.md` claimed "the daemon selects only executable
proof-backed plans" for the raw-authority frontier. No apply route has
existed since #5081 and none exists now; the section describes the read-only
census and names who actually discharges each state.

`docs/design/raw-decision-authority.md` gets a status header: its
ledger-drop and blocker-re-keying decisions landed, its apply-side half now
describes deleted code, and its `raw_convergence.py:NNNN` citations resolved
to nothing even before the file was deleted.

Also drops the now-stale `raw_convergence` anchors from the layering-surface
and sqlite-degradation ratchets (both declare "removal only"), and corrects
`architecture-hotspots.md` row 3 and `sqlite-connection-policy.md`.

Adds `tests/unit/storage/test_repair_concept_retirement.py`: the executed
census for the retirement, including the module-name ratchet, the import
census over the whole product tree, and one production-route law over a
seeded archive proving a blocked head is still reported and published while
the payload carries no actuator and no executable plan count.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015WCh9YW3cRfsg3CZBKU7Fq
Sinity added a commit that referenced this pull request Sep 21, 2026
…ed promise (#5350)

## Summary

Deletes the raw-authority repair framework — a public break-glass route
whose
entire ritual delivered **no effect** — and replaces the promise with a
typed
permanent refusal. Three of eight acceptance criteria remain open and
are stated
plainly below; **this bead gates rebuild authorization, so it does not
close.**

## What the bead said, and what was actually true

The bead's 2026-09-21 note said the surviving cull was two durably
written
strings "with a migration question attached". **That premise is false at
head**
and was not acted on: the two constants have exactly two hits repo-wide
— their
own definitions — and no writer exists anywhere, not even in a test. A
read-only
census of the live archive confirms zero rows carry either string. There
were no
rows to strand, so there was no migration decision to make; the
constants died
with their module.

What was actually there was worse. The *apply* half went in #5081,
leaving a
residue that advertised a remedy it could not deliver:
`_APPLY_DISPATCHED_ACTUATORS`
documented itself as mirroring `_apply_raw_authority_plan` and a guard
test —
**grep proves neither exists**. So the census still classified every
accepted head
into an "executable" plan, named an actuator for each, minted
operator-judgment
assertions in `user.db`, published durable blockers advertising a
remedy, and
promoted an accepted judgment into an "executable successor" — **for a
dispatcher
with zero implementations.** Read conflict → write judgment → resolve,
and nothing
happened.

`raw_reconciler.py` 1,302 → 599 lines; `raw_convergence.py` (2,915)
deleted whole.

## `ops maintenance operation-recovery --confirm`: RETAINED, and why

Adjudicated rather than left unmentioned. Four reasons, each checked
against code:

1. It mutates `audit.db` **only** — it writes a `recovery_adjudicated`
event,
   touches no source/index/user row, and can repair nothing.
2. What it records is **operator testimony about an unknowable**:
whether a crashed
EXECUTE's durable effect landed is not derivable from durable evidence,
so no
convergence stage can own it. That is precisely the class CLAUDE.md's
"derived
   read models converge from durable evidence" sentence does not cover.
3. Its premise is a dead daemon and it **enforces** that premise — the
guard raises
while `polylogued` lives, proven by an existing production-route test.
4. Routing it through the daemon is self-contradictory: it would make
the record of
   the daemon's own interrupted operation permanently unclosable.

What *did* change: the guard's refusal string said "Stop polylogued for
offline
repair" — the last place the product told an operator an offline repair
mode
exists. It now names the two real options. The CLI's "Resolved" echo was
deliberately **not** renamed; that was tried and reverted, because it
would split
CLI vocabulary from the durable `resolved_at_ms` column and the declared
operation
id. The dishonesty was never the word "resolve" — it was the claim that
resolution
feeds an apply.

## The census is executed, not written down

`tests/unit/storage/test_repair_concept_retirement.py` (27 tests): an
`ast.parse`
import census over every `polylogue/**/*.py` walking imports at **any
nesting
depth**, a module-name ratchet, and a maintenance-surface check reading
the live
declarations. The nesting matters — **every edge to the deleted module
was a
function-local import**, which a top-level grep would have missed
entirely.

572 → 459 case-insensitive `repair` hits survive, each family justified
individually: 95 FTS index convergence (contentless FTS5 re-synced from
durable
evidence — correct concept, repair-flavoured name), 90
declaration/diagnostic
remedy pointers, 27 behavioural measurement *about archived sessions*,
25
derived-row convergence inside the write transaction, 13 false positives
(`CapturePairing` contains "rePair"), and 165 prose. Renaming the two
large
families is a cross-surface lexical change owned by polylogue-z07nu, not
a
deletion bead.

**The worst "described as" survivor no grep of `polylogue/` would
find**:
`docs/architecture.md` placement rule 5 instructed *"Is it INTEGRITY
REPAIR …
detecting and fixing rows that violate an invariant the write path
should have
prevented? → maintenance/"*. That is the generic repair product
institutionalized
in the repo's declared placement authority, contradicting CLAUDE.md —
and nothing
in `maintenance/` at head is that. Rule 5 now names the three owners a
write-path
invariant violation can actually have. Its worked example is now
answered
"nowhere — it has no subject", because that column is a cascading FK.

## Seven production-route mutants, executed

| Mutant | Red |
| --- | --- |
| Reinstate `"actuator": "refine_quarantine"` in the plan payload |
caught in the **durably stored** `expected_json`, not just in memory |
| Reinstate `executable_plan_count` on the census | `assert
'executable_plan_count' not in {...}` |
| Delete the `quarantined` branch from `_classify_frontier` | 2 files
red — `PROVEN_CURRENT is UNRESOLVED_PROVENANCE`: silently reclassifying
a blocked head as healthy |
| Re-add an actuator enum with a function-local import of the deleted
module | the AST census caught the **function-local** import; 3 red |
| Re-add `insert_reconstructed_raw_row` | the durable source-tier write
bypassing `admit_raw_observation` |
| Declare a `repair` maintenance command | `assert ['repair'] == []` |
| Create `storage/repair.py` with `REPAIR_HANDLERS` | the original
7,534-line substrate returning under its own name |

## Producer fixes checked before deleting each strategy

Deleting a repair path over a live defect is the failure mode; each of
the three
was checked against its current producer and none needed a new fix.
Browser-origin
mismatch: the producer fix already landed **at the write boundary**, not
as a
backfill. Duplicate raw identity: structurally unproducible by the
converged
writers since polylogue-sjf6. Quarantined accepted head: **not a
defect** — a
declared fail-closed arbitration outcome with its own conservation term.

## Verification

- `devtools verify --quick` — **exit 0, 24/24 gates**, re-run after
rebase onto
  current master
- `devtools render all --check` — exit 0, `grep -c 'out of sync'` = 0
- Focused selection of 14 modules — **365 passed / 365 collected, exit
0**
- 11 inherited reds reproduce identically at `origin/master` with
identical
  assertion text; none is new

### Schema closure — stated loudly because this bead gates the rebuild

**All three derived fingerprints move**: lowering `be4f1585 → 74fafc04`,
materializer `bc642357 → 9dc1287d`, replay `5c8ede1c → eef8760e`.
Closure shrank
558 → 555 members. **A full archive reconvergence is required, and this
must land
before a rebuild starts, never during one** — a landing mid-run silently
invalidates the run and every seeded test archive keyed on that
identity.

## Residuals — three criteria NOT met

- **AC6 has no enforced deletion successor**, and none was fabricated.
The two
finite durable-source actuators are correctly outside the generic
framework and
bound *by subject* to the fresh-start ruling, but nothing makes them die
before
source sealing — and "source sealing" has no head-side signal a test
could key on
  without inventing one. **This alone keeps the bead open.**
- **AC5 raw retention is unproven.** Blob GC, source-to-index
materialization and
aggregate insights each have a named single owner with bounded retry and
focused
  evidence. Raw retention does not — `storage/raw_retention.py` is a
frontier-integrity projection read by live acquisition and readiness,
not a
recurring owner. A green read-path test is not evidence of a bounded
recurring
  owner.
- **AC3 residual**: `_archive_profile_rows_debt` scans for
`session_profiles` rows
orphaned from `sessions`, which is schema-impossible under an `ON DELETE
CASCADE`
FK. It is a read-only report whose sibling half is a real derivation-lag
measure,
  so it was left and reported rather than silently expanded into.

### A behaviour change a reviewer must weigh before the rebuild

Quarantined accepted heads that the deleted strategy proved "eligible"
used to
classify `SAFELY_REKEYABLE`, which published **no** blocker. They now
classify
`UNRESOLVED_PROVENANCE` and **do** publish one. Measured magnitude:
roughly 2,200
heads move from silently-clean to blocking. The new behaviour is the
correct one —
"safely rekeyable" meant "an actuator could fix this" and no actuator
existed, so
readiness was reporting clean behind a remedy that never ran. But if a
*fresh*
archive produces quarantined heads at scale, each becomes a blocker an
operator
must individually acknowledge: honest, but not a workable workflow.
Readiness-gate
semantics for a decided-unresolved arbitration want their own owner.

### Scope

The bead's declared `write_scope` names only
`maintenance/source_manifest_continuity.py`, which was **not touched** —
it has no
connection to the repair framework. The real scope was established from
the code.
Every path has a repair-elimination rationale; the one judgement call
worth review
is the `docs/architecture.md` rule-5 fix, cleanly separable as its own
hunk.

Advances polylogue-6kur. **Does not close it** — AC3, AC5 and AC6 are
open.

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

https://claude.ai/code/session_015WCh9YW3cRfsg3CZBKU7Fq

---------

Co-authored-by: Claude Opus 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