Skip to content

docs(corpus): standard for test references (#1325) - #1524

Merged
tucktuck101 merged 3 commits into
launchpadfrom
task/1325-corpus-standard-test-references
Aug 28, 2026
Merged

docs(corpus): standard for test references (#1325)#1524
tucktuck101 merged 3 commits into
launchpadfrom
task/1325-corpus-standard-test-references

Conversation

@serina-mcfall

Copy link
Copy Markdown

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

Field Value
Harness / provider Claude Code
Model claude-sonnet-5
Session reference N/A
Initiating human N/A - dispatched as part of a batch of 5 sibling corpus-standard tasks under PRD #605; no specific human handle given at dispatch

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's evidence ledger.

Impacted components

  • launchpad/docs/corpus/standards/test-references.md

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:

python3 launchpad/project-intelligence/corpus/validate.py

Raw output:

UNVERIFIED  corpus-agents: evidence entry 1, citation 1: is a commit reference, which names no openable file
UNVERIFIED  corpus-agents: evidence entry 20, citation 1: is a graph-edge or tool-result citation, which names no openable file
UNVERIFIED  corpus-readme: evidence entry 1, citation 1: is a commit reference, which names no openable file
UNVERIFIED  corpus-standard-confidence: evidence entry 1, citation 1: is a commit reference, which names no openable file
UNVERIFIED  corpus-standard-decision-references: evidence entry 1, citation 1: is a commit reference, which names no openable file
UNVERIFIED  corpus-standard-test-references: evidence entry 1, citation 1: is a commit reference, which names no openable file
UNVERIFIED  corpus-standard-test-references: evidence entry 6, citation 2: is a graph-edge or tool-result citation, which names no openable file
UNVERIFIED  corpus-standard-test-references: evidence entry 9, citation 2: is an external URL this validator can neither pin nor open
UNVERIFIED  corpus-standard-test-references: evidence entry 16, citation 3: is a graph-edge or tool-result citation, which names no openable file
PASS  corpus validation found no errors; 9 item(s) reported unverified

Exit status: 0.

Second command run, the legitimate local pre-commit gate (validate.py run directly is not recognized by this session's verify-gate hook; this is the confirmed working route):

python3 -m unittest discover -s launchpad/docs/corpus/schema/tests -p "test_*.py" -v

Raw output (tail):

test_full_fixture_passes (test_schema.ValidFixtureTest.test_full_fixture_passes) ... ok
test_minimal_fixture_passes (test_schema.ValidFixtureTest.test_minimal_fixture_passes) ... ok

----------------------------------------------------------------------
Ran 27 tests in 0.040s

OK
  • Tests or checks were run and the raw output is pasted above
  • The diff is confined to the scope of the linked issue
  • No secrets, keys, tokens or hostnames were added to tracked files

Not verified

  • The wrapped tool-result citation form used in MUST 2 (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_RE patterns copied verbatim from validate.py directly in Python against both the wrapped and unwrapped strings — not by constructing a full fixture node and running validate.py end-to-end against that exact string. The two are expected to agree since the copied patterns are the same objects _classify_citation calls, but that exact end-to-end path was not exercised.
  • No corpus node yet cites a test as evidence of any claim, so this standard is written from the validator's own regular expressions and from real testing conventions documented elsewhere in the repository (ADR-0020, TESTING.md, ARCHITECTURE.md, the flaky-test summarizer script), not from a worked example inside the corpus.
  • Whether cargo nextest's own retry semantics (not currently used in this repository's CI configuration) would, if adopted, produce a signal comparable to summarize-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.
  • Did not run just corpus-validate (needs Hermit activated with a different working-directory assumption than this worktree check used); ran the direct python3 launchpad/project-intelligence/corpus/validate.py form 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

…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>
@serina-mcfall serina-mcfall added the by:agent Filed or authored by an AI agent, not a human label Aug 27, 2026
@serina-mcfall
serina-mcfall marked this pull request as ready for review August 27, 2026 01:51
@tucktuck101 tucktuck101 self-assigned this Aug 27, 2026

@tucktuck101 tucktuck101 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json and the inlined
    node.schema.json copy 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.

@tucktuck101 tucktuck101 removed their assignment Aug 27, 2026
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>
@tucktuck101
tucktuck101 merged commit b83b2e1 into launchpad Aug 28, 2026
23 checks passed
@serina-mcfall
serina-mcfall deleted the task/1325-corpus-standard-test-references branch August 31, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

by:agent Filed or authored by an AI agent, not a human

Projects

None yet

Development

Successfully merging this pull request may close these issues.

task: document corpus standard for test references

2 participants