Skip to content

refactor: split roadmap inventory policy ownership - #300

Open
flyingrobots wants to merge 4 commits into
mainfrom
agent/split-roadmap-inventory-checker
Open

refactor: split roadmap inventory policy ownership#300
flyingrobots wants to merge 4 commits into
mainfrom
agent/split-roadmap-inventory-checker

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Aug 7, 2026

Copy link
Copy Markdown
Owner

What changed

Extract architecture-accountability Markdown interpretation and diagnostics into a pure policy module, leaving primary-marker and issue-state reconciliation in the inventory owner and transport in the runner. Enforce separate line/helper ceilings with meaningful headroom and preserve exact process behavior.

Closes #257

Evidence

  • node --test scripts/check-roadmap-inventory.test.mjs: 85/85 passed, including exact stdout/stderr characterization and cross-owner ownership-budget mutations.
  • PATH=/Users/james/.local/share/mise/installs/node/22.23.1/bin:$PATH bash scripts/release-prep.sh: passed the complete local release-preparation gate at 09dc60a. The gate packaged and installed a VSIX only inside its local smoke harness; it did not publish any extension or crate.
  • Hosted PR checks are green, including Rust, coverage, CodeQL, package witness, editor compile, downstream compatibility, generated drift, dependency/security, docs, and closure policy.
  • CodeRabbit review findings are addressed in 09dc60a; all 8 review threads are resolved.
  • Planned-case commit: 7f11c07; failing-evidence commit: 63352cd; passing-implementation commit: 9a69be8; review-hardening commit: 09dc60a.

Checklist

  • Living references (README / docs/topics/<topic>/README.md) describe only implemented behavior.
  • Planned cases RM-15b and RM-15c are marked implemented with their evidence.
  • CHANGELOG.md and ROADMAP.md record the delivered slice.
  • cargo fmt, warning-denying cargo clippy, and locked workspace tests pass locally.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

Summary by CodeRabbit

  • New Features

    • Added dedicated validation for roadmap architecture-accountability sections.
    • Validates canonical headings and tables, Markdown formatting, unique mechanisms, and source locations.
    • Added clear success and failure process-output contracts.
  • Bug Fixes

    • Detects malformed or duplicated accountability entries, including content hidden in comments.
    • Preserves validation behavior while improving handling of issue-state mismatches and malformed markers.
  • Documentation

    • Updated the roadmap, changelog, maintenance guidance, ownership measurements, and test plan.

Walkthrough

The PR extracts roadmap accountability validation into a dedicated policy module. The inventory checker delegates to it. Tests enforce process contracts, ownership boundaries, and per-owner source budgets. Documentation records the completed decomposition.

Changes

Roadmap policy ownership

Layer / File(s) Summary
Accountability policy implementation
scripts/roadmap-accountability-policy.mjs
Adds Markdown/GFM validation for canonical headings, tables, mechanism cells, comments, escapes, duplicates, malformed structures, and source locations.
Inventory checker delegation
scripts/check-roadmap-inventory.mjs
Removes embedded accountability parsing and delegates validation to validateArchitectureAccountability.
Process and ownership contract tests
scripts/check-roadmap-inventory.test.mjs
Adds subprocess contract coverage and checks parser ownership, transport isolation, source budgets, and duplicate-logic rejection.
Maintenance records and test plan
docs/workflows/repository-maintenance/README.md, docs/workflows/repository-maintenance/test-plan.md, CHANGELOG.md, ROADMAP.md
Documents the three owners, independent measurements, characterization coverage, and completed roadmap work.

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

Sequence Diagram(s)

sequenceDiagram
  participant InventoryCLI
  participant parseRoadmapInventory
  participant validateArchitectureAccountability
  InventoryCLI->>parseRoadmapInventory: Read roadmap and issue fixtures
  parseRoadmapInventory->>validateArchitectureAccountability: Validate accountability Markdown
  validateArchitectureAccountability-->>parseRoadmapInventory: Parsed tree or source-located error
  parseRoadmapInventory-->>InventoryCLI: Inventory result and process output
Loading

Possibly related PRs

Poem

Markdown tables stand in line,
Policy guards each strict design.
Inventory calls the keeper true,
Tests catch drift before it grew.
Three owners hold the roadmap bright.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes address issue #257 through policy extraction, characterization tests, per-owner budgets, documentation updates, regression coverage, and release-gate evidence.
Out of Scope Changes check ✅ Passed The code, tests, documentation, changelog, and roadmap updates are directly related to the requirements in issue #257.
Title check ✅ Passed The title clearly and concisely describes the main ownership-splitting refactor.
Description check ✅ Passed The description covers the required changes, evidence, issue closure, checklist, and commit-shape information.

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.

@flyingrobots
flyingrobots marked this pull request as ready for review August 7, 2026 08:29

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

