Skip to content

feat(v0.1.1): principle registry, coverage matrix, check renames + scorecard v1.1#21

Merged
brettdavies merged 8 commits intodevfrom
feat/v011-principle-registry-and-coverage
Apr 20, 2026
Merged

feat(v0.1.1): principle registry, coverage matrix, check renames + scorecard v1.1#21
brettdavies merged 8 commits intodevfrom
feat/v011-principle-registry-and-coverage

Conversation

@brettdavies
Copy link
Copy Markdown
Owner

@brettdavies brettdavies commented Apr 20, 2026

Summary

v0.1.1 foundation handoff 1 of 3 — lands the honest-verification scaffolding in agentnative. Introduces the
PrincipleRegistry + coverage-matrix generator, adds Check::covers(), corrects two miscategorized checks, fixes the
P1 applicability gate that was about to warn the linter against itself, and bumps the scorecard JSON schema to v1.1.
Also sweeps up repo URL references after the GitHub rename to agentnative-cli and adds structured issue templates.

Changelog

Added

  • anc generate coverage-matrix subcommand (--out, --json-out, --check drift guard). Emits
    docs/coverage-matrix.md + coverage/matrix.json from the spec registry + each check's declared covers().
  • Scorecard JSON v1.1 fields: schema_version: "1.1", coverage_summary (must/should/may × total/verified),
    audience (reserved, null until v0.1.3), audit_profile (reserved, null until v0.1.3).
  • GitHub issue templates for structured reporting: false-positive, scoring-bug, feature-request, grade-a-cli,
    pressure-test, spec-question (+ chooser config.yml).

Changed

  • Renamed p6-tty-detectionp1-tty-detection-source (verifies the P1 SHOULD for TTY detection, not a P6 concern).
  • Renamed p6-env-flagsp1-env-flags-source (verifies the P1 MUST that every flag be settable via env var — lives
    in P1, not P6).
  • Repo URL references swept to brettdavies/agentnative-cli (renamed from brettdavies/agentnative). Cargo.toml
    homepage now points at https://anc.dev.

Fixed

  • P1 applicability gate (src/checks/behavioral/non_interactive.rs) now passes when any of help-on-bare-invocation,
    agentic-flag-present, or stdin-as-primary-input is observed. Previously anc risked warning itself once
    p1-flag-existence lands in v0.1.2.

Type of Change

  • feat: New feature

Related Issues/Stories

  • Plan: docs/plans/2026-04-20-v011-handoff-1-agentnative-impl.md
  • CEO plan: ~/.gstack/projects/brettdavies-agentnative/ceo-plans/2026-04-20-p1-doctrine-spec-coverage.md
  • Test plan: ~/.gstack/projects/brettdavies-agentnative/brett-dev-eng-review-test-plan-20260420-132817.md
  • Related PRs: handoff 2 (site spec text) and handoff 3 (scorecard regeneration, consumes the rename map below).

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing completed (dogfood via cargo run -- check .)
  • All tests passing

Test Summary:

  • Unit tests: 321 passing (+17 from baseline 304)
  • Integration tests: 41 passing (+2: generate-writes + drift-check)
  • cargo fmt --check: clean
  • cargo clippy --all-targets -- -Dwarnings: clean
  • cargo run -- check .: 26 pass / 2 warn / 0 fail / 2 skip (dogfood OK)
  • cargo run -- generate coverage-matrix --check: exit 0 (no drift)

Files Modified

Created:

  • src/principles/mod.rs, src/principles/registry.rs, src/principles/matrix.rs
  • docs/coverage-matrix.md, coverage/matrix.json
  • .github/ISSUE_TEMPLATE/ (7 templates + config chooser)

Modified:

  • src/check.rsCheck::covers() with empty default
  • src/cli.rs, src/main.rsgenerate coverage-matrix wiring
  • src/checks/**/*.rs — per-check covers() declarations (19 checks)
  • src/scorecard.rs — v1.1 scorecard shape + coverage-summary builder
  • src/checks/behavioral/non_interactive.rs — P1 applicability gate
  • tests/integration.rs — generate/drift integration tests
  • Cargo.toml, README.md, RELEASES.md — repo URL sweep (cliff.toml and issue-template prose completed on
    release/v0.1.1-*)

Check Rename Map (for handoff 3)

The rename breaks results[].id in every scorecard JSON committed to
brettdavies/agentnative-site. Handoff 3 regenerates. Old → new:

Old ID New ID Principle change
p6-tty-detection p1-tty-detection-source P6 → P1 (SHOULD)
p6-env-flags p1-env-flags-source P6 → P1 (MUST)

