Skip to content

fix: Stop reporting an unreachable daemon as running and a guess as a verdict - #5047

Merged
Sinity merged 2 commits into
masterfrom
fix/status-claims
Sep 14, 2026
Merged

Sinity merged 2 commits into
masterfrom
fix/status-claims

Conversation

@Sinity

@Sinity Sinity commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Closes polylogue-2d8oq and polylogue-kjy0a. Both are instances of the defect
shape this campaign has now hit six times: a refusal or an unmeasured state
collapsed into a positive claim.

Bug 1 — the URL policy

I accepted what _default_daemon_url produces and deleted the refusal. It
could not be justified: _default_daemon_url exists precisely so site/user TOML
and POLYLOGUE_DAEMON_URL can point the CLI away from the built-in address, and
_status_operation_result refused exactly those values. Correcting
_default_daemon_url to agree was the wrong direction — this route reads through
the configured archive route, so the URL selects nothing here, and an address no
daemon answers must simply yield the direct fallback. The corpus already agreed:
test_status_json_daemon_not_running passes --daemon-url <unreachable> and
asserts source == "direct".

Separately, and regardless of the URL: a failed status read now records
daemon_reachable = False / daemon_path = "unreachable", renders
Daemon: unreachable, and publishes daemon_liveness: false with reason
status_read_failed.

Reproduced without pytest at the tip: with POLYLOGUE_DAEMON_URL=http://127.0.0.1:1
and with it unset, the same workspace now produces byte-identical output, and
no Daemon: running appears anywhere.

Bug 2 — ready / summary / determinate now agree

ready and summary come from one component projection, on the direct path
(operations/daemon_status.py) and on the daemon-serving path
(daemon/status.py) — which carried the identical defect and which the bead did
not mention. The stricter predicate's extra preconditions (parser census,
authority frontier, debt classifier) are classified by a new
raw_materialization_unmeasured_reason.

One refinement mattered. The first version withheld the claim whenever any
precondition was unmeasured, which masked genuine debt refutations —
test_build_daemon_status_claim_guard_reports_openable_but_not_converged caught
it. The rule is now: an uninspected precondition withholds certification only
(a ready projection drops to determinate=False); a projection that already
found the domain wanting stays a determinate false.

On a pristine empty archive:
{"value": null, "determinate": false, "reason": "inspection incomplete for raw_materialization: raw authority frontier inspection not completed"}

Placement: no reconvergence required

storage/archive_readiness.py is IN the derived-schema identity closure. The
first draft edited it, which would have moved the schema identity and forced a
full reconvergence for a status-surface fix. That file is reverted to base and
the helper lives in readiness/claim_guard.py (out). Every changed file
confirmed out.

The seven tests

Five pass untouched: test_basic_usage_cli.py ×3, test_json_envelope_contract.py
×2, plus test_terminal_snapshots.py and test_convergence_surface_contract.py.

