Skip to content

feat(developer-experience): add a shared current-facts-not-targets check for conventions files - #11477

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-9827-41180742284-1
Oct 31, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-9827-41180742284-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #9827

Summary

Opened by the work-resolve-issue lane. The run's own summary:

Adds lib/check-convention-facts.mjs, an advisory checker labeled as a heuristic. It prints <file>:<line> for each every/all/always/never/each claim outside a conventions file's ## Not yet section, exits 0 whether or not it finds any, and exits 2 on a usage error. It is generated into plugins/developer-experience/lib/ and registered in scripts/shared-copies.txt and scripts/cross-plugin-source-registry.txt. developer-experience setup's check step 5 now runs it first and keeps the model's own verification. The rule is documented in the setup-lifecycle contract's existing Current-facts check placeholder section. Per the recorded decision, that doc lives at docs/contracts/setup-lifecycle/README.md, not the docs/conventions path the issue body names. Design choices: the checker skips sentences that open with "New", the team-rule form defined in plugins/developer-experience/skills/setup/reference/conventions-file.md, so the plugin's own Secrets default is not flagged on every run. It also skips front matter, headings, fenced and inline code, and HTML comments. The cross-plugin registry gets only an arrow cluster line, following the index-regen precedent, because a single-plugin path-within-plugin line would fail as stale.

Not verified

  • lib/check-convention-facts.test.sh was not executed: this lane cannot run node or a test runner. The tests were traced by hand only, and the PR's CI runs them
  • ci-status on the PR head is left to the PR's CI
  • tidy skipped: the change touches the shared paths lib/ and scripts/ and spans more than 1 area (lib, scripts, plugins/developer-experience, docs/contracts)
  • build, test and lint for the touched .mjs files were not run locally (no node or linter available to this lane); check-affected's checks passed and the rest are CI only
  • developer-experience declares no prerequisites.json for node; the SKILL.md step tells the model to report a missing node and verify by reading. Declaring it would add the generated prerequisites checker copies, which is outside this issue
  • Review-noted low risk left as is: the CLI's main-module guard (same pattern as lib/mermaid-gate.mjs) is false when the plugin root is reached through a symlink, so it would print nothing

