Skip to content

docs: docs-coverage + visual/tour drift gates, receipts visual, reader-test harness - #2890

Merged
Sinity merged 8 commits into
masterfrom
feature/docs/legibility-cluster
Jul 14, 2026
Merged

Sinity merged 8 commits into
masterfrom
feature/docs/legibility-cluster

Conversation

@Sinity

@Sinity Sinity commented Jul 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

Implements a coherent slice of the docs/legibility + README-positioning bead
cluster: two new drift-detection gates (docs-coverage, visual-tape/tour
freshness), a real generated visual embedded in the README, a
reader-comprehension test harness, stale-doc fixes, and SECURITY.md.

Problem

Several beads in polylogue-3tl (external legibility) identified structural
gaps between what the docs claim and what the live surfaces/committed
artifacts actually are, with no gate to catch drift going forward:

  • devtools verify docs-coverage gap: nothing failed when a CLI command, MCP
    tool, config key, or daemon route shipped with zero doc-tree mention
    (polylogue-3tl.9).
  • render visual-tapes --check only proved tape specs generate cleanly, never
    that the committed .tape files still match — the kit shipped a stale
    demo-tour.tape twice in 2026-07, caught only by manual diff
    (polylogue-3tl.17). Nothing checked the demo tour's emitted evidence
    (transcript, report, per-step output) against the committed fixture either.
  • 3tl.19's reader-comprehension question ("does the README actually land with
    a stranger, not just read as structurally true?") had no measurement tool.
  • polylogue-ttu's 2026-07-09 audit flagged docs/onboarding.md and
    docs/export.md as stale-doc candidates, unverified.
  • polylogue-3tl.8's GitHub-surface audit found a missing SECURITY.md.

Solution

