nacl-sa-validate
Validate NaCl SA graph consistency, connectivity, requirements, form-domain traceability, UC-form coverage, cross-module rules, feature requests, staleness closure, decision provenance, screen state machines, behavior slices, domain error taxonomy, cache & degradation policies, and BA-to-SA coverage. Use when checking SA quality or says `/nacl-sa-validate`.
ITSalt · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add ITSalt/NaCl --skill nacl-sa-validate技能说明
name: nacl-sa-validate
description: |
Validate NaCl SA graph consistency, connectivity, requirements, form-domain
traceability, UC-form coverage, cross-module rules, feature requests, staleness
closure, decision provenance, screen state machines, behavior slices, domain
error taxonomy, cache & degradation policies, and BA-to-SA coverage. Use when
checking SA quality or says /nacl-sa-validate.
NaCl SA Validate For Codex
Validate the SA graph without writing to it. This workflow reports findings and coverage only; repairs belong to the relevant SA skill and require confirmation.
Read ../nacl-core/SKILL.md, ../references/migration-rules.md, and
../references/verification-vocabulary.md before using this workflow.
Goal Compatibility
This skill can be a target behind nacl-goal only through the
validate:module:<MOD-ID> alias. Reference ../nacl-goal/SKILL.md and
../references/goal-codex-contract.md.
Codex itself must not claim that Anthropic /goal ran unless the runtime
exposes it and evidence exists. Load
the packaged validate proof method as
an internal reference only; it is not a project-cwd command. Validation truth
is surfaced through GOAL_PROOF. Use the closed Codex status vocabulary when
the wrapper cannot run.
Workflow
Levels:
internal: SA-only checks.ba-cross: BA-to-SA traceability checks.full: internal plus BA-to-SA checks.- Scoped validation may limit checks to specific modules, use cases, entities, or feature requests when the user provides scope.
Pre-flight:
- Verify graph read tooling.
- Count canonical SA nodes and report whether the graph has data. The
canonical set includes the SA-extension labels:
Decision, the screen-machine labels,Slice,DomainError/ErrorPresentation,CachePolicy/DegradationRule, andAPIEndpoint; a future L14+ level must extend this set in the same change. - Detect schema drift by comparing labels and relationship types with the SA
schema when introspection is available. Known neighbor-layer labels
(BA family incl.
EntityState/GlossaryTerm/SystemContext; TL familyTask/Wave/IntakeItem; legacyRuntimeContract) and zero-count constraint-registered label tokens are NOT drift findings. - Check BA layer availability before BA-to-SA levels. When
fullis requested but the BA layer is empty, run the complete internal set (L1-L13) and skip the BA-to-SA cross-checks with a warning in the report. - Audit exemption properties used by deeper checks:
has_ui,system_only,shared,internal,field_category, andanchor_exempt(L3.7).
Internal checks:
- L1 data consistency: required ids, names, property types, duplicate ids, and orphan nodes.
- L2 connectivity: modules contain use cases and entities, entities have attributes, enums connect to attributes, and core edges are present.
- L3 requirements: use cases have requirements, requirements are typed and
linked, and BA rules mapped to requirements are not orphaned. L3.7 (CRITICAL):
every must-anchor requirement (class functional|validation|behavioral|interface,
read as
coalesce(rq.rq_type,rq.req_type,rq.type,'unknown')— real graphs store the class in any of the three) has aREALIZED_BYedge to the step/field/form that implements it —functional/behavioral->ActivityStep,validation->FormField,interface->Form|Screen; the overloaded reservedtypevalues (nfr|adr|question|assumption) and nodes flaggedanchor_exempt=trueare exempt. L3.7b (WARNING) cross-checks the target label against the class; L3.8 (WARNING, opt-in once any REALIZED_BY exists) flags System steps no requirement realizes. - L4 form-domain traceability: input fields have
MAPS_TO, attributes used by forms exist, and internal attributes are exempt only when flagged. - L5 UC-form validation: UI use cases have forms, user steps reference forms when appropriate, and forms are linked to use cases.
- L6 cross-module consistency: entities are owned by one module unless marked shared, relationships crossing modules are intentional, and dependencies are recorded.
- L7 feature request consistency:
FeatureRequestids are collision-free, linked UCs exist, and requested new or modified scope is traceable. - L8 staleness closure: no node carries
review_status='stale'(read withcoalesce(n.review_status,'current')). A stale node is a downstream of an upstream change that was never re-synced;stale_origin/stale_sincegive the lineage. CRITICAL. In scoped runs, restrict to the changed node's dependents. - L9 decision provenance: every active
FeatureRequesthasIMPLEMENTS -> :Decision; every non-superseded:Decisionhas aJUSTIFIESedge and a non-emptyrationale; superseded decisions carrystatus='superseded'. L9.1–L9.3 CRITICAL, L9.4 WARNING. L9.1 exempts grandfathered FRs viacoalesce(fr.decision_exempt,false)=false; L9.5 (INFO) lists grandfathered FRs so the debt stays visible. Decisions are the graph-native "why" — never stored as standalone markdown. Closing this gap on a pre-provenance project follows the provenance-gap-closure runbook (honest backfill from the FR's own recorded rationale; grandfather only when none is recoverable). - L10 screen state machines (SA-extension connectivity): no orphaned
Screen/ScreenState/ScreenEvent/Transition/ScreenEffect/AnalyticsEventnodes; every extension node has its required parent edge (HAS_SCREEN,HAS_STATE,HAS_EVENT,HAS_TRANSITION,TRIGGERS,EMITS); every Screen hasRENDERS -> Form(exempt viacoalesce(scr.formless,false)=false); load/mutate effects haveCALLS -> APIEndpoint, navigate effectsNAVIGATES_TO -> Screen, analytics effectsEMITS -> AnalyticsEvent; every reified Transition has exactly one same-screenFROM_STATE/TO_STATE/ON_EVENT; no two transitions share `(from_state, on_