fix(p6-standard-names): scorecard transparency for domain_verbs; trim platform verbs#83
Merged
Conversation
… platform verbs PR #76 review found two coupled gaps: 1. `.anc.toml [p6] domain_verbs` lets any CLI declare its own vocabulary as "standard" but the scorecard row gave no signal whether the Pass was assisted. A domain-verb-assisted Pass was byte-identical in JSON to a built-ins-only Pass. 2. Of the 18 verbs PR #76 added to the built-in STANDARD_VERBS list, 7 are X/Mastodon-specific (post, repost, unrepost, quote, like, unlike, dm). Their inclusion encoded one platform's vocabulary as universal and made the audit silently pass any social CLI without exercising the domain_verbs opt-in the PR introduced. Schema bumps 0.7 -> 0.8 with two new optional fields on AuditResultView: using_domain_verbs (Option<bool>) and domain_match_count (Option<usize>). Both elide from JSON when not applicable. The Pass row's evidence field is populated (rather than null) with the built-in-vs-domain ratio when mitigation is present, e.g.: "7/8 subcommands standard (3 via .anc.toml [p6].domain_verbs: [post, like, repost])" Carrier is a new MitigationInfo struct on AuditResult, capturing the bifurcated match counts and the first 5 matched domain-verb names. The carrier shape is intentionally not audit-specific; future audits that admit per-CLI mitigation can populate it without growing parallel typed fields. The 7 platform verbs are removed from STANDARD_VERBS; their place is the new docs/solutions/architecture-patterns/anc-toml-domain-verbs-pattern-2026-06-03.md pattern doc which a social CLI's .anc.toml can adopt. The 12 remaining PR-#76 additions (archive, unarchive, subscribe, unsubscribe, block, unblock, follow, unfollow, bookmark, mute, unmute, reply) stay in built-ins because they genuinely cross domains. Test coverage: - 13 unit tests for audit_standard_names (8 updated to the new StandardNamesResult shape; 5 new R5 adversarial tests covering nonsense domain_verbs, case mismatch, absent / empty .anc.toml, and the documented social-CLI example; 2 new format_pass_evidence tests pinning the truncation contract). - The 3 integration tests in tests/standard_names_integration.rs continue to pass; the fixture was retuned to use cross-domain built-ins (archive, follow) plus mentions so the loader is genuinely exercised after the platform-verb trim. Bulk mechanical change: every AuditResult struct literal across the audit catalog now carries the new mitigation field. This is the unavoidable churn of adding a typed transparency field to the canonical result carrier; the alternative (side-channel state or trait-method plumbing) would have introduced global mutable state or trait churn that's worse for long-term maintenance. Dogfood: anc audit . Passes p6-may-standard-names with no mitigation (anc has no .anc.toml). cargo test: 854 passed (was 847 before this PR), 2 ignored. cargo clippy --all-targets -- -Dwarnings: clean. cargo fmt --check: clean. anc emit coverage-matrix --check: clean. Plan: docs/plans/2026-06-03-003-fix-pr76-domain-verbs-scorecard-transparency-plan.md
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
Follow-up to merged PR #76 addressing two coupled gaps surfaced during the post-merge adversarial review.
.anc.toml [p6] domain_verbslets any CLI declare its own subcommand vocabulary as "standard," but the scorecard row gave no signal whether the Pass was assisted. A domain-verb-assisted Pass was byte-identical in JSON to a built-ins-only Pass. Separately, of the 18 verbs PR #76 added toSTANDARD_VERBS, 7 are X/Mastodon-specific (post,repost,unrepost,quote,like,unlike,dm). Their inclusion encoded one platform's vocabulary as universal, and let any social CLI Pass without exercising the.anc.tomlopt-in PR #76 introduced.This PR adds scorecard transparency for domain-verb-assisted Passes and trims the platform-specific verbs out of the built-in list. Schema bumps
0.7 → 0.8(additive).Changelog
Added
0.8:using_domain_verbs: Option<bool>anddomain_match_count: Option<usize>on eachAuditResultViewrow. Populated whenp6-standard-namesPasses via.anc.toml [p6] domain_verbsrecognition; absent (notnull) for rows that did not consultdomain_verbs.MitigationInfocarrier onAuditResult(typed, audit-agnostic) tracking built-in vs domain match counts and the first 5 matched domain-verb names in encounter order.evidencefield is populated with the built-in vs domain ratio when assisted bydomain_verbs, e.g."7/8 subcommands standard (3 via .anc.toml [p6].domain_verbs: [post, like, repost])". Rows without mitigation keep the historicalevidence: nullon Pass.Changed
STANDARD_VERBSno longer recognizespost,repost,unrepost,quote,like,unlike,dm. Social and platform-specific CLIs that previously Passed via built-ins must now declare these in.anc.toml [p6] domain_verbs(documented).audit_standard_namesreturns aStandardNamesResultstruct (status + optionalMitigationInfo) instead of bareAuditStatus.p6-standard-namesincludes a pointer todocs/solutions/architecture-patterns/anc-toml-domain-verbs-pattern-2026-06-03.mdso authors discover the opt-in.CLAUDE.mdschema history block updated to document the0.6,0.7, and0.8additions (the inline history had drifted at0.5).Fixed
.anc.toml-assisted Pass is now distinguishable in the scorecard JSON from an unassisted one.Type of Change
fix: Bug fix (non-breaking change which fixes an issue)Related Issues/Stories
docs/plans/2026-06-03-003-fix-pr76-domain-verbs-scorecard-transparency-plan.mddocs/plans/2026-06-03-001-refactor-audit-philosophy-structure-over-vocabulary-plan.mddocs/solutions/architecture-patterns/anc-toml-domain-verbs-pattern-2026-06-03.md(already committed and pushed to the symlinkedsolutions-docsrepo, commit402354b).Testing
Test Summary:
cargo test: 855 passed, 2 ignored (8 suites). Net +7 from baseline: 5 new R5 adversarial tests inaudit_standard_names, 2 new format-evidence tests pinning the 5-example truncation contract.cargo clippy --all-targets -- -Dwarnings: clean.cargo fmt --check: clean.anc emit coverage-matrix --check: clean.anc audit . --output json | jq '.results[] | select(.id == "p6-may-standard-names")'returnsstatus: "pass"withusing_domain_verbsanddomain_match_countabsent from the row keys (ancitself has no.anc.toml).Files Modified
Modified:
src/types.rs: newMitigationInfostruct; new optionalmitigation: Option<MitigationInfo>field onAuditResult.src/audits/behavioral/standard_names.rs: refactoredaudit_standard_namesto returnStandardNamesResult; bifurcated built-in vs domain match counting; populatesMitigationInfoon domain-assisted Pass; trimmed 7 platform-specific verbs fromSTANDARD_VERBS; appends docs URL to Warn evidence; 13 unit tests (8 updated to the new return shape + 5 new adversarial + 2 format-evidence pinning tests).src/audits/behavioral/mod.rs: madestandard_namespub(crate)so the scorecard view layer can callformat_pass_evidence.src/scorecard/mod.rs:SCHEMA_VERSIONbumped to"0.8";AuditResultViewgainsusing_domain_verbsanddomain_match_count;from_rowreadsr.mitigation, populates the fields, and synthesizes Pass evidence prose viaformat_pass_evidence.schema/scorecard.schema.json:$idpinned toscorecard-v0.8.tests/standard_names_integration.rs: fixture retuned toarchive+follow+mentionsso the.anc.tomlloader is genuinely exercised after the platform-verb trim.tests/integration.rs,tests/scorecard_metadata_security.rs,tests/scorecard_schema_v05.rs: schema-version assertions bumped to"0.8"; the v0.7 → v0.8 schema$idrename pinned byschema_v05_target_path_carries_no_separatorsregression test.CLAUDE.md: schema history block updated (was stuck at0.5); newMitigationInfosemantics block mirrors the existing per-version addition pattern.mitigation: Noneinsert in everyAuditResult { ... }constructor. This is the unavoidable churn of adding a typed transparency field to the canonical result carrier.cargo checkverified the sed hit only valid sites.Created:
docs/solutions/architecture-patterns/anc-toml-domain-verbs-pattern-2026-06-03.mdlives in the symlinkedsolutions-docsrepo and was committed there separately.)Renamed:
Deleted:
Breaking Changes
0.8is additive)The 7 platform verbs removed from
STANDARD_VERBSare a behavior tightening, not a contract break. CLIs that relied on them being built-ins were exploiting PR #76's overly broad vocabulary; the remediation path is.anc.toml [p6] domain_verbs(documented).Deployment Notes
Checklist