feat(self-check): command-restates-standard lint (consistency category, VERSION 1.4.2)

Task 3 leftover. Adds a 'consistency' category to /self-check that catches a standard
drifting back into restating/contradicting the command that owns the rule -- the Syncro
timers failure mode (standard said 'always timer' while /syncro said 'outlier only').

Deterministic half: each manifest.command_standard_links pair's standard must still carry
its defer-to-SSOT pointer (must_reference regex). Lost pointer = WARN. Seeded with
syncro-billing (time-entry-protocol.md -> /syncro). Semantic contradiction pass delegated
to the model in SKILL.md, mirroring check_memory. Verified PASS; negative-tested.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-08 08:29:58 -07:00
parent edcbc5f7ea
commit e180a463e2
5 changed files with 72 additions and 1 deletions

View File

@@ -661,6 +661,36 @@ check_harness_smoke() {
fi
}
# ---------------------------------------------------------------------------
# CHECK: command <-> standard consistency (the "command-restates-standard" lint).
# Deterministic core only: for each manifest-declared (command, standard) link,
# verify the standard still contains its defer-to-SSOT pointer (must_reference).
# A standard that loses the pointer has likely drifted back into RESTATING the
# command's rules -- the exact failure mode behind the Syncro timers contradiction
# (standard said 'always timer' while /syncro said 'outlier only'). The SEMANTIC
# pass (read both, judge actual contradiction) is delegated to the model in
# SKILL.md, mirroring check_memory.
# ---------------------------------------------------------------------------
check_command_standard() {
local has; has="$(jq -r '(.command_standard_links // []) | length' "$MANIFEST" 2>/dev/null)"
[ "${has:-0}" -gt 0 ] 2>/dev/null || return
local topic stdf ref why p
while IFS=$'\t' read -r topic stdf ref why; do
[ -n "$topic" ] || continue
p="$REPO_ROOT/$stdf"
if [ ! -f "$p" ]; then
emit "consistency.$topic" consistency WARN "standard missing for '$topic': $stdf" \
"Restore via /sync, or remove the link from manifest.command_standard_links"
elif grep -qiE "$ref" "$p" 2>/dev/null; then
emit "consistency.$topic" consistency PASS "'$topic' standard defers to the owning command (SSOT pointer present)"
else
emit "consistency.$topic" consistency WARN \
"'$topic' standard ($stdf) lost its defer-to-SSOT pointer ($why)" \
"Re-add the pointer to the owning command, and confirm the standard does NOT restate or contradict it"
fi
done < <(jq -r '(.command_standard_links // [])[] | [.topic, .standard, .must_reference, .why] | @tsv' "$MANIFEST")
}
# ---------------------------------------------------------------------------
# Build the census JSON from accumulated results
# ---------------------------------------------------------------------------
@@ -846,6 +876,7 @@ check_skills_commands
check_duplicates
check_memory
check_harness_smoke
check_command_standard
check_vault
check_connectivity