devtools/verify_docs_coverage.py (new, wired into verify --quick):
reverse-direction lint over four typed inventories (CLI commands via
iter_command_paths, MCP tools via EXPECTED_TOOL_NAMES, config keys via
config_inventory_by_key, stable daemon routes via ROUTE_CONTRACTS),
checking each is named somewhere in README.md/docs/**/*.md. 125
pre-existing gaps at introduction are tracked as a ratchet in
docs/plans/docs-coverage-baseline.yaml (not a growable allowlist — stale
entries are reported so the file can't quietly outlive its debt).
devtools/render_mcp_tool_index.py generates a full tool-name appendix in
docs/mcp-reference.md, which retired the entire 40-tool MCP gap instead of
leaving it as baseline debt.

devtools/render_visual_tapes.py --check: now byte-compares each
generated tape against docs/examples/visual-tapes/*.tape with a diff on
drift, in addition to the existing "generates cleanly" check.

devtools/verify_demo_tour_freshness.py (devtools lab policy demo-tour-freshness): runs the real polylogue demo tour and diffs its
transcript/report/command-output/recording-tape against the committed
docs/examples/demo-tour/ fixture, masking only wall-clock duration numbers.
This immediately caught real drift — the committed fixture was stale against
the current demo corpus (13→15 sessions, 34→37 declared constructs, an extra
Edit tool-call row) — so docs/examples/demo-tour/ is regenerated in this
PR.

README: embeds the real, already-generated
docs/examples/visual-tapes/evidence-receipt.png directly under the demo receipts --compact command, captioned with the two gates that now keep it
honest. Deliberately does not restructure the existing capability list or
add an unmeasured uvx install command — those are unvalidated positioning
bets reserved for the reader-comprehension harness, not made without
measurement.

docs/examples/reader-comprehension-test/ (new): a self-contained,
offline HTML tool adapted from an external design study's working prototype
(protocol reused, not its generated code) — single-blind N-arm cold-reader
test with randomized timed exposure, unaided-then-revealed question flow,
independent scoring, localStorage persistence, JSON/CSV export. Scoring
rubric anchors to docs/demos.md's existing
claim/oracle/controls/falsifier/non-claims doctrine instead of a parallel
scheme. Ships with zero arms pre-populated (the original screenshots
don't exist in this repo) — an unconfigured arm shows an explicit
placeholder, not a silently-broken image.

docs/onboarding.md / docs/export.md: fixed two real breaks found by
verifying against the live CLI (polylogue --latest open → exits 2, no such
command; corrected to --latest read; a stale search, list, stats, export
CLI description contradicting the documented strict-command-floor verb set;
a claude-ai: origin prefix corrected to the real claude-ai-export: token).

SECURITY.md (new): loopback-posture summary, supported-versions note,
and a vulnerability-reporting contact pointing at GitHub's private advisory
flow, linking out to the existing docs/security.md /
docs/daemon-threat-model.md for full detail.

What was NOT done (honest AC status — full matrix below)

  • 3tl.9 AC2 (visual freshness for arbitrary screenshots/GIFs) — the
    bead's own notes flag this as "a natural split candidate"; only the
    tape/tour slice (3tl.17) is implemented here.
  • 3tl.9's front-matter-generation mechanism: attempted, then reverted.
    Converting DOCS_REFERENCE_ENTRIES/README_DOC_TITLES from a hand
    tuple to front-matter-scanned generation touches 88 doc files plus ~6
    generator modules that fully rewrite their target doc (each would need
    front-matter-preservation logic), and the site builder has no
    front-matter-stripping step. Too large a blast radius to land safely in
    this pass without separate verification; the concrete schema and blast
    radius are now known for a focused follow-up.
  • ttu: only the two explicitly-flagged stale-doc candidates were
    verified/fixed, not the full 68-file claim-by-claim sweep (that's
    polylogue-ccma, explicitly sequenced after this bead).
  • 3tl.19 AC3: no real 3-arm run — needs real generated README-variant
    screenshots and real independent readers, both out of scope here.
  • 3tl.8: repo description/topics/homepage/Discussions were already
    correct (a prior pass landed them; the 2026-07-09 audit note is stale).
    Wiki-should-be-OFF and an issue-template UX finding are noted but not
    acted on (live-settings/UX changes deserving explicit operator sign-off).
  • 3tl.10: not touched beyond confirming devtools verify public-claims
    is green — writing launch copy needs operator review before anything
    externally-facing ships, per the bead's own "never ship unreviewed" note.

Verification

devtools test tests/unit/devtools/test_verify_docs_coverage.py \
  tests/unit/devtools/test_render_visual_tapes.py \
  tests/unit/devtools/test_verify_demo_tour_freshness.py \
  tests/unit/devtools/test_render_docs_surface.py
# -> 18 passed

devtools test tests/unit/cli/test_demo_command.py
# -> 9 passed

devtools render all --check
# -> sync OK, no drift

devtools verify --quick
# -> exit_code 0 (all 16 steps green, includes the new "verify docs-coverage" step)

devtools verify doc-commands
# -> 84 doc files scanned, no stale commands

devtools verify public-claims
# -> public claims: ok (9 claims, 17 evidence paths, 4 proof commands, 5 public surfaces)

devtools lab policy demo-tour-freshness
# -> fresh tour output matches committed docs/examples/demo-tour/ (masked)

CI is disabled repo-wide (billing-locked); all checks above ran locally.

Ref polylogue-3tl.9, polylogue-3tl.17, polylogue-3tl.12, polylogue-3tl.19,
polylogue-ttu, polylogue-3tl.8, polylogue-3tl.10

Co-Authored-By: Claude [email protected]

Summary by CodeRabbit

  • New Features

    • Added a standalone reader-comprehension test harness with timed screenshot exposure, scoring, local session storage, and JSON/CSV export.
    • Added an exhaustive registered-tools index to the MCP reference.
    • Added a published security policy covering local operation, authentication, browser capture, supported versions, and vulnerability reporting.
  • Documentation

    • Expanded developer-tool, onboarding, export, example, and security documentation.
    • Added visual evidence and refreshed deterministic demo-tour examples.
  • Bug Fixes

    • Added checks that detect documentation gaps, demo evidence drift, and visual-tape mismatches.

Sinity and others added 6 commits July 14, 2026 12:09
Problem: nothing failed when a public CLI command, MCP tool, config key,
or daemon route shipped with zero doc-tree mention (polylogue-3tl.9), and
`render visual-tapes --check` only proved specs generate cleanly, never
that the committed .tape files (or the tour's emitted evidence artifacts)
still match what the generator/tour actually produces -- the kit shipped a
stale demo-tour.tape twice in 2026-07 with every prior gate green
(polylogue-3tl.17).

What changed:
- devtools/verify_docs_coverage.py: reverse-direction lint over four typed
  inventories (CLI commands, MCP tools, config keys, stable daemon routes)
  checking each is named somewhere in README.md/docs/**/*.md. Pre-existing
  gaps (125 at introduction) are tracked as a ratchet in
  docs/plans/docs-coverage-baseline.yaml, not silently allowed to grow;
  stale baseline entries are reported so the file can't quietly outlive the
  debt it records. Wired into `devtools verify --quick`.
- devtools/render_mcp_tool_index.py: generated appendix in
  docs/mcp-reference.md enumerating every EXPECTED_TOOL_NAMES entry, which
  retired the entire 40-tool MCP gap from the coverage baseline instead of
  leaving it as tracked debt.
- devtools/render_visual_tapes.py --check: now byte-compares each generated
  tape against docs/examples/visual-tapes/*.tape and fails with a diff on
  drift, in addition to the existing "generates cleanly" check.
- devtools/verify_demo_tour_freshness.py (`devtools lab policy
  demo-tour-freshness`): runs the real `polylogue demo tour` and diffs its
  transcript/report/command-output/recording-tape against the committed
  docs/examples/demo-tour/ fixture, masking only wall-clock duration
  numbers. This immediately caught real drift -- the committed fixture was
  stale against the current demo corpus (13->15 sessions, 34->37 declared
  constructs, an extra Edit tool-call row) -- so docs/examples/demo-tour/
  is regenerated in this commit.

Verification:
- devtools test tests/unit/devtools/test_verify_docs_coverage.py \
    tests/unit/devtools/test_render_visual_tapes.py \
    tests/unit/devtools/test_verify_demo_tour_freshness.py -> 13 passed
- devtools render all --check -> sync OK, no drift
- ruff format --check / ruff check / mypy on all touched devtools modules -> clean
- devtools lab policy demo-tour-freshness -> fresh tour output matches committed evidence

Ref polylogue-3tl.9, polylogue-3tl.17

Co-Authored-By: Claude <[email protected]>
Problem: 3tl.12 asks the README to lead with one deterministic
claim-vs-evidence proof and its visual, immediately below the fold, not
buried in prose. The README's "Run the first proof" section already led
with `demo receipts --compact` and an accurate prose walkthrough (landed
2026-07-10), but had no visual -- readers had to run the command themselves
to see what "contradicted at claim time, then repaired" actually looks
like.

What changed: embeds docs/examples/visual-tapes/evidence-receipt.png (a
real, already-committed VHS capture of the exact demo receipts output,
generated by `devtools render visual-tapes --capture`) directly under the
demo command, with a caption naming the two drift gates that now keep it
honest: `devtools render visual-tapes --check` (recipe-vs-committed-tape)
and `devtools lab policy demo-tour-freshness` (emitted-evidence-vs-committed,
added this branch). No hand-authored visual, no new unmeasured install
command, no restructuring of the existing capability list -- that is an
unvalidated positioning bet reserved for 3tl.19's reader-comprehension
harness, not made here without measurement.

Verification:
- devtools verify doc-commands -> 83 doc files scanned, no stale commands
- devtools render all --check -> sync OK, no drift

Ref polylogue-3tl.12

Co-Authored-By: Claude <[email protected]>
Problem: no existing mechanism measured whether a README/positioning
candidate actually lands with a real reader, only whether its claims are
structurally true. 3tl.12's receipts-first pivot (and any future
positioning change) is a bet about what a stranger remembers and can act
on, not just about correctness.

What changed: adapts the external design study's working HTML prototype
(.agent/scratch/readme-positioning-2026-07-14/reader-test-runner.html,
gitignored, protocol reused not its generated code) into a real repo
artifact at docs/examples/reader-comprehension-test/:
- reader-test-runner.html: self-contained, offline, single-blind N-arm
  cold-reader test (randomized timed exposure, unaided-then-revealed
  question flow, independent scoring, localStorage persistence, JSON/CSV
  export). Ships with zero arms pre-populated -- the original prototype's
  ../prototypes/screenshots/*.png paths do not exist in this repo, so an
  unconfigured arm now shows an explicit "no screenshot configured"
  placeholder instead of a silently-broken <img>.
- README.md: maps the scoring rubric onto docs/demos.md's existing
  claim/oracle/controls/falsifier/non-claims doctrine instead of a parallel
  scheme, states explicit non-claims (no population-prevalence claim from a
  handful of sessions, no downstream-agent-performance claim), and states
  the honest status: harness built and doctrine-aligned, but AC3 (a real
  3-arm run producing a decision-grade result) is deferred -- it needs real
  generated README-variant screenshots and real independent readers, both
  out of scope here.

Registered in devtools/docs_surface.py (tier=evidence) so it doesn't ship
as an orphaned doc.

Verification:
- devtools render all --check -> sync OK, no drift
- devtools verify docs-coverage -> clean

Ref polylogue-3tl.19

Co-Authored-By: Claude <[email protected]>
Problem: polylogue-ttu's 2026-07-09 audit flagged docs/onboarding.md and
docs/export.md as stale-doc candidates "by name/date only, not verified".
Verifying them against the live CLI found two real breaks:

- onboarding.md: `polylogue --latest open` exits 2 ("No such command
  'open'") -- `open` was never a registered verb; the working equivalent is
  `polylogue --latest read`. The executables table also described the CLI
  as "search, list, stats, export", which CLAUDE.md's own strict
  command-floor doctrine (#1842) explicitly says does not exist ("no
  list/show/stats verb") -- corrected to the real verb set.
- export.md: three `--id claude-ai:abc123` examples used a bare `claude-ai`
  origin prefix; the public origin token is `claude-ai-export`
  (docs/provider-origin-identity.md). The CLI doesn't reject an unknown
  prefix outright (it reports "session not found" either way), so this
  didn't fail doc-commands, but it modeled the wrong session_id shape.

This is a narrow triage pass on the two candidates the bead's own notes
named, not the full claim-by-claim sweep across all 68 docs/*.md files --
that remains polylogue-ccma, explicitly sequenced after this bead.

Verification:
- devtools verify doc-commands -> 84 doc files scanned, no stale commands
- devtools render all --check -> sync OK

Ref polylogue-ttu

Co-Authored-By: Claude <[email protected]>
Problem: the 2026-07-09 GitHub-surface audit found the repo had no
SECURITY.md -- GitHub's community-profile API confirms this is still true
today (issue_template/pull_request_template/license/contributing/readme
are all set; security is absent). Meanwhile repo description, topics,
homepage, and Discussions-off already match the audit's target state
(landed by a prior legibility pass), so this bead's remaining concrete gap
was specifically the missing file.

What changed: adds a root SECURITY.md with the loopback-posture statement
(single-user, loopback-default, bearer/web-credential auth, exact-origin
mutation checks, disk-encryption-is-the-OS's-job), a Supported Versions
note (pre-1.0, master + latest release only), and a Reporting a
Vulnerability section pointing at GitHub's private security-advisory flow.
It links out to the existing docs/security.md and
docs/daemon-threat-model.md for the full trust-boundary/asset/mitigation
detail rather than duplicating it. Registered in
devtools/docs_surface.py's REPO_GUIDE_ENTRIES so it's reachable from the
generated docs index.

Deferred, not done: the Wiki-tab-should-likely-be-OFF flag from the audit
(a live repo-settings toggle, not a file change -- left for an explicit
operator decision since I could not confirm the wiki is genuinely empty
before disabling it) and a redesign of the issue templates' internal-facing
"acceptance criteria" field for first-time external reporters (a real,
evidence-backed finding -- .github/ISSUE_TEMPLATE/02-bug-or-regression.yml
reads slightly operator-facing -- but a template UX change, not a doc fix,
and out of scope for this pass).

Verification:
- devtools render all --check -> sync OK
- devtools verify doc-commands -> 84 doc files scanned, no stale commands
- gh repo view Sinity/polylogue --json description,repositoryTopics,... ->
  confirms description/topics/homepage/Discussions already match target

Ref polylogue-3tl.8

Co-Authored-By: Claude <[email protected]>
devtools verify --quick caught this before push: monkeypatch fixture
parameters need an explicit pytest.MonkeyPatch annotation under
mypy --strict, and `isinstance(x, str) and x` reads as a redundant
truthiness check once mypy narrows x to str -- split into two asserts.

Verification: devtools verify --quick -> exit_code 0 (previously failed on
mypy for this file).

Co-Authored-By: Claude <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 14, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 49 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

Run ID: 53e1df1e-2230-485d-98a5-04d38e97f182

📥 Commits

Reviewing files that changed from the base of the PR and between 02a2c70 and 1c96d35.

📒 Files selected for processing (5)
  • devtools/render_mcp_tool_index.py
  • devtools/render_visual_tapes.py
  • devtools/verify_demo_tour_freshness.py
  • docs/examples/reader-comprehension-test/reader-test-runner.html
  • tests/unit/devtools/test_verify.py
📝 Walkthrough

Walkthrough

This PR adds documentation-coverage and demo-freshness verification commands, generated MCP tool indexing, visual-tape drift checks, refreshed demo evidence, a reader-comprehension test harness, and a repository security policy.

Changes

Verification and evidence integrity

Layer / File(s) Summary
Documentation coverage and verification gates
devtools/command_catalog.py, devtools/verify.py, devtools/verify_docs_coverage.py, docs/plans/..., tests/unit/devtools/test_verify*.py, docs/devtools.md
Registers new verification commands, checks CLI/MCP/config/route documentation coverage against a YAML baseline, and adds verification tests.
Generated MCP tool index
devtools/generated_surfaces.py, devtools/render_mcp_tool_index.py, docs/mcp-reference.md, docs/devtools.md
Generates and maintains a sorted list of registered MCP tools in the reference documentation.
Deterministic evidence freshness checks
devtools/render_visual_tapes.py, devtools/verify_demo_tour_freshness.py, tests/unit/devtools/*, docs/examples/demo-tour/*, README.md
Checks committed visual tapes and demo-tour artifacts against fresh output while masking only volatile duration fields, with updated fixtures and regression tests.
Reader harness and repository documentation
SECURITY.md, docs/examples/reader-comprehension-test/*, devtools/docs_surface.py, docs/README.md, docs/onboarding.md, docs/export.md
Adds the security policy, reader-comprehension runner and documentation, and updates public documentation links and examples.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Developer
  participant DevtoolsVerify
  participant EvidenceChecks
  participant Documentation
  Developer->>DevtoolsVerify: run verification gates
  DevtoolsVerify->>EvidenceChecks: run coverage and freshness commands
  EvidenceChecks->>Documentation: compare generated and committed surfaces
  Documentation-->>DevtoolsVerify: return pass or drift diagnostics
Loading

Possibly related issues

Possibly related PRs

Suggested labels: type:feat, area:qa, area:docs, type:test

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is detailed, but it omits the required Changelog section and doesn't use the template's Risks and Follow-ups heading. Add a Changelog entry for the user-visible docs and security changes, and rename or replace 'What was NOT done' with a Risks and Follow-ups section.
Docstring Coverage ⚠️ Warning Docstring coverage is 42.55% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main changes: docs coverage, drift gates, README evidence, and the reader test harness.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/docs/legibility-cluster

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.

@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: e3ed498fbe

ℹ️ 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 devtools/verify_demo_tour_freshness.py Resolved
Comment thread devtools/command_catalog.py Resolved
Problem: `lab policy demo-tour-freshness` (polylogue-3tl.17) was registered
in command_catalog.py and documented as living in the lab verification
tier, but never appended in build_verify_steps()'s `if lab:` block --
`devtools verify --lab`/`--all` and plain `verify` never ran it
automatically, reachable only by a human remembering the standalone
command. Separately, the freshness diff's comparable-file list omitted
report.json even though the tour regenerates it and it carries structured
fields (claim/oracle/falsifier/construct-coverage) not fully mirrored in
the other compared artifacts, so report.json could go stale silently.
Both flagged inline by CodeRabbit on e3ed498 and reproduced by an
independent review of this branch.

What changed:
- devtools/verify.py: append "lab policy demo-tour-freshness" to the
  `if lab:` step list next to demo-packet-registry.
- devtools/verify_demo_tour_freshness.py: add report.json to
  _iter_comparable_relpaths, plus a JSON-aware mask_volatile_json that
  zeroes exactly the three known wall-clock fields
  (first_result_s/total_duration_s/steps[*].duration_s) and re-serializes
  with the same indent=2/sort_keys=True the tour itself uses -- every
  other field (construct-coverage counts, claim/oracle text, exit codes)
  must still match exactly. The prior plain-text `\d+\.\d+s` regex cannot
  see these because JSON stores them as bare numbers with no trailing "s".
- tests: new coverage for mask_volatile_json (masks only declared keys,
  still flags a real construct-coverage drift), report.json wired into the
  seeded end-to-end diff test, and a regression guard
  (test_lab_verify_runs_every_registered_lab_policy_command) asserting
  every registered `lab policy *` CommandSpec appears in the `--lab` step
  list, so this exact registered-but-unwired failure mode cannot recur
  silently for any future lab policy gate.

Verification:
- devtools test tests/unit/devtools/test_verify_demo_tour_freshness.py -> 6 passed
- devtools test tests/unit/devtools/test_verify.py -k lab_verify -> 3 passed
- devtools lab policy demo-tour-freshness -> "fresh tour output matches
  committed docs/examples/demo-tour/ (masked)"
- python3 -c "from devtools.verify import build_verify_steps; ..." confirms
  "lab policy demo-tour-freshness" is present when lab=True
- devtools verify --quick -> exit_code 0 (33s)
- devtools test tests/unit/devtools/test_verify.py (full file) -> 61
  passed, 1 pre-existing failure (test_quick_verify_omits_pytest, a stale
  golden step-list unrelated to this change -- reproduced identically on
  base commit e3ed498 before this diff)

Ref polylogue-3tl.17
Co-Authored-By: Claude <[email protected]>

@coderabbitai coderabbitai 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.

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@devtools/render_mcp_tool_index.py`:
- Around line 54-55: Update the end-marker lookup in the surrounding parser
logic to call text.find with start as the search offset, ensuring the closing
marker is found only after the opening marker; retain the existing invalid-order
and not-found handling.

In `@devtools/render_visual_tapes.py`:
- Around line 58-75: Update _print_drift to accept a committed_dir parameter and
use it for the missing-tape and differing-content paths, with callers passing
the directory used for the drift check. Move the lazy import of difflib to the
start of _print_drift, outside the loop, while preserving the existing diff
output.

In `@devtools/verify_demo_tour_freshness.py`:
- Around line 126-139: Update the comparison logic in the mismatch-building
function to iterate over the union of comparable relative paths from both
COMMITTED_DIR and out_dir, rather than only
_iter_comparable_relpaths(COMMITTED_DIR). Preserve the existing masking and
comparison behavior, and record artifacts missing from either directory
symmetrically.
- Around line 159-165: Update the unified diff generation in the freshness
verification flow to split inputs without retaining line endings, set
difflib.unified_diff’s lineterm to an empty string, and output each yielded diff
line with print so lines from newline-less files cannot concatenate with
subsequent output.

In `@docs/examples/reader-comprehension-test/reader-test-runner.html`:
- Around line 204-212: Update the start-button handler to clear any existing
interval referenced by timerId before assigning a new setInterval, then reset
timerId as appropriate when exposure completes. Preserve the existing randomized
setup and countdown behavior while ensuring repeated starts cannot leave an
earlier timer running.
- Around line 154-173: Update renderArmEditor and fillFixedSelect to escape
user-provided arm names and screenshot paths before interpolating them into
innerHTML, including both input attributes and option values/text. Reuse or add
a small HTML-escaping helper covering characters such as &, <, >, quotes, and
apostrophes, while preserving the existing rendered values and editor behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8a574475-df00-484b-81bc-adaa7818b2b8

📥 Commits

Reviewing files that changed from the base of the PR and between 3796f54 and 02a2c70.

📒 Files selected for processing (29)
  • README.md
  • SECURITY.md
  • devtools/command_catalog.py
  • devtools/docs_surface.py
  • devtools/generated_surfaces.py
  • devtools/render_mcp_tool_index.py
  • devtools/render_visual_tapes.py
  • devtools/verify.py
  • devtools/verify_demo_tour_freshness.py
  • devtools/verify_docs_coverage.py
  • docs/README.md
  • docs/devtools.md
  • docs/examples/README.md
  • docs/examples/demo-tour/command-output/01-claim-versus-receipt.txt
  • docs/examples/demo-tour/command-output/02-failed-actions-aggregate.txt
  • docs/examples/demo-tour/command-output/04-archive-facets.txt
  • docs/examples/demo-tour/report.json
  • docs/examples/demo-tour/report.md
  • docs/examples/demo-tour/transcript.txt
  • docs/examples/reader-comprehension-test/README.md
  • docs/examples/reader-comprehension-test/reader-test-runner.html
  • docs/export.md
  • docs/mcp-reference.md
  • docs/onboarding.md
  • docs/plans/docs-coverage-baseline.yaml
  • tests/unit/devtools/test_render_visual_tapes.py
  • tests/unit/devtools/test_verify.py
  • tests/unit/devtools/test_verify_demo_tour_freshness.py
  • tests/unit/devtools/test_verify_docs_coverage.py

Comment thread devtools/render_mcp_tool_index.py Resolved
Comment thread devtools/render_visual_tapes.py Resolved
Comment thread devtools/verify_demo_tour_freshness.py Resolved
Comment thread devtools/verify_demo_tour_freshness.py Resolved
Problem: automated review on PR #2890 (docs-coverage + visual/tour drift
gates) flagged six actionable issues: a marker-search bug that could match
an END marker before its BEGIN marker, hardcoded drift-report paths instead
of the caller-supplied directory, an asymmetric tour-freshness comparison
that silently skipped files present only in the fresh output, a unified-diff
call that could concatenate lines when inputs lack a trailing newline, an
unbounded setInterval in the reader-test-runner that could leave a stale
timer running after a repeated Start click, and unescaped arm
name/screenshot-path interpolation into innerHTML.

What changed:
- render_mcp_tool_index.py: search for the END marker starting from the
  BEGIN marker's position instead of from 0, so an earlier stray END-shaped
  string cannot be matched first.
- render_visual_tapes.py: `_print_drift` takes an explicit `committed_dir`
  parameter instead of reading the module-level default directly; moved the
  `difflib` import to module scope instead of inside the print loop.
- verify_demo_tour_freshness.py: compare the union of comparable relpaths
  from both the committed fixture and the freshly-run output (not just the
  committed side), so a file the tour emits that the fixture never had is
  reported as a mismatch instead of silently skipped; the unified diff now
  splits without keepends and prints line-by-line with `lineterm=""` so a
  missing trailing newline cannot glue two lines together in the report.
- reader-test-runner.html: clear any existing exposure-timer interval before
  starting a new one (both on Start and inside hide()); added an
  `escapeHtml` helper and applied it to arm name/path interpolation into
  `innerHTML`.
- tests/unit/devtools/test_verify.py: `test_quick_verify_omits_pytest` was
  stale relative to `build_verify_steps` on `origin/master` (missing "verify
  degrade-loudly", pre-existing gap) and relative to this PR's own
  docs-coverage step (missing "verify docs-coverage") — synced the expected
  step list to match the real quick-verify pipeline.

Verification:
  mypy --strict devtools/render_mcp_tool_index.py devtools/render_visual_tapes.py devtools/verify_demo_tour_freshness.py
  -> Success: no issues found in 3 source files

  devtools test tests/unit/devtools/test_verify_docs_coverage.py \
    tests/unit/devtools/test_render_visual_tapes.py \
    tests/unit/devtools/test_verify_demo_tour_freshness.py \
    tests/unit/devtools/test_render_docs_surface.py \
    tests/unit/devtools/test_verify.py \
    tests/unit/cli/test_demo_command.py
  -> 91 passed

  devtools verify --quick
  -> exit_code 0 (16 steps green, includes verify docs-coverage + verify degrade-loudly)

  devtools lab policy demo-tour-freshness
  -> fresh tour output matches committed docs/examples/demo-tour/ (masked)

Ref polylogue-3tl.9, polylogue-3tl.17

Co-Authored-By: Claude <[email protected]>
@Sinity

Sinity commented Jul 14, 2026

Copy link
Copy Markdown
Owner Author

Triaged and fixed all 6 actionable findings in 1c96d35:

  1. render_mcp_tool_index.py: END-marker search now starts from the BEGIN marker's position (text.find(end, start)).
  2. render_visual_tapes.py: _print_drift now takes an explicit committed_dir parameter; moved the difflib import to module scope.
  3. verify_demo_tour_freshness.py: comparison now iterates the union of comparable relpaths from both the committed fixture and the fresh output, so a file the tour emits that the fixture never had is reported as a mismatch instead of silently skipped.
  4. verify_demo_tour_freshness.py: unified diff now splits without keepends and prints line-by-line with lineterm="", so a missing trailing newline can't glue two lines together in the printed diff.
  5. reader-test-runner.html: clears any existing exposure-timer interval before starting a new one (Start button and hide()), so a repeated Start click can't leave a stale timer running.
  6. reader-test-runner.html: added an escapeHtml helper and applied it to arm name/screenshot-path interpolation into innerHTML.

Also caught and fixed a pre-existing drift in tests/unit/devtools/test_verify.py::test_quick_verify_omits_pytest while re-verifying (missing "verify degrade-loudly" — a gap that predates this PR on origin/master — and missing "verify docs-coverage" from this PR's own step).

Verification: mypy --strict on the 3 touched Python files (clean), the affected pytest set (91 passed), devtools verify --quick (exit 0, 16/16 steps), devtools lab policy demo-tour-freshness (fresh).

@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

  • 53.F064 / P2: stale at the checked revision: The old tour-freshness registration and verify --lab path are absent at the pin. Current command declarations expose named gates and scenarios rather than promising the removed lab-tour freshness gate. Current code: devtools/command_catalog.py:235; devtools/command_catalog.py:254.

Only the rows listed above are dispositioned. Held findings remain open.

@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

Only the rows listed above are dispositioned. Held findings remain open.

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