Registry snapshot (2026-04-20)

46 requirements: 23 MUST / 16 SHOULD / 7 MAY. registry_size_matches_spec test guards against drift; bumping the
counter is a deliberate act.

Coverage at launch

  • MUST: 17 / 23 verified
  • SHOULD: 2 / 16 verified
  • MAY: 0 / 7 verified

Uncovered entries are now explicit in docs/coverage-matrix.md — readers
can see what anc verifies vs. what the spec claims. Closing more coverage is the job of v0.1.2 (handoff 4).

Breaking Changes

  • Breaking changes described below

Check ID renames (p6-tty-detection, p6-env-flags) are breaking for
anyone consuming scorecard JSON downstream. Site regeneration is tracked in handoff 3 and lands before v0.1.1 tags.

Deployment Notes

  • No special deployment steps required

v0.1.1 tag gated on handoff 2 (site spec) also landing.

Checklist

  • Code follows project conventions and style guidelines
  • Commit messages follow Conventional Commits
  • Self-review completed
  • Tests added/updated and passing
  • No new warnings or errors introduced
  • Breaking changes documented (rename map above)

Introduces `src/principles/` — flat `&'static [Requirement]` covering every
MUST, SHOULD, and MAY across P1–P7 (46 entries), plus a matrix generator
that cross-references the registry against each check's new
`Check::covers()` declaration.

- `registry.rs` defines `Requirement`, `Level`, `Applicability`,
  `ExceptionCategory` with ID stability guarantees.
- `matrix.rs` builds the inverse map (requirement → verifying check) and
  renders `docs/coverage-matrix.md` + `coverage/matrix.json`.
- `Check::covers()` returns `&'static [&'static str]`, empty by default;
  dangling references are surfaced by the matrix generator.
- `anc generate coverage-matrix` with `--out`, `--json-out`, `--check`
  (drift guard for CI).
Aligns checks and scorecard with the new principle registry.

Check renames (semantic correction — the spec requirements these
verified live in P1, not P6):

- p6-tty-detection → p1-tty-detection-source (P1 SHOULD, TTY detection)
- p6-env-flags    → p1-env-flags-source    (P1 MUST, env-var flags)

The rename breaks results[].id in the 10 committed scorecards under
brettdavies/agentnative-site — handoff 3 regenerates them.

P1 applicability gate (`src/checks/behavioral/non_interactive.rs`)
now explicitly passes when ANY of three signals holds:
  1. help-on-bare-invocation (clap `arg_required_else_help` shape)
  2. agentic-flag-present in `--help` (`--no-interactive` and variants)
  3. stdin-as-primary-input (clean exit when stdin is /dev/null)

This blocks the dogfood break — without it, `anc` warned itself.

Every spec-verifying check now declares `covers()` so the matrix
generator can build coverage_summary.

Scorecard JSON bumps to schema_version 1.1:
  - coverage_summary { must/should/may × total/verified }
  - audience (stub, null until v0.1.3)
  - audit_profile (stub, null until v0.1.3)

Commits `docs/coverage-matrix.md` + `coverage/matrix.json` — CI drift
guard covered by `anc generate coverage-matrix --check` and a new
integration test.
Handoffs 2 (plus session brief), 3, and 5 target the agentnative-site
repo and now live there; handoffs 1 and 4 stay here.

All six docs gain a sibling-handoff nav table so any reader can find
siblings across repos.

Fix pre-existing broken path in handoff 2 (the doctrine-call handoff
is in docs/plans/spikes/, not docs/plans/). Relativize paths that
became in-repo after the move and prefix cross-repo code paths with
~/dev/agentnative/ for clarity.

