Skip to content

docs(corpus): add implementation-reference template (#1341) - #1555

Merged
tucktuck101 merged 1 commit into
launchpadfrom
task/1341-corpus-template-implementation-reference
Aug 28, 2026
Merged

docs(corpus): add implementation-reference template (#1341)#1555
tucktuck101 merged 1 commit into
launchpadfrom
task/1341-corpus-template-implementation-reference

Conversation

@serina-mcfall

Copy link
Copy Markdown

Summary

Adds launchpad/docs/corpus/templates/implementation-reference.md: the corpus template for a node documenting how a piece of code concretely realizes a spec, decision, or contract (a traceability artifact, using node.schema.json's implementation surface and relationships.schema.json's implements edge). States the boundary against #1346/reference (surface vs. form are orthogonal axes) explicitly.

Related issue

Closes #1341

Issue type

Task


Agent provenance

Field Value
Harness / provider Claude Code
Model claude-sonnet-5
Session reference N/A - harness does not expose a run id/URL for this session
Initiating human @serina-mcfall

Objective

Create launchpad/docs/corpus/templates/implementation-reference.md as the template a corpus node uses when its subject is a piece of code's concrete realization of a spec/decision/contract.

Impacted components

  • launchpad/docs/corpus/templates/implementation-reference.md

Approach and rejected alternatives

Issue #1341's own Definition of Done is the standards-track boilerplate ("single canonical policy node") copied across all 26 templates-track issues (#1326-#1351) per the batch dispatch brief for this task set (confirmed independently by opening the issue body directly). The real acceptance bar is parent Feature #605's own checklist item: "every template states its purpose, required sections, evidence expectations and the industry model/standard it adapts" (verified by opening #605 directly). This node is built against that sentence; the mismatch is documented explicitly in the node's own "Note on Definition of Done" section.

The most overlap-risky part of this task is the naming collision with #1346/reference (unmerged, PR #1534). I read PR #1534's full diff before drafting (git show origin/task/1346-corpus-template-reference:launchpad/docs/corpus/templates/reference.md). #1346 is a Diátaxis Reference documentation-form template — it fixes the prose shape and lets the corpus type surface vary with the subject. This node fixes the opposite axis: it documents the implementation surface (or occasionally another surface value the realizing artifact calls for) and requires an implements relationship edge, while letting the documentation form vary. The two are orthogonal, not competing, and a single node could in principle satisfy both templates at once without either being redundant. Stated concretely in the node's "Boundary" section rather than left as a hand-wavy "reference vs. something else" distinction.

Rejected alternative: grounding the template in the C4 model or another architecture-diagramming framework (the reflex choice given the "reference" name and prior sibling templates' precedent). Rejected because the batch brief's research check already confirmed the unmerged research note doesn't cover this topic, and node.schema.json's own implements relationship type ("source is the concrete realization of target") together with a real in-repo precedent (crates/git-sign-nostr/README.md's "See NIP-GS for the full specification" pointer) made a traceability-matrix framing (ISTQB Glossary) the better-grounded, more concrete fit than a documentation-form or diagramming framework.

A real, worth-recording finding while drafting: an early WebFetch of https://raw.githubusercontent.com/adr/madr/main/template/adr-template.md returned plausible-looking content, but adr/madr's main branch does not exist (gh api repos/adr/madr/commits/main → 404; the repo's default branch is develop). The quoted "Confirmation" guidance text happened to be accurate, but the citation itself was pinned to a non-existent ref, and validate.py caught it (see raw output below). Every MADR-sourced claim in the final node was re-verified and re-cited directly against gh api repos/adr/madr/contents/...?ref=develop and pinned to the real develop HEAD commit SHA (d1698d0b8b6b8ef83a0a255d3e3920cbcda159ba) before committing. Flagging this because it is a real WebFetch reliability gap other batches' agents citing external GitHub-hosted templates should watch for.

Pipeline: plan-issue -> self-review-plan -> build-change -> self-review-code (citation-by-citation re-verification against primary sources, described above) -> self-adjudicate -> cross-model final pass substituted by same-model adversarial self-review, since Codex is still down (#1467) -> findings handled (none required escalation; see Escalations) -> draft PR.

Verification

Command run:

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

Raw output:

test_duplicate_audiences_rejected (test_schema.InvalidFixtureTest.test_duplicate_audiences_rejected) ... ok
test_fact_with_forbidden_fields_rejected (test_schema.InvalidFixtureTest.test_fact_with_forbidden_fields_rejected) ... ok
test_inference_missing_confidence_rejected (test_schema.InvalidFixtureTest.test_inference_missing_confidence_rejected) ... ok
test_malformed_id_rejected (test_schema.InvalidFixtureTest.test_malformed_id_rejected) ... ok
test_missing_audiences_rejected (test_schema.InvalidFixtureTest.test_missing_audiences_rejected) ... ok
test_missing_evidence_field_rejected (test_schema.InvalidFixtureTest.test_missing_evidence_field_rejected) ... ok
test_missing_evidence_for_fact_rejected (test_schema.InvalidFixtureTest.test_missing_evidence_for_fact_rejected) ... ok
test_missing_evidence_for_inference_rejected (test_schema.InvalidFixtureTest.test_missing_evidence_for_inference_rejected) ... ok
test_missing_identity_rejected (test_schema.InvalidFixtureTest.test_missing_identity_rejected) ... ok
test_missing_origin_rejected (test_schema.InvalidFixtureTest.test_missing_origin_rejected) ... ok
test_missing_status_rejected (test_schema.InvalidFixtureTest.test_missing_status_rejected) ... ok
test_missing_type_rejected (test_schema.InvalidFixtureTest.test_missing_type_rejected) ... ok
test_team_knowledge_missing_provided_by_rejected (test_schema.InvalidFixtureTest.test_team_knowledge_missing_provided_by_rejected) ... ok
test_unknown_audience_value_rejected (test_schema.InvalidFixtureTest.test_unknown_audience_value_rejected) ... ok
test_unknown_origin_rejected (test_schema.InvalidFixtureTest.test_unknown_origin_rejected) ... ok
test_unknown_relationship_type_rejected (test_schema.InvalidFixtureTest.test_unknown_relationship_type_rejected) ... ok
test_unknown_status_rejected (test_schema.InvalidFixtureTest.test_unknown_status_rejected) ... ok
test_unknown_type_rejected (test_schema.InvalidFixtureTest.test_unknown_type_rejected) ... ok
test_unrecognized_field_rejected (test_schema.InvalidFixtureTest.test_unrecognized_field_rejected) ... ok
test_wrong_direction_relationship_rejected (test_schema.InvalidFixtureTest.test_wrong_direction_relationship_rejected) ... ok
test_every_enum_member_has_metadata (test_schema.RelationshipEnumMetadataTest.test_every_enum_member_has_metadata) ... ok
test_every_metadata_entry_has_directionality_and_inverse (test_schema.RelationshipEnumMetadataTest.test_every_metadata_entry_has_directionality_and_inverse) ... ok
test_relationship_enum_matches_node_schemas_inlined_copy (test_schema.RelationshipEnumMetadataTest.test_relationship_enum_matches_node_schemas_inlined_copy) ... ok
test_node_schema_is_valid_json_schema (test_schema.SchemaMetaValidityTest.test_node_schema_is_valid_json_schema) ... ok
test_relationships_schema_is_valid_json_schema (test_schema.SchemaMetaValidityTest.test_relationships_schema_is_valid_json_schema) ... ok
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.039s

OK

Also run, corpus validator (exit 0 required and obtained):

$ python3 launchpad/project-intelligence/corpus/validate.py
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-template-implementation-reference: evidence entry 1, citation 1: is a commit reference, which names no openable file
UNVERIFIED  corpus-template-implementation-reference: evidence entry 5, citation 1: is a graph-edge or tool-result citation, which names no openable file
UNVERIFIED  corpus-template-implementation-reference: evidence entry 9, citation 1: is a graph-edge or tool-result citation, which names no openable file
UNVERIFIED  corpus-template-implementation-reference: evidence entry 10, citation 1: is an external URL this validator can neither pin nor open
UNVERIFIED  corpus-template-implementation-reference: evidence entry 10, citation 2: is an external URL this validator can neither pin nor open
PASS  corpus validation found no errors; 10 item(s) reported unverified
  • 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

  • No node has yet been authored from this template, so whether the required sections (Realization statement, Target, Implementation surface, Divergences, Verification, Relationships, Scope and omissions) are actually sufficient for a real instance has not been tested against one. The node's own "Expected but not verified" section names this.
  • Whether a target spec/decision/contract (an ADR, a NIP document) will typically already have its own corpus node id by the time an implementation-reference node is written about it was not checked — depends on how quickly those artifacts get corpus nodes, which is outside this task.
  • #1346 is unmerged at time of writing; this node cites its stated surface/form distinction as TEAM_KNOWLEDGE, not FACT, for exactly that reason, and has not been re-checked against task: define the reference corpus template #1346's content after this PR was opened (only against the diff as it stood at PR-open time).
  • Did not independently verify the istqb-glossary.page mirror against the official glossary.istqb.org site — that site is JS-rendered and returned no fetchable content via WebFetch; corroborated instead via two independent tool calls (WebSearch synthesis + two separate WebFetch calls to distinct mirror pages) that agreed on the same quoted text.

Security implications

None. This is a documentation-only change (one new Markdown file under launchpad/docs/corpus/templates/) with no code, config, or secret-bearing content. Reviewed the prose for gitleaks-hazard-shaped phrases (slash-separated pairs, "key"/"token" near a colon) before committing, per the batch dispatch brief's note about PR #1548's false-positive on "bucket/prefix"; found none.

Escalations

None specific to this node. Noted but not escalated as a new issue (already covered by existing #1544, "several PRs cite bare GitHub issue URLs as FACT instead of TEAM_KNOWLEDGE"): PR #1534 (#1346/reference) cites https://github.com/launchpad-26/buzz/issues/605 and its own issue as FACT rather than TEAM_KNOWLEDGE, which launchpad/docs/corpus/AGENTS.md states should be TEAM_KNOWLEDGE for issue/PR/discussion sources. This node's own equivalent citations (to #605 and #1341) are classified TEAM_KNOWLEDGE to follow AGENTS.md correctly rather than copy the pattern.

Create the template for a corpus node whose subject is a piece of
code's concrete realization of a spec, decision, or contract -- a
traceability artifact, distinct from #1346/reference's Diataxis
documentation-FORM template (surface vs. form are orthogonal axes).

Grounded in the ISTQB Glossary's traceability/traceability-matrix
definitions, MADR's Confirmation section (and the gap that none of
this repository's own 51 ADRs use it), and this repository's own
REQUIREMENTS.md Traceability section and git-sign-nostr/NIP-GS
pairing as real working precedent.

Closes #1341

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 06:18
@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 — implementation-reference template (#1341)

Every code and path citation in this node resolves at head — I checked, and there is no invented
code citation here. The template's job (point a corpus claim at real code durably) is the right
one and the required sections serve it. One false claim about this repository, and it is
load-bearing for the template's central argument.

High — this repository's ADRs are not MADR-structured

The ledger entry (entry_class: FACT) and the body both assert that this repo's decision records
are "visibly MADR-structured" / "several of this repository's own ADRs are visibly structured
after" MADR.

Heading census across all 51 files in launchpad/decisions/, run on launchpad:

## Context and Problem Statement   0      ## Context        50
## Decision Outcome                0      ## Decision       50
files mentioning MADR              0      ## Consequences   50
                                          ## Provenance     45

That is the classic Nygard triad plus two house sections. MADR's signature headings appear zero
times, and no ADR mentions MADR at all.

This matters because the whole "MADR supplies the gap" argument rests on our ADRs being
MADR-shaped documents that skip Confirmation — when they are Nygard-shaped documents that never
had such a section to skip. The entry's only citation is the ### Confirmation grep, which
establishes the absence but says nothing about document shape.

The gap you are naming is real; rest it on what is true: MADR names a Confirmation section, this
repo's ADR format has no equivalent, so "does the code match what was decided?" has no home today.

Medium — the implements-exclusivity claim is contradicted by the schema it cites

The entry calls implements "the one relationship type in the corpus whose stated purpose is
code-realizes-spec traceability, not documentation-to-documentation linkage."
relationships.schema.json:35-39 reads "source is the concrete realization of target (e.g. a
template instance of a standard
)" — a documentation-to-documentation example, and the only
example the schema gives. Nothing in the schema mentions code.

Sibling #1546 relies on the schema's actual reading, so two nodes in this batch read the same
schema line incompatibly. Your use of implements stays legal; only the exclusivity clause is
unsupported. Suggested: "...directionality 'source is the concrete realization of target'; the
schema's own example is documentation-to-documentation, and this template extends the same edge
to code-realizes-spec."

Low — the MUST-level implements edge is rendered only as a body bullet

Relationships makes the edge a MUST ("must declare implements toward its target ... an edge to
a nonexistent id is a hard validation error"), but the skeleton renders it only as prose under
## Relationships. relationships is a frontmatter array, and neither the merged nodes nor the
validator read a body section. Omitting frontmatter from the skeleton is the batch norm (21 of 23
siblings), so this is not an outlier — but this is the only template that raises the edge to a
MUST, so an author copying the skeleton literally declares zero relationships while believing the
MUST is satisfied.

Not findings, ruled out on evidence

  • Index registration: the corpus AGENTS.md and README.md both state that indexes are
    generated derived views, never hand-authored, and the ten-step "Creating a node" procedure has
    no registration step. All 26 template PRs leaving AGENTS.md untouched is correct.
  • 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.

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: define the implementation reference corpus template

2 participants