Skip to content

feat(dag): populate per-node headlines field#9

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/modest-hawking-3fd6it
Jun 20, 2026
Merged

feat(dag): populate per-node headlines field#9
hyperpolymath merged 1 commit into
mainfrom
claude/modest-hawking-3fd6it

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Completes the v0 DAG schema: each dag node now carries the per-node headlines array the spec defines (docs/arghda-spec.adoc lines 128–135) but the builder previously omitted — the sorted, deduped list of top-level headline theorem names the module declares.

Design

  • Reuses the unpinned-headline extractor — no duplicate parsing. headline_decls becomes pub, and dag::build runs it per node with the configured headline Regex.
  • build_dag gains a headline_pattern: &str parameter. dag threads 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.
  • Column-0-only extraction means indented private helpers are not surfaced (same export-only filter as the rule).

Verification

  • cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo build, cargo test all green (7 groups).
  • New tests/fixtures/headlines/ + dag_populates_node_headlines: asserts Thm → ["thm-one","thm-two"], that the indented private helper is excluded, and the import-only All entry surfaces [].
  • Live: arghda dag tests/fixtures/headlines emits "headlines": ["thm-one","thm-two"] on the Thm node and [] on All.

Last of three sequenced engine-polish PRs (3 → 2 → 1): unused-import (#7), .arghda/config.toml (#8), DAG headlines (this). With these, the v0 Agda lint set and DAG schema in arghda-spec.adoc are complete.

🤖 Generated with Claude Code

https://claude.ai/code/session_019GiSiEfgZCte35dyykgBHs


Generated by Claude Code

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
@hyperpolymath hyperpolymath marked this pull request as ready for review June 20, 2026 01:54
@hyperpolymath hyperpolymath merged commit 3f761e2 into main Jun 20, 2026
1 check passed
@hyperpolymath hyperpolymath deleted the claude/modest-hawking-3fd6it branch June 20, 2026 01:54
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.

2 participants