The receiving commit in agentnative-site follows in a separate PR.
Add four new sections to CLAUDE.md covering the surfaces that landed in
handoff 1 (PR #21):

- Principle Registry editing rules (ID pattern, append order, counter
  tests as drift guards, Applicability semantics, reserved
  ExceptionCategory).
- covers() declaration pattern (static-slice return type, opt-in
  default, dangling-ID drift detector).
- Coverage matrix artifact lifecycle (committed, not generated;
  --check flag; integration test mirror; when to regenerate).
- Scorecard v1.1 field discipline (coverage_summary populated every
  run; audience and audit_profile reserved for v0.1.3; consumers
  must feature-detect).

Closes the unchecked DoD item from handoff 1.
Release-infrastructure plan (2026-04-02-002): flip frontmatter
status from `active` to `complete`. v0.1.0 shipped via full pipeline
on 2026-04-16; all 6 units satisfied.

Handoff 1 plan (2026-04-20 v0.1.1): add `status: in-progress` to
frontmatter, tick all 8 DoD checkboxes with evidence (test counts,
schema versions, dogfood result, CLAUDE.md commit SHA), and add a
Progress section noting scope-complete / PR #21 open / smoke green /
final pre-merge run pending.
Sweep Cargo.toml (repository, homepage), README install/clone URLs,
and RELEASES.md ruleset/check-runs API paths to the renamed repo.
Homepage now points at anc.dev.
Add seven issue templates for structured reporting:
- false-positive, scoring-bug, feature-request, grade-a-cli,
  pressure-test, spec-question, and config.yml chooser.
@brettdavies brettdavies merged commit 86e6ff9 into dev Apr 20, 2026
6 checks passed
@brettdavies brettdavies deleted the feat/v011-principle-registry-and-coverage branch April 20, 2026 22:12
@brettdavies brettdavies mentioned this pull request Apr 20, 2026
14 tasks
brettdavies added a commit that referenced this pull request Apr 20, 2026
The URL-sweep bullet previously carried release-engineering detail about
the `release/v0.1.1-*` branch completing cliff.toml and issue-template
refs. Simplified the PR #21 body (`gh pr edit 21`) and regenerated so
the user-visible changelog stays focused on the repo rename itself.
brettdavies added a commit that referenced this pull request Apr 20, 2026
## Summary

Release PR cutting v0.1.1 onto `main`. Bundles the v0.1.1 feature
payload (principle registry, coverage matrix, check
renames, scorecard v1.1, issue templates) from
[#21](#21) plus the
residual URL-rename work needed after the GitHub repo moved
`brettdavies/agentnative` → `brettdavies/agentnative-cli`.

The tag push after merge triggers crates.io publish (Trusted
Publishing), GitHub Release (5 targets + sha256sum), and
Homebrew tap dispatch.

## Changelog

### Added

- `anc generate coverage-matrix` subcommand (`--out`, `--json-out`,
`--check` drift guard). Emits
`docs/coverage-matrix.md` + `coverage/matrix.json` from the spec
registry + each check's declared `covers()`.
- Scorecard JSON v1.1 fields: `schema_version: "1.1"`,
`coverage_summary` (`must`/`should`/`may` × `total`/`verified`),
`audience` (reserved, null until v0.1.3), `audit_profile` (reserved,
null until v0.1.3).
- GitHub issue templates for structured reporting: false-positive,
scoring-bug, feature-request, grade-a-cli,
  pressure-test, spec-question (+ chooser `config.yml`).

### Changed

- Renamed `p6-tty-detection` → `p1-tty-detection-source` (verifies the
P1 SHOULD for TTY detection, not a P6 concern).
- Renamed `p6-env-flags` → `p1-env-flags-source` (verifies the P1 MUST
that every flag be settable via env var — lives
  in P1, not P6).
- Repo URL references swept to `brettdavies/agentnative-cli` (renamed
from `brettdavies/agentnative`). `Cargo.toml`
  `homepage` now points at `https://anc.dev`.

### Fixed

- P1 applicability gate (`src/checks/behavioral/non_interactive.rs`) now
passes when any of help-on-bare-invocation,
agentic-flag-present, or stdin-as-primary-input is observed. Previously
`anc` risked warning itself once
  `p1-flag-existence` lands in v0.1.2.

## Type of Change

- [x] `feat`: New feature (release vehicle carrying v0.1.1)

## Related Issues/Stories

- Feature PR:
[#21](#21) —
`feat(v0.1.1): principle registry,
  coverage matrix, check renames + scorecard v1.1`
- Plan: `docs/plans/2026-04-20-v011-handoff-1-agentnative-impl.md`
(dev-only)
- Changelog script: `scripts/generate-changelog.sh` (ran on this branch;
CHANGELOG.md committed verbatim from the script
  output — no manual edits)

## Testing

- [x] Pre-push hook passed on this branch (fmt, clippy `-Dwarnings`, 321
unit tests + 41 integration tests, `cargo
  deny`, Windows compat)
- [x] CI on the underlying `feat/v011-*` branch (pre-squash-merge to
dev): all green
- [x] `cargo run -- check .`: 26 pass / 2 warn / 0 fail / 2 skip
(dogfood)
- [x] `cargo run -- generate coverage-matrix --check`: exit 0 (no drift)

## Files Modified

**Modified on this release branch (beyond the PR #21 cherry-pick):**

- `cliff.toml`: `repo = "agentnative-cli"` (so changelog links resolve
against the renamed repo)
- `.github/ISSUE_TEMPLATE/*.yml` (7 files): prose URL references swept
to `brettdavies/agentnative-cli`
- `Cargo.toml`, `Cargo.lock`: version bump `0.1.0` → `0.1.1`
- `completions/anc.{bash,zsh,fish,elvish,powershell}`: regenerated to
pick up the `generate coverage-matrix` subcommand
- `CHANGELOG.md`: generated by `scripts/generate-changelog.sh`

## Breaking Changes

- [x] Breaking changes described below

Check ID renames land in this release (from PR #21):

| Old ID              | New ID                    |
|---------------------|---------------------------|
| `p6-tty-detection`  | `p1-tty-detection-source` |
| `p6-env-flags`      | `p1-env-flags-source`     |

Downstream scorecard-JSON consumers (notably the `agentnative-site`
`/score/<tool>` page) see changed `results[].id` values. Handoff 3
regenerates the committed scorecards against v0.1.1.

## Deployment Notes

- [x] Deployment steps documented below

1. Squash-merge this PR to `main`.
2. Tag on `main` (annotated, per `tag.gpgsign=true` default):

   ```bash
   git checkout main && git pull
   git tag -a -m "Release v0.1.1" v0.1.1
   git push origin main --tags
   ```

3. Tag push triggers `.github/workflows/release.yml` → reusable
`rust-release.yml`: `check-version` → `audit` → `build`
(5 targets) → `publish-crate` (Trusted Publishing OIDC) → `release`
(non-draft, `make_latest: false`) → `homebrew`
   dispatch → `finalize-release` flips `make_latest: true`.
4. **Precondition** (manual, one-time): crates.io Trusted Publishing
entry must point at `brettdavies/agentnative-cli`
(renamed from `brettdavies/agentnative`). Verify at
`https://crates.io/settings/tokens/trusted-publishing` before
tagging — OIDC claim from the renamed repo won't match a stale entry and
the publish step will fail with an auth
   error.

## Checklist

- [x] Code follows project conventions and style guidelines
- [x] Commit messages follow Conventional Commits
- [x] Self-review completed
- [x] Tests added/updated and passing (on upstream feat branch)
- [x] No new warnings or errors introduced
- [x] Breaking changes documented (rename map above)
- [x] CHANGELOG.md generated via script, no manual edits
brettdavies added a commit that referenced this pull request Apr 21, 2026
## Summary

Small post-release doc sync against what actually shipped in v0.1.1.
Not tied to the next release — lands on \`dev\` for the next release
branch to cherry-pick whenever it cuts.

Two files touched:

- **\`README.md\`** — refreshed the sample dogfood output. The block at
line 82 showed \`30 checks: 20 pass, 8 warn, 0 fail, 2 skip, 0 error\`,
  which was accurate pre-v0.1.1. After the P1 applicability gate fix
  landed, current state is \`30 checks: 26 pass, 2 warn, 0 fail, 2 skip,
0 error\`. Just the sample output; check count and structure unchanged.

- **\`AGENTS.md\`** — closed a real drift. The \"Adding a New Check\"
  section listed the \`Check\` trait methods as \`id()\`, \`group()\`,
  \`layer()\`, \`applicable()\`, \`run()\` — missing \`covers()\` which
  landed in v0.1.1. New contributors adding a check without \`covers()\`
  would silently not appear in the coverage matrix. Also added the
  \`cargo run -- generate coverage-matrix\` regeneration step. Project
  Structure list gained \`src/principles/registry.rs\` and
  \`src/principles/matrix.rs\`. Cross-references CLAUDE.md for the full
  conventions (registry rules, drift detector, artifact lifecycle).

## Changelog

### Documentation

- Document the \`covers()\` trait method and the coverage-matrix
  regeneration step in the \"Adding a New Check\" guide.
- Refresh README sample output to match v0.1.1 dogfood behaviour.

## Type of Change

- [x] \`docs\`: Documentation update

## Related

- v0.1.1 feature PR:
[#21](#21) —
introduced
\`covers()\`, \`src/principles/registry.rs\`, and \`anc generate
coverage-matrix\`.
- CLAUDE.md already has the full registry + drift-detector conventions
(landed in that PR);
this PR just makes AGENTS.md point at them so contributors hit it from
the right entry doc.

## Testing

- [x] Confirmed README sample output matches \`cargo run -- check .\` on
main at commit 5400c43.
- [x] AGENTS.md additions are factual (no change to behavior).
- [x] CLAUDE.md and RELEASES.md reviewed — already current, no edits
needed.

## Files Modified

- \`AGENTS.md\` — 9 insertions, 1 deletion.
- \`README.md\` — 1 insertion, 1 deletion.
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.

1 participant