🤖 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 `@docs/workflows/repository-maintenance/test-plan.md`:
- Around line 394-412: Update RM-15c and RM-15b in the test plan to use
“Requirements” consistently, move numeric measurements out of “Evidence type,”
and record exact paths plus executed test names:
scripts/check-roadmap-inventory.mjs, scripts/roadmap-accountability-policy.mjs,
scripts/roadmap-inventory-runner.mjs, “delegates roadmap policy to bounded pure
owners,” and “pins exact process bytes across the roadmap ownership seam.”
Reconcile the transport runner’s 249/250 measurement with the “meaningful
maintenance headroom” claim by adjusting the ceiling or claim while preserving
the stated budget behavior.

In `@ROADMAP.md`:
- Around line 193-197: Update the `#260` roadmap entry to remove the
already-delivered checker decomposition from its active backlog wording, leaving
only the remaining cursor-complete transport idea or explicitly noting that the
decomposition was delivered through `#257`. Keep the `#257` delivered entry and its
primary marker unchanged.

In `@scripts/check-roadmap-inventory.test.mjs`:
- Around line 1613-1628: Increase the roadmap transport runner line ceiling in
the budgets array to a reviewed value providing meaningful proportional
headroom, rather than the current 250-line limit. Update the corresponding
runner ceiling records in the README and test-plan documentation, including
RM-15c if the ceiling remains intentionally tight.
- Around line 1560-1565: Update sourceMeasurement to count top-level
function-valued bindings, including arrow functions and function expressions, in
addition to function declarations and class methods, so helper growth cannot
evade the budget. Then update the corresponding published helper measurements in
the maintenance README and test-plan documentation so the assertions in the
inventory tests remain consistent.
- Around line 1702-1714: Add digit boundaries to the interpolated measurement
values in the inventory and accountability RegExp assertions, so line and helper
counts match complete numeric tokens rather than substrings of larger numbers.
Update both patterns in the relevant assert.match checks while preserving their
existing text matching and error messages.

In `@scripts/roadmap-accountability-policy.mjs`:
- Around line 361-384: In the pipe-scanning logic, replace the local
precedingBackslashes parity loop with the existing isMarkdownEscaped helper.
Preserve the current behavior by continuing past escaped pipe characters and
only returning true for unescaped pipes outside inlineCodeRanges; remove the
now-unnecessary local counting code.
- Around line 18-19: Anchor the MARKDOWN_CHARACTER_REFERENCE regular expression
at the start so it only matches a character reference beginning at the probed
substring. Preserve the existing reference syntax and leave validateTextSource
behavior unchanged.
- Around line 187-233: Document on the exported
validateArchitectureAccountability seam that its fail callback must always throw
and never return, covering the invariant relied on by validateTextSource and the
other validation paths. Prefer a JSDoc contract on
validateArchitectureAccountability; alternatively, add explicit returns after
every fail call before subsequent values are dereferenced.
🪄 Autofix

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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d08ae66a-b9cc-4c80-ad16-48e418d5a024

📥 Commits

Reviewing files that changed from the base of the PR and between 4b9529b and 9a69be8.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • ROADMAP.md
  • docs/workflows/repository-maintenance/README.md
  • docs/workflows/repository-maintenance/test-plan.md
  • scripts/check-roadmap-inventory.mjs
  • scripts/check-roadmap-inventory.test.mjs
  • scripts/roadmap-accountability-policy.mjs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (7)
docs/workflows/**/README.md

📄 CodeRabbit inference engine (AGENTS.md)

Workflow README files must describe only implemented current truth; planned verification belongs in test-plan.md.

Files:

  • docs/workflows/repository-maintenance/README.md
docs/**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

New durable documentation pages must be linked from docs/README.md and follow the documentation corpus standard, including one primary reader job.

Files:

  • docs/workflows/repository-maintenance/README.md
  • docs/workflows/repository-maintenance/test-plan.md
**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

**/*.md: Use one logical change per commit and Conventional Commit prefixes such as feat, fix, docs, refactor, test, or chore.
Use runnable examples where practical, separate commands from expected output, omit shell prompts from copyable command blocks, warn before destructive or privileged commands, and provide useful visual alt text or nearby equivalents.
Treat prose metrics as editorial signals, not universal merge gates; hard gates concern links, examples, generated references, evidence, Markdown, whitespace, and contract coverage.
For documentation changes, run markdownlint-cli2, diff whitespace checks, internal-link checks, and documentation-citation checks.

Files:

  • docs/workflows/repository-maintenance/README.md
  • ROADMAP.md
  • CHANGELOG.md
  • docs/workflows/repository-maintenance/test-plan.md
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Do not force-push, rebase, squash, or amend shared branches; make a new commit instead.
Do not claim work or verification is complete unless it was actually performed; report failures with their output.
Do not casually regenerate golden fixtures; golden changes must be deliberate, reviewable, and tied to a contract change.

Files:

  • docs/workflows/repository-maintenance/README.md
  • ROADMAP.md
  • CHANGELOG.md
  • docs/workflows/repository-maintenance/test-plan.md
  • scripts/check-roadmap-inventory.mjs
  • scripts/check-roadmap-inventory.test.mjs
  • scripts/roadmap-accountability-policy.mjs
