Skip to content

feat(devloop): close remaining polylogue-5en gaps (stale-run detection, MCP recipe) - #3333

Merged
Sinity merged 1 commit into
masterfrom
feature/chore/5en-dev-loop-verify-close
Jul 27, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/chore/5en-dev-loop-verify-close

Conversation

@Sinity

@Sinity Sinity commented Jul 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

Closes out the remaining acceptance criteria on polylogue-5en (branch-local
daemon/web/extension/MCP dev loops). Auditing current master against the
bead's AC found the daemon/web/extension/receiver dev loop was already
comprehensively built and tested; two concrete gaps remained, both fixed here.

Problem

polylogue-5en's acceptance criteria require: "Each surface
(daemon/web/extension/MCP) has a documented branch-local recipe that two
concurrent branches can run without cross-talk; stale-run-dir detection warns
in at least the daemon + web cases." Its delivery-upgrade note additionally
names three residual proofs: extension smoke, concurrent spool/dedup test,
capture-gap event fixture.

Auditing the repo found:

  • The three named proofs (extension smoke, concurrent spool/dedup, capture-gap
    fixture) already exist and pass — see Verification below.
  • devtools/dev_loop.py and docs/dev-loop.md had zero mention of the MCP
    server — no branch-local recipe existed for it at all.
  • Nothing detected the documented "known trap": a branch-local daemon keeps
    serving code from the commit it launched under even after the checkout
    switches branches, because Python already imported the old modules.

Solution

  • devtools/dev_loop.py: the launcher now records the launch-time commit as
    POLYLOGUE_DEV_LOOP_LAUNCH_COMMIT in the daemon's suggested/actual
    environment.
  • polylogue/daemon/http.py: GET /api/dev-loop re-derives the checkout's
    live HEAD on every call and reports launch_commit, current_commit, and a
    stale bool when they diverge. Never false-positives when no launch commit
    was recorded (production daemon, non-git checkout).
  • polylogue/daemon/web_shell.py: the dev: status chip renders the
    q-stale quality class with a (stale) label and a tooltip naming both
    commits when stale is true.
  • docs/dev-loop.md: added a "Stale-run-dir detection" section, an "MCP
    Server" section documenting the branch-local recipe (run
    polylogue-mcp/polylogue.mcp.cli:main with a branch-local
    POLYLOGUE_ARCHIVE_ROOT; never edit the operator's registered .mcp.json
    entry — that's the "prod-registered" instance other sessions rely on), the
    requested surface-isolation deliverable table (daemon/web/CLI-TUI/receiver/
    extension/MCP × isolation unit × cross-talk guard × stale-code detection),
    and a citation of the existing concurrent spool/dedup proof tests next to
    the receiver-smoke docs.

(An earlier revision of this branch also carried a type: ignore band-aid for
an unrelated pre-existing mypy failure in test_timestamp_guards.py; that has
been dropped after rebasing onto master, which now has the proper root-cause
fix from #3332. This PR's diff no longer touches that file.)

Verification

devtools test tests/unit/devtools/test_dev_loop.py \
  tests/unit/browser_capture/test_receiver.py \
  tests/unit/daemon/test_browser_capture_instance_attribution.py \
  tests/unit/daemon/test_daemon_http_contracts.py \
  tests/unit/daemon/test_web_reader.py
-> 284 passed

mypy --strict on all touched Python files: clean.
devtools verify --quick (post-rebase onto latest master): exit 0.

The bead's three named residual proofs are pre-existing and green:

  • Extension smoke: devtools workspace dev-loop --extension-smoke +
    tests/unit/devtools/test_dev_loop.py.
  • Concurrent spool/dedup: test_concurrent_new_session_writes_never_exceed_the_quota,
    test_multiple_receiver_processes_deduplicate_without_corrupting_spool,
    test_concurrent_extension_instances_deduplicate_without_corrupting_spool.
  • Capture-gap event fixture: polylogue/demo/seed.py::_write_demo_browser_capture_gap_sources,
    polylogue/demo/constructs.py::capture_gap_events, exercised by
    tests/unit/demo/test_demo_seed_verify.py, tests/unit/storage/test_archive_tiers_archive.py,
    tests/unit/storage/test_archive_tiers_write.py, tests/unit/scenarios/test_corpus.py,
    tests/integration/test_demo_daemon_convergence.py.

Ref polylogue-5en

🤖 Generated with Claude Code

@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, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@Sinity, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 45ec262d-4545-48c3-846e-0674ca1ff117

📥 Commits

Reviewing files that changed from the base of the PR and between 0534c62 and 1c0d2d1.

📒 Files selected for processing (6)
  • devtools/dev_loop.py
  • docs/dev-loop.md
  • polylogue/daemon/http.py
  • polylogue/daemon/web_shell.py
  • tests/unit/daemon/test_daemon_http_contracts.py
  • tests/unit/devtools/test_dev_loop.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/chore/5en-dev-loop-verify-close

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.

…n, MCP recipe)

