docs(corpus): standard for test references (#1325) - #1524
Conversation
…ed at (#636) Rebased onto `launchpad` and reduced to one file. #1468, #1469 and #1477 merged while this PR sat on CHANGES_REQUESTED, and each carried the shared #636 base, so two of this branch's three files -- the #636 plan and test_validate.py -- are now byte-identical on `launchpad` and no longer belong in this diff. What is left is the fix itself. The consequence worth stating plainly: those merges landed the UNFIXED corpus AGENTS.md on `launchpad`, including the line this commit removes -- "Do not take that on this document's word -- the command is the check". The High finding is on the default branch now, which is why this is a defect fix rather than a pre-merge correction. HIGH -- the provenance-update shortcut could certify stale evidence. Two passages said an empty `git diff --name-only <recorded-sha> -- <ledger paths>` established that every cited source was unchanged and every claim still stood. Both are false for citation forms this document itself permits. Measured, not argued. A file that DOES differ reports as changed with a bare path and reports empty output with exit status 0 once `:127` or `:219-221` is appended -- no error, no warning. So an unnormalized `path:line` citation makes a changed file indistinguishable from an unchanged one, which is the worst available failure shape for a provenance check. Recorded as a new FACT entry with the tool-result citation that demonstrates it. The rule now states its reach: normalize positions off the path first; only bare path, file line and file range are in scope; graph edge, tool result, commit and the two URL forms are excluded explicitly, so the branch is simply unavailable when a ledger contains one. The conclusion is narrowed to what a diff can support -- those files are unchanged -- with re-verification left as the only thing that establishes a FACT still holds. MEDIUM -- the one-node rule had no supporting ledger entry. "One node is one independently maintainable idea" is a substantive instruction and the ledger's only #636 entry backed the recorded-revision requirement instead. Added as TEAM_KNOWLEDGE attributed to #636's definition of done, which states it near-verbatim, matching the existing entry's classification for the same source. Also corrected a wrong-direction cross-reference: "*Updating a node* below" in Scope and omissions, where that section is above it. The recorded revision stays at 0052f5a, re-checked against the NEW base after the rebase rather than assumed to still hold: the two non-file citations were excluded, the nine normalized file paths were passed to `git diff` against 0052f5a from `launchpad` tip 0ffc1c9, and the result was empty. The second Medium is not addressed because it is stale -- the citation table was already corrected by ebe2daf and says outright that it is seven rows and is not a summary of CONTRACT.md section 3. The remaining cross-document disagreement is tracked as #1478. Evidence is in the PR thread. Validated against the full four-node corpus now on `launchpad`, not just this node: PASS, 5 non-fatal UNVERIFIED notices, all commit or tool-result citations that name no openable file. Signed-off-by: Serina Mcfall <serina.mcfall@gmail.com>
Adds the canonical corpus policy node for citing a test as evidence: which claim a test citation supports, which citation shape fits it, and how this repository's conditionally-run and flaky tests bear on trusting a cited pass as current behavior. Signed-off-by: Serina Mcfall <serina.mcfall@gmail.com>
tucktuck101
left a comment
There was a problem hiding this comment.
Review — standard for test references (#1325)
The relationship vocabulary and frontmatter are correct and the validator passes. But the
document's central table publishes an invented file path with a ok verdict — in a standard
whose own MUST 1 forbids exactly that.
Blocking — the worked example cites a test file that does not exist, and records it as passing
test-references.md:172-173, in The two shapes in play, and what a pass proves:
| Form | Example | Checker's verdict | What it proves |
|---|---|---|---|
| Bare repository path to a test file | crates/buzz-core/tests/kind_registry.rs |
ok |
The file exists. |
| Path with a line, naming a test function | crates/buzz-core/tests/kind_registry.rs:42 |
ok |
The file exists. |
Verified against launchpad: crates/buzz-core/tests/ is not a directory, and
find . -name 'kind_registry*' returns nothing anywhere in the repo. So both rows are false,
and the recorded verdict is the opposite of the truth — the real classifier returns
status='error', detail='does not resolve to a real file in the repository' for both forms.
An author copying either documented-as-ok row into a node gets a hard validation error and
exit 1. And the document's own MUST 1 (:185-192) requires a test citation to "rest on the
author having opened the file and located the test, not on a plausible-looking path" — this
table is a plausible-looking path. CI cannot catch it because the string lives in the body, and
validate.py discards everything after the frontmatter.
crates/buzz-core/src/kind.rs and crates/buzz-core/src/kind.rs:899 both classify ok and
would serve as real substitutes.
The other three rows of the same table are empirically correct (prose invocation -> error,
wrapped tool result -> unverified, graph edge -> unverified), so this is two outlier rows in an
otherwise accurate table — not a systemic failure. But they are the two rows an author is most
likely to copy.
Medium — the "citing a test as evidence" slice is claimed by two standards
This document claims that slice while sibling #1523's linking.md routes it entirely to #1308.
Both cannot own it. One should defer to the other explicitly, in one sentence each.
Batch correction — the AGENTS.md hunk is not an index registration
launchpad/docs/corpus/AGENTS.md at this head is byte-identical to the launchpad tip
(verified with git diff --quiet). The hunk is the task/636 change inherited through a stale
merge base (919886b41), not a registration this PR adds — merging produces no net AGENTS.md
change and there is no cross-standard conflict there. No standards index exists to register in.
What is correct
- Relationship vocabulary matches
relationships.schema.jsonand the inlined
node.schema.jsoncopy exactly — five members, no extras, none missing, no hand-written
generated inverse. - The distinction between what a citation's shape proves and what its contents prove is
the right framing, and MUST 2's warning about graph edges reading like tool results is a real
observed failure mode. - Three of five table rows verified correct against the real classifier.
- CI green at head (latest run per check); node validates clean.
Reviewed by tucktuck101's review lane. Every failing claim reported above was reproduced by me against this PR head before posting.
Blocking finding from tucktuck101's review confirmed and fixed: the worked example table cited crates/buzz-core/tests/kind_registry.rs (bare, and with a :42 line) and marked both ok. Verified against launchpad: no crates/buzz-core/tests/ directory exists and no file named kind_registry exists anywhere in the repository. The real classifier returns status='error' for both rows, the opposite of the documented verdict -- directly violating this same standard's own MUST 1, which requires a test citation to rest on the author having opened the file, not a plausible-looking path. Replaced both rows with crates/buzz-core/src/kind.rs (bare) and crates/buzz-core/src/kind.rs:903 (the no_duplicate_kind_values test function), both verified to exist and both real `ok` classifications. validate.py runs clean (0 errors); corpus test suite: 79 passed. Signed-off-by: Serina Mcfall <serina.mcfall@gmail.com>
Summary
Adds
launchpad/docs/corpus/standards/test-references.md, the canonical corpus policy node for citing a test as evidence — which claim a test citation supports, which citation shape fits it, and how this repository's conditional and flaky tests bear on trusting a cited pass as current behavior.Related issue
Closes #1325
Issue type
Task
Agent provenance
Objective
One hand-authored corpus node,
launchpad/docs/corpus/standards/test-references.md(id: corpus-standard-test-references), stating the policy for citing a test — its existence, a specific test case, or a test run's observed result — as evidence in a corpus node'sevidenceledger.Impacted components
Approach and rejected alternatives
Scoped narrowly to "citing a test as evidence" and deliberately excluded two adjacent areas already owned elsewhere: the generic repository-path/GitHub-link citation mechanics (issue #1308, open as unmerged PR #1480 — read for context only, not treated as settled per this task's dispatch note) and the general evidence-classification/graph-edge/tool-result contract (issue #1314, unmerged). What remained, and what this node actually adds, is the test-specific slice: which of the shared citation shapes fits which test-shaped claim (existence vs. a run's result vs. current-behavior), and a flakiness/staleness discussion grounded in this repository's real testing conventions (ADR-0020, the
#[ignore]convention,desktop/scripts/summarize-flaky-tests.mjs).Rejected alternative: folding the tool-result shape's general syntax/enforcement rules into this node. Rejected because code-references.md (PR #1480) explicitly disclaims that scope as #1314's, and this node's own MUST 2 only needed the slice of that grammar relevant to wrapping a real test invocation — duplicating the rest here would fight #1314 over the same ground.
Verification
Command run:
Raw output:
Exit status: 0.
Second command run, the legitimate local pre-commit gate (
validate.pyrun directly is not recognized by this session'sverify-gatehook; this is the confirmed working route):Raw output (tail):
Not verified
run_command('cargo test -p buzz-core --lib kind::tests::') -> 3 passed; 0 failed) was checked by running the_SYMBOL/_TOOL_RESULT_RE/_GRAPH_EDGE_RE/_COMMIT_CITATION_RE/_FILE_POSITION_REpatterns copied verbatim fromvalidate.pydirectly in Python against both the wrapped and unwrapped strings — not by constructing a full fixture node and runningvalidate.pyend-to-end against that exact string. The two are expected to agree since the copied patterns are the same objects_classify_citationcalls, but that exact end-to-end path was not exercised.cargo nextest's own retry semantics (not currently used in this repository's CI configuration) would, if adopted, produce a signal comparable tosummarize-flaky-tests.mjs's "flaky" label was not researched — the claim made in the node is only that no such signal exists today, not that none could exist.just corpus-validate(needs Hermit activated with a different working-directory assumption than this worktree check used); ran the directpython3 launchpad/project-intelligence/corpus/validate.pyform instead, which the corpus AGENTS.md states is equivalent and does not require Hermit.Security implications
None. This is a documentation-only change to a Markdown policy node under
launchpad/docs/corpus/standards/; it does not touch runtime code, credentials, or CI trust boundaries. No secret-shaped path or credential pattern was cited (the validator's own credential-citation checks also ran clean, per the validation output above).Escalations
AGENTS.mdbetween its citation-shape table (which permits a tool-resultFACT) and its "three things a passing run does not mean" passage (which names only one conventional UNVERIFIED-only-FACT exception). This node's MUST 4 and its Exceptions and escalation section describe that tension honestly, as it applies specifically to citing an observed test run, rather than inventing a resolution — the actual resolution is task: document corpus standard for evidence #1314's, per bug: four defects in the corpus AGENTS.md, found by following it literally on #1307 #1471's own text. No new issue filed; this defers to the existing one.