Two caveats, stated plainly:

  • The three test_basic_usage_cli tests did not go green on the URL fix
    alone. Getting past the refusal exposed that _render_direct_status_payload
    never named the daemon state and printed Convergence debt: 0 failed, 0 deferred, 0 retry due for a healthy empty ledger — and a bare unavailable for
    an unread one, discarding the reason the reader had already computed. Same
    defect family; the renderer was fixed, not the tests.
  • test_json_status_snapshot is still red for an unrelated pre-existing
    reason: the direct read takes an exclusive ownership flock and the seeded
    lease is a sealed read-only directory. Evidence it is not mine:
    test_plain_read_all_snapshot, touching none of this code, fails identically on
    unmodified f84dd3b0c. (PR fix: Read verbs no longer take the exclusive maintenance-writer lease #5043 addresses that producer.)

Tests changed, and why

Four assertions encoded the bugs: two asserted daemon_liveness is True on a
failed read; ..._keeps_convergence_healthy pinned reason == "ready" without
asserting value
— i.e. it pinned exactly the false/"ready" contradiction;
..._missing_ops_frontier_authority demanded value is False from a domain
reporting unknown. Two test_init tests asserted exit 1 + "Status snapshot:
unavailable", reachable only via the refusal.

Anti-vacuity

  • Reinstating the URL refusal → test_configured_override_url_is_not_refused red.
  • Restoring refusal-to-True liveness → test_status_command_reports_operation_unavailable_without_claiming_liveness red.
  • Deriving ready/summary from different predicates → ..._keeps_convergence_healthy red.
  • Dropping determinate from the raw domains → ..._missing_ops_frontier_authority red.
  • Over-broadening the unmeasured gate → ..._reports_openable_but_not_converged red. This one already fired during development.

Sweep: 11 more live instances, filed not fixed

Highest severity: archive_readiness.py:1764 publishes archive_sessions
readiness as the literal True; daemon_status.py:217 hardcodes
active_archive_root_matches_configured = True while the honest comparison
already exists at cli/commands/paths.py:102; daemon/fts_status.py:131 is a
literal except sqlite3.Error: return {"session_work_events_ready": True} where
every sibling key returns False.

Structurally the important one: build_daemon_status's _v() substitutes
optimistic model defaults for components whose collector timed out, so a
timed-out raw-materialization probe renders state: ready, summary: "ready" with
all-zero counts. That single root cause drives four findings — including
perf_measurable certified from a summary object carrying no available/error
field at all, while the direct path handles the same case correctly. Two producers
of one claim, drifted apart, exactly as in bug 2.

Also: capability.py:665 has no branch for an unavailable embeddings tier, so a
probe that never ran emits determinate=True, ready=False — a certified
refutation from an unmeasured domain
, the inverse-polarity twin of bug 2. And
daemon/status.py:2742 hardcodes component_state.api = "running", so
polylogued status with no daemon listening prints daemon_liveness: false and
daemon_api: running in one payload.

Confirmed correct: surfaces/outcome.py, operations/status_workload.py, several
readiness predicates.

Verification

devtools test across nine status/init/readiness/integration selectors — all
PASSED except the two reds described above. devtools verify --quick exit 0.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK

Sinity and others added 2 commits September 14, 2026 08:58
Problem: `polylogue ops status` rejected any daemon URL other than the
built-in one, which is exactly what `_default_daemon_url` exists to
produce from site/user TOML and `POLYLOGUE_DAEMON_URL`. The refusal was
then rendered as "Daemon: running" with `daemon_liveness: true` and a
`daemon_reachable` route attribute of True, on a workspace where no
daemon existed at all. Reproduced without pytest on one empty workspace:
`POLYLOGUE_DAEMON_URL=http://127.0.0.1:1` gave "Daemon: running", the
same command with the variable unset gave "Daemon: not running".

Solution: accept every URL the resolver can produce. This route reads
through the configured archive route, so the URL selects nothing here
and an address no daemon answers simply yields the direct fallback. A
failed status read now records `daemon_reachable = False`, renders
"Daemon: unreachable", and publishes `daemon_liveness: false`. The
direct renderer also names the daemon state it actually observed and
keeps the convergence-debt reason instead of collapsing an unread
ledger and a healthy empty one into the same line.

Anti-vacuity: reinstating the `daemon_url not in (None,
_BUILTIN_DAEMON_URL)` refusal turns
`TestStatusOperationUrlPolicy::test_configured_override_url_is_not_refused`
red; restoring the refusal-to-True liveness mapping turns
`test_status_command_reports_operation_unavailable_without_claiming_liveness`
red.

Verification: devtools test tests/unit/cli/commands/test_status.py,
tests/unit/cli/test_init.py, tests/integration/test_basic_usage_cli.py,
tests/unit/cli/test_json_envelope_contract.py — all PASSED.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01DYUNBGoE652b3nfmq3CtqK
…r measured

Problem: `polylogue ops status --json --full` published a self-contradictory
verdict on a pristine, empty archive: `converged: {value: false, reason:
"ready"}`. `raw_materialization` was the one derived domain whose `ready`
came from a different predicate than its `summary` —
`raw_materialization_ready` versus the component projection — and the two
disagree whenever the stricter predicate's preconditions (parser census,
raw-authority frontier, debt classifier) were never inspected. It also
omitted `determinate`, so an uninspected domain produced a `false` the
third claim state exists to prevent (#5027).

Solution: derive `ready` and `summary` from the one component projection on
both the direct and the daemon-serving path, and classify the stricter
predicate's never-run preconditions with
`raw_materialization_unmeasured_reason`. An uninspected precondition
withholds certification (`determinate=False`, value `None`, reason naming
the gap); it never masks a projection that already found the domain wanting,
which stays a determinate refutation. `raw_frontier_integrity` and
`embeddings` now pass `determinate` like their siblings.

The helper lives in `readiness/claim_guard.py` rather than
`storage/archive_readiness.py`: that module is inside the derived-schema
identity closure (`devtools schema closure`), the predicate it mirrors is
unchanged, and classifying a claim is not a storage concern. No changed file
is in the closure, so no reconvergence is required.

Anti-vacuity: deriving `ready` and `summary` from different predicates again
restores the `value: false` / `reason: "ready"` pair and turns
`test_status_subprocess_malformed_ingest_attempts_json_keeps_convergence_healthy`
red; dropping `determinate` from the raw domains turns
`test_direct_operation_fails_closed_for_missing_ops_frontier_authority` red.

Verification: devtools test tests/unit/daemon/test_daemon_status.py,
tests/unit/cli/test_status.py (one inherited failure, identical at
f84dd3b), tests/unit/storage/test_archive_readiness.py;
devtools verify --quick exit 0.

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 32 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: 18bdc100-8b14-43f4-b77a-c28de53589ce

📥 Commits

Reviewing files that changed from the base of the PR and between d995eb4 and db9e1b4.

📒 Files selected for processing (7)
  • polylogue/cli/commands/status.py
  • polylogue/daemon/status.py
  • polylogue/operations/daemon_status.py
  • polylogue/readiness/claim_guard.py
  • tests/unit/cli/commands/test_status.py
  • tests/unit/cli/test_init.py
  • tests/unit/cli/test_status.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 1809cb9 into master Sep 14, 2026
3 checks passed
@Sinity
Sinity deleted the fix/status-claims branch September 14, 2026 07:42
Sinity added a commit that referenced this pull request Sep 14, 2026
## Summary

Two stacked causes, both in the test. The brief's diagnosis named the
first
and is correct as far as it goes; fixing the fixture alone is **not**
sufficient, and this records the second cause honestly.

## Problem

**First, a short fixture.** `_malformed_convergence_debt_archive`
(`tests/unit/cli/test_status.py:851`) created SOURCE, INDEX, EMBEDDINGS,
USER
and OPS but **not AUDIT**, while its sibling
`_malformed_ingest_attempts_archive` creates all six. With AUDIT absent,
`ops status --json --full` correctly reports
`claim_guard.openable=false, reason="missing archive tier(s): audit"`.

**Second, with the fixture complete the surviving assertion is itself
stale.**
`assert payload["claim_guard"]["converged"]["value"] is True` is what a
complete six-tier fixture now fails on. Reproduced directly at head with
the
fixture repaired:

```
"openable":  {"value": true,  "determinate": true}
"converged": {"value": null,  "determinate": false,
              "reason": "inspection incomplete for raw_materialization: ...",
              "signal": "derived_domain_readiness.raw_materialization"}
```

PR #5047 (`1809cb9ee`, `polylogue-kjy0a`, "Stop reporting an unreachable
daemon as running and a guess as a verdict") made the claim **withheld**
for
an archive whose raw-authority frontier was never inspected. That PR
updated
this file's sibling test to the new shape -- it asserts exactly
`converged["value"] is None` and `determinate is False` -- but left this
one
alone, because this test was already red on the missing AUDIT tier and
so the
stale assertion was never exposed.

The test's first four assertions -- its actual subject, malformed debt
stays
explicitly visible without replacing readiness -- pass at head
throughout.

## Solution

- Add `ArchiveTier.AUDIT` to the helper, matching its sibling, and
record in
  the docstring why every tier must be present.
- Replace the single `converged.value is True` with the shape the
sibling
already pins, plus the assertion that carries this test's real subject:
the
gap the withheld claim names must be `raw_materialization`, **never**
the
  debt ledger.

## Verification

```
devtools test tests/unit/cli/test_status.py
     (receipt 20260914T164537Z-focused-test-3168362-d6463354)
  -> 40 passed / 40 collected
devtools verify --quick  -> exit 0, 15/15 gates
```

## Anti-vacuity

Let the debt-read failure propagate into the convergence claim and
`signal`/`reason` start naming convergence debt; report a guess as a
verdict
again and `determinate` goes True. Either turns this red.

## Residuals

Test-only change. No other archive-building helper in this file is short
a
tier -- the two were checked.

🤖 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]>
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