Problem: polylogue-5en's acceptance criteria required a documented
branch-local recipe for every surface (daemon/web/extension/MCP) with
no cross-talk between two concurrent branches, plus stale-run-dir
warnings in at least the daemon and web cases. Auditing current
`master` against those AC found the daemon/web/extension/receiver dev
loop was already comprehensively built and tested, but two concrete
gaps remained: (1) `devtools/dev_loop.py` and `docs/dev-loop.md` had
zero mention of the MCP server at all, and (2) nothing detected the
documented "known trap": a branch-local daemon keeps serving code from
the commit it launched under even after the checkout switches
branches, because Python already imported the old modules.

What changed:
- `devtools/dev_loop.py`: the launcher now records the launch-time
  commit as `POLYLOGUE_DEV_LOOP_LAUNCH_COMMIT` in the daemon's
  suggested/actual environment.
- `polylogue/daemon/http.py`: `GET /api/dev-loop` now re-derives the
  checkout's live HEAD on every call and reports `launch_commit`,
  `current_commit`, and a `stale` bool when they diverge.
- `polylogue/daemon/web_shell.py`: the `dev:` status chip renders the
  `q-stale` quality class with a `(stale)` label and a tooltip naming
  both commits when `stale` is true.
- `docs/dev-loop.md`: added a "Stale-run-dir detection" section, an
  "MCP Server" section documenting the branch-local recipe (run
  `polylogue-mcp`/`polylogue.mcp.cli:main` with a branch-local
  `POLYLOGUE_ARCHIVE_ROOT`; never edit the operator's registered
  `.mcp.json` entry), the requested surface-isolation deliverable
  table, and a citation of the existing concurrent spool/dedup proof
  tests next to the receiver-smoke docs.

Verification: the bead's three named residual proofs (extension
smoke, concurrent spool/dedup test, capture-gap event fixture) already
existed and pass:
  devtools test tests/unit/devtools/test_dev_loop.py
    tests/unit/browser_capture/test_receiver.py
    tests/unit/daemon/test_browser_capture_instance_attribution.py
    tests/unit/daemon/test_daemon_http_contracts.py
    tests/unit/daemon/test_web_reader.py
  -> 284 passed
mypy --strict on the 4 touched Python files: clean.
`devtools verify --quick` surfaced two pre-existing, unrelated
failures (mypy stub drift in test_timestamp_guards.py; a flaky
demo-corpus-datasheet render that passes standalone) -- filed as
polylogue-q7ol, not fixed here (out of scope, both reproduce
identically on unmodified files).

Ref polylogue-5en

Co-Authored-By: Claude <[email protected]>
@Sinity
Sinity force-pushed the feature/chore/5en-dev-loop-verify-close branch from cb6383e to 1c0d2d1 Compare July 27, 2026 17:09
@Sinity
Sinity merged commit 8bafc32 into master Jul 27, 2026
3 checks passed
@Sinity
Sinity deleted the feature/chore/5en-dev-loop-verify-close branch July 27, 2026 17:10
Sinity added a commit that referenced this pull request Aug 19, 2026
## Summary