ROADMAP.md

📄 CodeRabbit inference engine (AGENTS.md)

Keep roadmap anchors synchronized with goalpost and issue status, and do not describe unbuilt goalposts as existing.

Files:

  • ROADMAP.md
CHANGELOG.md

📄 CodeRabbit inference engine (AGENTS.md)

Update the changelog for release-visible changes.

Files:

  • CHANGELOG.md
docs/workflows/**/test-plan.md

📄 CodeRabbit inference engine (AGENTS.md)

Before implementation, record planned cases with stable IDs, requirements, explicit oracles, evidence types, and status; later record actual evidence and mark implemented.

Files:

  • docs/workflows/repository-maintenance/test-plan.md
🧠 Learnings (3)
📚 Learning: 2026-07-30T04:29:07.448Z
Learnt from: flyingrobots
Repo: flyingrobots/colorful-language PR: 279
File: docs/workflows/evidence-toolchains/README.md:0-0
Timestamp: 2026-07-30T04:29:07.448Z
Learning: In this repository’s GitHub Actions workflow documentation (docs/workflows/**/*.md), require action references to be pinned and documented consistently: (1) For non-Docker third-party actions, use the full 40-character commit-SHA pin (not a tag/short SHA). (2) For `docker://` actions, use an immutable `sha256` image-digest pin. (3) When reviewing/referencing actions, include release/review comments on the same line as the action reference, and keep comments/references consistent for the same action identity when it appears in multiple workflows.

Applied to files:

  • docs/workflows/repository-maintenance/README.md
  • docs/workflows/repository-maintenance/test-plan.md
📚 Learning: 2026-07-30T04:29:22.377Z
Learnt from: flyingrobots
Repo: flyingrobots/colorful-language PR: 279
File: docs/workflows/evidence-toolchains/test-plan.md:170-195
Timestamp: 2026-07-30T04:29:22.377Z
Learning: In any `docs/workflows/**/test-plan.md` durable test-plan document, record evidence using concrete, long-lived repository references: include exact repository paths plus the precise names of tests, fixtures, doctests, or commands that were executed. Avoid ephemeral references such as pull-request-specific CI URLs, locally generated/run-only artifacts, or other non-portable evidence that won’t be reproducible from the repo state later.

Applied to files:

  • docs/workflows/repository-maintenance/test-plan.md
📚 Learning: 2026-07-30T04:29:11.102Z
Learnt from: flyingrobots
Repo: flyingrobots/colorful-language PR: 279
File: scripts/check-coverage-policy.mjs:36-41
Timestamp: 2026-07-30T04:29:11.102Z
Learning: In this repository’s GitHub Actions workflow validation code, treat `scripts/check-dependency-update-policy.mjs` as the *only* source of mutable pin data. It should own full commit SHA or Docker digest pins, any release/comment text it depends on, and the identity→pin mapping across the workflow family. For `scripts/check-coverage-policy.mjs`, `scripts/check-repository-maintenance.mjs`, and any other `scripts/check-*.mjs` validators, only verify action identity, enforce full-SHA pin syntax, and apply their specific security/topology semantics—without duplicating mutable release SHA constants or identity→pin mappings. This prevents Dependabot/updates from becoming unsatisfiable across the workflow family.

Applied to files:

  • scripts/check-roadmap-inventory.mjs
  • scripts/check-roadmap-inventory.test.mjs
🔇 Additional comments (16)
scripts/roadmap-accountability-policy.mjs (8)

30-57: LGTM!


59-94: LGTM!


96-136: LGTM!


138-185: LGTM!


235-285: LGTM!


287-341: LGTM!


386-643: LGTM!


274-279: 🗄️ Data Integrity & Integration

No change needed. The call form matches the current v2 packages: micromark-extension-gfm-table 2.1.1 exposes gfmTable as a factory, and mdast-util-gfm-table 2.0.0 exposes gfmTableFromMarkdown as a factory.

scripts/check-roadmap-inventory.mjs (1)

5-5: LGTM!

Also applies to: 80-84

scripts/check-roadmap-inventory.test.mjs (5)

27-29: LGTM!


63-83: LGTM!


172-254: LGTM!


569-580: LGTM!

Also applies to: 1525-1539


1631-1636: LGTM!

Also applies to: 1669-1691

docs/workflows/repository-maintenance/test-plan.md (1)

365-373: LGTM!

CHANGELOG.md (1)

12-18: LGTM!

Comment thread docs/workflows/repository-maintenance/test-plan.md Outdated
Comment thread ROADMAP.md
Comment thread scripts/check-roadmap-inventory.test.mjs
Comment thread scripts/check-roadmap-inventory.test.mjs
Comment thread scripts/check-roadmap-inventory.test.mjs
Comment thread scripts/roadmap-accountability-policy.mjs Outdated
Comment thread scripts/roadmap-accountability-policy.mjs
Comment thread scripts/roadmap-accountability-policy.mjs
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.

[bad code] Split the roadmap inventory checker before its source-policy ceiling becomes a maintenance trap

1 participant