validate-provenance.sh: no way to declare a reference file as house-authored #111
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found during the #99 ADR-0020 retrofit, wave 2 (
git-branches).What happens
validate-provenance.shCheck 3 emits an INFO for anyreferences/file with nosource_keysfrontmatter:There is no way to say "this file is house-authored and has no external source". The check tests
if not ref_keys:against the parsed list, andparse_source_keysreturns[]for both a missing key and an explicitsource_keys: []— so the two are indistinguishable and produce the identical INFO.Verified by reading the script rather than inferred.
Why it matters
Some reference files legitimately have no research provenance.
git-branches/references/orchestrator-contract.mdis the concrete case: it holds the request/result JSON schemas, which are the skill's own interface design, not derived from any source. The plugin'ssources.mdnever attributed the original in-body section either.The only ways to silence the INFO today are both wrong:
sources.mdtoo.So the honest choice is to leave a permanent INFO on every house-authored reference file. That is tolerable at today's volume, but it trains readers to skim past provenance INFOs, which is exactly the signal that should stay sharp.
Suggested fix
Give the schema an explicit way to declare it — e.g.
source_keys: []treated as a deliberate declaration distinct from a missing key, or a dedicatedprovenance: house-authoredfield. Either way the check should pass silently on a file that has declared it has no external source, and keep the INFO only for files that never said.Related
Sibling gate defects from the same retrofit: #107, #108, #109.
Fixed on
refactor/adr0020-skill-retrofit(not yet pushed — the PR body will carry the close)Implemented as the first of the two suggested shapes:
source_keys: []is now a declaration, not an absence.validate-provenance.shgaineddeclares_empty_source_keys(fm), matching^\s*source_keys:\s*\[\s*\]\s*$against the raw frontmatter text rather than the parsed list — which is what made the two cases indistinguishable. Check 3 consults it before emitting:A bare
source_keys:with nothing after it is not accepted as the declaration and still emits the INFO — that shape reads as truncation or an abandoned edit, not a decision. The INFO's remedy text now names the escape hatch: "...or declare an explicitsource_keys: []if the file is house-authored and has no external source."The named case is resolved.
git-branches/references/orchestrator-contract.mdcarriessource_keys: []and the skill no longer emits that INFO — verified by running the script againstplugins/git/.apm/skills/git-branches.Worth recording:
agent-audit/references/README.mdalready carriedsource_keys: []onmainand was emitting the INFO anyway. It needed no content change at all — only the script fix. That is the clearest evidence that the declaration was being written by authors and silently discarded.Remaining, honestly: the change is not pinned by a test.
skill-audit/tests/validate-provenance.batsis 17 cases and none of them covers thesource_keys: []declaration or the bare-source_keys:control. Worth adding before this behaviour is depended on.Note the change lands only in
skill-audit/scripts/validate-provenance.sh. Theagent-auditcopy is a different, shorter script with noreferences/directory to check, so there is nothing to mirror there.Fixed by #129, squash-merged to
mainas598a7c3.validate-provenance.shnow treats an explicitsource_keys: []as a declaration that the file is house-authored with no external source — the honest thing this issue said there was no way to say. It passes silently, and the INFO now fires only on a file that declares nothing at all, so silence means "declared" rather than "could not tell".The surrounding fail-open class went with it in the same PR: an unparsable
Contributing filesblock no longer returns the same empty result as an explicit(none), and every skip announces itself. That mattered more than it looked — checks 7/8 had been dead across nine skills for exactly that reason, and waking them is what surfaced #121.Stayed open after the merge because Gitea's closing-keyword parser consumed only the first reference in
Closes #99, #107, …. Closing manually.