Deletes 5 of the 8 devtools modules the WS-C pruning ledger's tranche-1
table
listed for deletion, plus their catalog entries and tests. Three named
rows
(`dev_loop`, `mutmut_campaign`/`run_campaign`, `proof_world_real_slice`)
turned out to be live or contested on verification and are explicitly
excluded — see Problem below.

## Problem

`.agent/campaigns/2026-08-overhaul/ws-c-devtools-pruning.md` catalogs
~139
devtools modules toward a ~45k LOC / ~55 command target. Tranche 1 lists
8
"retired-workflow fossil" rows as high-confidence deletions, gated on a
per-row checklist (rule 5, "EVIDENCE BEFORE DELETION"): re-grep
`.beads-hooks/`, `.circleci/config.yml`, `.claude/hooks/`, `scripts/`,
and
`.github/workflows/*.yml` for module invocations before deleting,
because
string-keyed CLI dispatch and shell-invoked entrypoints don't show up in
an
import-graph grep (this is exactly how `pre_push_gate` and
`coverage_gate`
were wrongly flagged for deletion in the ledger's own 2026-08-18
correction
pass).

Re-running that checklist per row (the ledger's 2026-08-19 spot-check
had
already run it, but omitted `.github/workflows/*.yml` from the grep
target
list) found two more wrong entries before this PR was first opened, and
a
third was caught afterward by cold adversarial re-verification:

- **`dev_loop` (3,844 LOC + a cited product-side family in
`daemon/http.py`,
`daemon/cli.py`, `route_contracts.py`)** is not dead. It's
catalog-registered
  as `workspace dev-loop` with a large flag surface

