RFC-007 Phase 2: project rule + rfc nodes behind --nodes (fixes #588)#604
Merged
Conversation
Adds scripts/lib/rule-nodes.mjs (slugify, flat frontmatter parse, rule and RFC corpus scans) and an opt-in --nodes flag that projects the rule and rfc node types into --orphans, --from, and the traversal response. Parses the entry_point frontmatter key; its --graph-health consumption remains Phase 4 and its persisted form remains Phase 6. Without --nodes the rule corpus is never read and output is byte-identical. A rule file with no frontmatter name, or a name that slugifies to empty, is skipped and counted rather than projected under a filename-derived slug. RFC-007 records that policy, the narrowed entry_point grammar, and the phase split that the RFC previously gave three different answers for. Reviewed on a frozen diff by pi/GLM-5.2, verdict ACCEPT; two MINOR findings applied, two deferred as #602 and #603. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
lantiscooperdev
approved these changes
Jul 25, 2026
lantiscooperdev
pushed a commit
that referenced
this pull request
Jul 25, 2026
#605) PR #604 deliberately left PR #XXX (<pending-merge-sha>) in the Phase 2 row and the Implementation ledger row, to be resolved from git after merge per the #582 defect class. Derived from git log --oneline --follow -- scripts/em-graph.mjs, which gives df93920, the main-merge commit carrying (#604) in its subject, not a feature-branch tip. Also corrects the CI anchor in the same ledger row: the new suite step is at .github/workflows/tests.yml:404-405, not :403-404 as written. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements RFC-007 Phase 2 from the review-complete plan at
docs/plans/RFC-007-P2-rule-rfc-nodes.md(4 adversarial plan-review rounds) and its frozen mechanical appendix.What lands
scripts/lib/rule-nodes.mjs(new):slugify, a flat frontmatter parser returning null-prototype objects, converged rule-directory resolution, and the rule and RFC corpus scans.--nodesflag onem-graph.mjs:episode,rule,rfcorall, defaulting toepisode. Unknown values exit 2. The new node types surface at--orphans, at--from <rule-id>, and in the traversal response.entry_pointfrontmatter key is parsed and carried on rule nodes. Its--graph-healthaudit consumption stays Phase 4 and its persisted form stays Phase 6; RFC-007 previously assigned this key to three different phases without reconciling them, and that split is now written down.ruleandrfcnode rows flipped from UNBUILT to SHIPPED, Phase 2 row flipped, OQ-1 resolved, the no-name:skip policy recorded, the narrowedentry_pointgrammar recorded, and the self-refuting status line at:246retired.tests/test-em-graph-nodes.mjs(28 cases), CI-wired in the same PR.Decisions recorded rather than invented
RFC-007 left three things unstated or contradictory; each is now written into the RFC:
name:is skipped and counted, never projected under a filename-derived slug (:133forbids that). Observed today: 8 files are in this state and all areMEMORY*files, 8 of the 9 members of that glob.MEMORY.mdis among them, and:233namesMEMORY.mdas a canonical entry-point root, so a canonical root is currently unprojectable. That tension is tracked on RFC doc-coherence batch: RFC-008 stubs, RFC-001 phase headers, RFC-004 missing M1 row, RFC-002 ledger stops at Phase 2 #585.name:that slugifies to empty (an all-non-ASCII name) is skipped on the same footing. Diacritic folding is deliberately not performed.--nodes, mirroring howtagsis gated outsideDEFAULT_EDGES.Verification
node tests/test-em-graph-nodes.mjs28 passed, 0 failednode tests/test-em-graph.mjs10 passed, 0 failednode tests/test-ci-suite-registration.mjs16 passed, 0 failed, PASSnode scripts/em-rfc-validate.mjsgrep -n "writeFileSync|renameSync|mkdirSync" scripts/em-graph.mjsBoth polarities on the same input, which is what proves the flag is not a no-op (it was one at plan-review round 2):
--from whats-next-show-non-issue-tasks --nodes rule --scope localreturns a realtype: "rule"node withskipped_nodes: 8, while the identical command without--nodesexits 1 not-found. The code's ownskipped_nodes: 8matches an independentgrep -L "^name:"count exactly.Review
Frozen-diff review by pi/GLM-5.2 on neuralwatt, round 1 verdict ACCEPT, no BLOCKER and no MAJOR. The reviewer reproduced every axis against isolated fixture corpora: the no-op class at all four surfaces, prototype pollution, symlinked directory and file, readdir determinism, collision exit 2, empty-slug skip, NFC convergence, no-truncation, write-freedom, no-
name:skip, and no-rfc_idskip.Two MINOR findings applied in this PR:
--nodeswas missing from--help(P5 discoverability), and the slug-collision message duplicated the slug and hardcoded the word Two for 3-or-more colliders.Two deferred with 5-field justifications: #602 (absolute filesystem path emitted on every node, P6 tension) and #603 (
--hubsruns the scan and can exit 2 but suppressesskipped_nodes).Not in scope
scripts/em-console.mjsstill validates--fromagainst an episode-id shape, so rule slugs are rejected there. Left deliberately unwidened.Ledger provenance note: the Implementation ledger row and Phase 2 row carry a placeholder SHA to be replaced from
git log --followafter merge, per the #582 defect class.