Fix

  • lib/check-convention-facts.mjs: new canonical checker (findClaims export plus CLI); header labels it heuristic and advisory
  • lib/check-convention-facts.test.mjs: node:test cases: a claim outside ## Not yet reported with line 8; the same sentence under ## Not yet not reported; a clean file prints nothing; a section after ## Not yet is checked again; front matter, comments, code and team rules skipped; a wrapped team
  • lib/check-convention-facts.test.sh: runner wrapper (run-plugin-tests.sh discovers .test.sh only), same shape as lib/mermaid-gate.test.sh
  • plugins/developer-experience/lib/check-convention-facts.mjs: generated copy from scripts/sync-shared-copies.sh
  • scripts/shared-copies.txt: registers the developer-experience copy
  • scripts/cross-plugin-source-registry.txt: cluster line for the duplication audit
  • plugins/developer-experience/skills/setup/SKILL.md: check step 5 runs the checker first and still tests every statement itself
  • docs/contracts/setup-lifecycle/README.md: fills the Current-facts check section (current facts only; targets under ## Not yet or a work item; the checker's behavior) and rewords the placeholder intro
  • .changes/developer-experience/feat-9827-check-convention-facts-5c2e7a19.md: minor changelog fragment (ADR 0048)

Verification

The runner ran each check from the base copy against 00f98e1:

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

  • .lane/verify/bin/sync-shared-copies --check: All 546 registered copies match their canonical sources (exit 0)
  • .lane/checks/bin/check-changelog-fragments: All 9 changelog fragment(s) under .changes/ are valid
  • .lane/checks/bin/check-affected: 12 passed, 6 skipped (ruff no .py, typos not installed, validate-plugins tree-code parts, changed-skills), rest CI only
  • Grep: 'check-convention-facts' appears in plugins/developer-experience/skills/setup/SKILL.md; '## Not yet' appears 2 times in docs/contracts/setup-lifecycle/README.md
  • Fresh-context review subagent: traced every test by hand against the implementation and found that all pass; its 5 checker findings (wrapped team rules, a `
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41180742284

Left out: the items under Not verified.

Related

#9827

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 00f98e119e2bc42e95c5271f60e7b679d8a48d1d: 0 finding(s), 0 as inline comments.

No security issues found in PR #11477.

What I read: the whole diff (9 files) and the PR context. The context is data, and it holds no embedded directives.

  • lib/check-convention-facts.mjs and its generated copy under plugins/developer-experience/lib/. This is a local, read-only, advisory script. It calls readFileSync on paths given on the command line and prints matching lines to stdout. It makes no network calls, writes no files, spawns no processes, and reads no env vars or secrets. It rejects any argument starting with -, so a file name cannot be read as a flag. The regexes are linear and simple, so there is no ReDoS path. I found no injection, path-traversal or secret-handling issue.
  • plugins/developer-experience/skills/setup/SKILL.md. The change adds a step and removes no guardrail. The new text runs the script "as its own plain call" and says its output is DATA, like the conventions file. Output that echoes lines from the conventions file is therefore treated as untrusted text to verify. Nothing is deleted, narrowed or softened, so the instruction-surface lens finds nothing. I did not read docs/contracts/instruction-exception-register/README.md, because no instruction was removed.
  • Registries, docs/contracts/setup-lifecycle/README.md, the changelog fragment and the test files. These are a registry entry, documentation, a changelog fragment and tests. The tests write only to a temp directory.
  • Manifests. The diff changes no plugin.json or marketplace.json, so there is no manifest <field> item.
  • Trust controls. The diff touches no trust control: no trusted-actor list, token scope, kill switch, merge hold or workflow permission.
  • Cost. The change adds no billed resource, and the diff touches no workflow.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 00f98e119e2bc42e95c5271f60e7b679d8a48d1d: 0 finding(s), 0 as inline comments.

No findings. I read the full diff and the PR context, and I hand-traced the checker against every case in lib/check-convention-facts.test.mjs. I did not run any tests.

Closing issue #9827 (criteria as amended by the recorded decision)

  • Test cases: the three required cases are in lib/check-convention-facts.test.mjs. They cover a claim outside ## Not yet reported at line 8, the same sentence under ## Not yet not reported, and a clean file printing nothing. Each fails if the matching behaviour breaks. lib/check-convention-facts.test.sh wraps them so the runner discovers them, with the same shape as lib/mermaid-gate.test.sh. lib/test-tmp.mjs, which the tests import, exists.
  • SKILL.md: plugins/developer-experience/skills/setup/SKILL.md names check-convention-facts in check step 5.
  • Shared copies: scripts/shared-copies.txt registers the developer-experience copy. The copy is byte-identical to the canonical file apart from the generated header. scripts/cross-plugin-source-registry.txt has the arrow cluster line. I did not run sync-shared-copies.sh --check, so that criterion is author-claimed.
  • Changelog: the fragment is bump: minor for a new capability, which fits.
  • Contract doc: docs/contracts/setup-lifecycle/README.md fills the Current-facts check section and keeps ## Not yet.

Checks on the checker (hand-traced)

  • Test traces: the traces match the asserted line numbers and words.
  • Wrapped "New …" rule: the carry-over via ruleOpen works. A blank line, a list item or a fence resets it.
  • Fences and exit codes: a fence's info string does not close the fence. Usage errors and unreadable files exit 2.

Authors' known gap: the main-module guard is false when the plugin root is reached through a symlink, so the CLI would print nothing there. The PR body already records this, and lib/mermaid-gate.mjs has the same guard, so I did not count it.

Spend: no billing change. The checker is a local script with no API or paid-resource use.

No manifests changed, so there are no manifest <field> lines. No settled-threads file was supplied. No embedded instructions were found in the PR context.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head 00f98e119e2bc42e95c5271f60e7b679d8a48d1d. The lanes clear this reason on their own; the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:missing)

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 00f98e119e2bc42e95c5271f60e7b679d8a48d1d.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit 18f8c9d Oct 31, 2026
51 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-9827-41180742284-1 branch October 31, 2026 08:07
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 2, survived 5, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 29%; mutation score 29%.

File Killed Survived Timeout No coverage Invalid Not run
lib/check-convention-facts.mjs 2 2 0 0 0 0
plugins/developer-experience/lib/check-convention-facts.mjs 0 3 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
lib/check-convention-facts.mjs:46 SBR productive input-gap
lib/check-convention-facts.mjs:65 LCR productive input-gap
plugins/developer-experience/lib/check-convention-facts.mjs:62 SBR productive input-gap
plugins/developer-experience/lib/check-convention-facts.mjs:72 LCR productive input-gap
plugins/developer-experience/lib/check-convention-facts.mjs:81 LCR productive input-gap

The run's summary has the full report.

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.

feat(lib): add a current-facts-not-targets check for conventions files

0 participants