(`--prepare`/`--launch-daemon`/`--capture-cli`/`--receiver-smoke`/etc.),
has
a 1,629-line test file, and a 757-line doc (`docs/dev-loop.md`) linked
from
`docs/README.md`'s nav — last touched by a real feature commit 5 days
before
this PR (#3333, "close remaining polylogue-5en gaps"). The ledger's
citation
("devloop workflow explicitly retired, CLAUDE.md: do not resurrect") is
a
name collision: CLAUDE.md's retirement note is about the unrelated
bespoke
  Beads/conductor-packet workflow, not this branch-local
  daemon/browser-capture preflight tool.
- **`mutmut_campaign` + `run_campaign` (624 LOC)** are two unrelated
modules
the ledger conflated by name similarity. `mutmut_campaign.py` (catalog:
  `bench mutation`) is invoked weekly by
  `.github/workflows/mutation-testing.yml` (`devtools bench mutation run
  "$campaign"`) — exactly the grep the spot-check missed by skipping
`.github/workflows/`. `run_campaign.py` (catalog: `bench synthetic`) is
a
  separate, live-tested command

(`test_benchmark_campaigns.py::test_run_campaign_skips_seed_archive_for_daemon_live`)
driving the ledger's own NEEDS-EVIDENCE/default-keep
`large_archive_generator`
+ `synthetic_benchmark_runtime` modules; it has nothing to do with
mutation
  testing.
- **AUDITED AND EXCLUDED (found by cold verification after this PR's
first
push, restored in a follow-up commit): `proof_world_real_slice` (440 LOC
+
test)**. The ledger's row cited it as belonging to the closed `jxe`
uplift
  campaign, but the module's own docstring and its test both cite
`polylogue-212.11` instead — an **open, P3** bead whose notes name this
  tool as "the harness half of the real-archive-data extension" with a
pending, unpromoted deliverable. Same name-collision failure class as
the
`dev_loop`/`mutmut_campaign` catches above, just missed on this row
during
  the original per-row pass. Restored verbatim (module, test, and the
  `demo real-slice-screen` CommandSpec) from before deletion.

All three exclusions were reported to the coordinator (the first two
before
this PR was opened, the third as soon as cold review surfaced it).

## Solution

Deletes the remaining 5 rows, each independently re-verified clean (no
hook/CI/doc/production references beyond the module's own catalog entry
and
test file):

- `claim_vs_evidence.py` + `claim_vs_evidence_evidence.py` (+ both test
  files) — the `polylogue-sru` campaign closed with terminal artifacts
  2026-07-06; this CLI re-proved an already-recorded claim. The durable
  production primitive it wrote through, `PublicClaimProjection`
(`polylogue/insights/measurement/public_claims.py`), is untouched and
lives
  independently. Trimmed `docs/findings/claim-vs-evidence.md`'s now-dead
"Reproduce"/"Regenerate" sections (they invoked the deleted command)
while
keeping the finding's substantive text as a frozen historical record —
the
2026-08-14 purge (#3950) had already retired "the closed
claim-vs-evidence
campaign's private-report/calibration/publishing harness" in spirit;
this
  PR finishes that.
- `turso_probe.py` (+ test) — Turso storage-backend research
(#2257/#2281,
June) concluded; direction settled on SQLite independence + Sinex mode.
- `resume_ranking_eval.py` (+ test) — orphan: no catalog entry, no
importers
  beyond its own test.
- `help_latency_probe.py` (no dedicated test file existed) — one-shot
  CLI-latency research; not wired into any gate.
- `temporal_read_profile.py` + `temporal_archive_aggregates.py` (+ both
test
  files) — one-shot read-profiling research (July 2).

Each deleted module's `CommandSpec` was removed from
`devtools/command_catalog.py`, then `devtools render devtools-reference`
regenerated `docs/devtools.md`. No CLAUDE.md tooling-list lines named
any of
the six deleted commands, so none needed trimming there.
`proof_world_real_slice`'s `CommandSpec` was restored to the same spot
in the
follow-up commit and `devtools render devtools-reference` re-run.

## Verification

- `devtools render all --check` — exit 0, no `out of sync` surfaces.
- `devtools verify --quick` — `"status": "success"`, `"exit_code": 0`
(run
  again after the `proof_world_real_slice` restore, still green).
- `devtools verify` (full, complete-corpus) — `"status": "success"`,
`"exit_code": 0`, `"terminal_green": true`, `"complete_corpus_covered":
  true`, `"non_green_count": 0`, `"release_baseline_allowed": true`.
- `devtools test tests/unit/devtools/test_proof_world_real_slice.py` —
20/20
  passed, confirming the restored module's tests are intact.
- `python -m devtools.verify_doc_commands` — `67 doc files scanned, no
stale
  commands` (caught and fixed one accidental literal reference to the
  now-deleted claim-vs-evidence command in the trimmed findings doc).

Anti-vacuity: pure deletion (plus one restoration); reachability
evidence per
surviving row is in the ledger plus the re-verification above (all rows
independently re-grepped against `.beads-hooks/`,
`.circleci/config.yml`,
`.claude/hooks/`, `scripts/`, `.git/hooks/`, and
`.github/workflows/*.yml`,
and cross-checked against `docs/` and git log recency).

## Bead disposition matrix

This PR does not close, claim, or otherwise mutate any Beads issue — it
is
pure code/doc deletion against the campaign's markdown ledger, not a
Beads
tracker item. `mutated_beads` is empty; using the `self_contained` scope
carrier. `polylogue-212.11` is cited as evidence for the
`proof_world_real_slice` exclusion but is not touched, claimed, or
closed by
this PR.

Candidate follow-ups for the coordinator (not closed by this PR):

| Item | Note |
| --- | --- |
| Tranche 1 revision | The ledger's tranche-1 table and its "Est. ~8.6k
LOC" total need updating to remove `dev_loop`,
`mutmut_campaign`/`run_campaign`, and `proof_world_real_slice` as
confirmed-live/contested, plus record the `.github/workflows/` gap in
the spot-check methodology so future tranches don't repeat it. |
| Tranche 2 execution | Unblocked to proceed independently; nothing in
this PR touches tranche-2 rows. |

## Verification commands run

```
devtools render all --check
devtools verify --quick
devtools verify
devtools test tests/unit/devtools/test_proof_world_real_slice.py
python -m devtools.verify_doc_commands
```
<!-- polylogue-pr-scope:v2
{
  "assigned_beads": [],
  "dispositions": [],
  "mutated_beads": [],
"scope_digest":
"79a7984a9ec80a157c96dc8d28561159c642c15de3793837eff751fa7eac34a1",
  "scope_kind": "self_contained",
  "version": 2
}
-->
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