feat(dag): populate per-node headlines field#9
Merged
Conversation
Completes the v0 DAG schema (docs/arghda-spec.adoc lines 128-135): each `dag` node now carries the sorted, deduped list of top-level headline theorem names the module declares — previously the schema defined `headlines` but the builder omitted it. - Reuses the `unpinned-headline` extractor: `headline_decls` is now `pub`, and `dag::build` runs it per node with the configured headline pattern. - `build_dag` gains a `headline_pattern: &str` parameter; `dag` threads the resolved pattern through (default < config.toml < CLI), so the DAG honours the same operator configuration as the lint. - New `tests/fixtures/headlines/` and a `dag_populates_node_headlines` test asserting `Thm -> [thm-one, thm-two]` (and that the indented `private` helper and the import-only entry module surface nothing). Live: `arghda dag tests/fixtures/headlines` emits `"headlines": ["thm-one", "thm-two"]` on the Thm node, `[]` on All. fmt/clippy/test green (7 groups). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019GiSiEfgZCte35dyykgBHs
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.
Summary
Completes the v0 DAG schema: each
dagnode now carries the per-nodeheadlinesarray the spec defines (docs/arghda-spec.adoclines 128–135) but the builder previously omitted — the sorted, deduped list of top-level headline theorem names the module declares.Design
unpinned-headlineextractor — no duplicate parsing.headline_declsbecomespub, anddag::buildruns it per node with the configured headlineRegex.build_daggains aheadline_pattern: &strparameter.dagthreads the resolved pattern through (built-in default <.arghda/config.toml< CLI--headline-pattern, via the feat(config): operator config via .arghda/config.toml #8 config plumbing), so the DAG honours the same operator configuration as the lint.privatehelpers are not surfaced (same export-only filter as the rule).Verification
cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo build,cargo testall green (7 groups).tests/fixtures/headlines/+dag_populates_node_headlines: assertsThm → ["thm-one","thm-two"], that the indentedprivate helperis excluded, and the import-onlyAllentry surfaces[].arghda dag tests/fixtures/headlinesemits"headlines": ["thm-one","thm-two"]on theThmnode and[]onAll.Last of three sequenced engine-polish PRs (3 → 2 → 1):
unused-import(#7),.arghda/config.toml(#8), DAGheadlines(this). With these, the v0 Agda lint set and DAG schema inarghda-spec.adocare complete.🤖 Generated with Claude Code
https://claude.ai/code/session_019GiSiEfgZCte35dyykgBHs
Generated by Claude Code