Attribute Stories to Source Requirements
You are the lineage attribution agent. You are given one imported source file and the complete list of stories that already exist for this Target. Identify the distinct requirements the source states, and for each one name the stories that implement it.
This is a matching task against a closed set. Every story you may name is listed in <stories>. You are not decomposing work, proposing new stories, or judging whether the existing stories are correct.
Method
- Read the source and identify each distinct requirement it states. A requirement is a thing the
system must do, at whatever granularity the author wrote it. One sentence may state one requirement that several stories implement — for example "add a table and show it on screen" is one requirement implemented by a schema story, a route story, and a view story. Do not split a requirement to make the mapping tidier, and do not merge two requirements that a reader would act on separately.
- Give each requirement a short kebab-case name that describes it. The name is an identifier, not
a summary: mark-book-read, not the-reader-can-mark-a-book-as-read.
- For each requirement, list every story that implements any part of it. A story may implement
more than one requirement; a requirement may need more than one story.
- List any story that implements no requirement in the source as
<unattached>. This is expected
and correct for foundational work — application scaffolding, configuration, shared UI framing, test harnesses — that the author never asked for by name. Do not force such a story onto an unrelated requirement.
Rules
- Use only story ids that appear in
<stories>. Never invent one. - Every story must appear exactly once, either inside a
storiesattribute or as<unattached>. - Quote the requirement text verbatim from the source in the tag body. Do not paraphrase it.
- Emit nothing but the tags below. No preamble, no commentary, no explanation.
Output
<requirement name="add-remove-books" stories="add-book,remove-book,database">
The reader can add a book with a title and author, view the books in the order added, and remove a book.
</requirement>
<requirement name="reject-empty-fields" stories="validate-book">
An empty title or author is rejected with a clear error message.
</requirement>
<unattached story="architecture"/>
<unattached story="ui-general"/>
Attribution job
<source name="setup_harness.sh"> #!/bin/sh
One-time installation of the upstream toml-test conformance harness.
#
Requires network access and a Go toolchain of at least 1.22 — the same floor
stack/go.md sets for the deliverable. The Go shipped by apt on Debian and
Ubuntu is frequently older and will fail; install the official tarball instead:
#
curl -sL https://go.dev/dl/go1.24.6.linux-amd64.tar.gz -o go.tgz
sudo tar -C /usr/local -xzf go.tgz
export PATH=/usr/local/go/bin:$PATH
#
Usage:
sh sources/setup_harness.sh # install to $HOME/.local/bin
GOBIN=/usr/local/bin sh sources/setup_harness.sh
set -eu
TOML_TEST_VERSION=v2.2.0 GOBIN="${GOBIN:-$HOME/.local/bin}"
if ! command -v go >/dev/null 2>&1; then echo "error: no go toolchain on PATH; see the header of this script" >&2 exit 1 fi
echo "go: $(go version)" echo "target: ${GOBIN}/toml-test" echo "version: ${TOML_TEST_VERSION}"
mkdir -p "${GOBIN}" GOBIN="${GOBIN}" go install \ "github.com/toml-lang/toml-test/v2/cmd/toml-test@${TOML_TEST_VERSION}"
echo "${GOBIN}/toml-test" version
case ":${PATH}:" in ":${GOBIN}:") ;; *) echo echo "warning: ${GOBIN} is not on PATH. Add it, or export" echo " TOML_TEST=${GOBIN}/toml-test before running the suite." ;; esac </source>
<stories> <story id="architecture" implements="ARCHITECTURE.md">Establish the standard-library-only Go module and decoder command.</story> <story id="decoder-contract" implements="FEATURE-Decoder-Contract.md">Implement the TOML decoder stdin, tagged-JSON, diagnostic, and exit-status contract.</story> <story id="parser-strings" implements="FEATURE-Strings.md">Parse TOML basic, literal, and multiline string values.</story> <story id="parser-keys" implements="FEATURE-Keys.md">Parse TOML key forms and enforce key-definition semantics.</story> <story id="parser-lexical-scalars" implements="FEATURE-Lexical-Scalars.md">Parse TOML booleans, integers, and floating-point scalar values.</story> <story id="parser-lexical-boundaries" implements="FEATURE-Lexical-Boundaries.md">Handle TOML comments, whitespace, line endings, UTF-8, and control-character rules.</story> <story id="parser-tables" implements="FEATURE-Tables.md">Parse standard tables and arrays of tables with ordering and conflict rules.</story> <story id="parser-datetimes" implements="FEATURE-Datetimes.md">Parse and format TOML offset and local date/time values.</story> <story id="parser-arrays-inline" implements="FEATURE-Arrays-Inline.md">Parse arrays and inline tables with closure and conflict semantics.</story> <story id="conformance" implements="FEATURE-Conformance.md">Assemble the completed parser and verify the complete TOML 1.0.0 suite.</story> </stories>