Skip to content

feat(star): the knowledge indexer records provenance, and stops scraping a function that is gone - #727

Merged
David-Noble-at-work merged 1 commit into
developfrom
fix/indexer-allows-domain-readme
Aug 28, 2026
Merged

David-Noble-at-work merged 1 commit into
developfrom
fix/indexer-allows-domain-readme

Conversation

@David-Noble-at-work

Copy link
Copy Markdown
Contributor

Second half of the indexer work begun in #719. That change stopped the indexer destroying metadata;
this one makes it record what it cannot know, and stop reporting a section it has never been able to
fill.

Provenance is declared, never inferred

Every index entry now carries generated: true or false. The indexer refuses on an entry that
omits it, or declares a non-boolean.

Whether a file is authored or emitted by a pipeline is not derivable from its path —
knowledge/package-authoring/bindings/ holds pipeline output while its sibling directories hold
hand-written material. Getting it wrong is how a regeneration overwrites something a person wrote,
which is devlore-registry#80.

A new file is recorded as authored rather than refused, and that is a decision about which way
to be wrong:

mistake cost
generated file labelled authored one needless review of a regeneration
authored file labelled generated a pipeline overwrites it — #80

The default errs toward the recoverable harm, and every one is announced in the run output. A
pipeline adding its own output should write the entry itself.

Two more asset types

references/ — generated reference material gets a home whose name states what it is, rather
than sitting at a domain root looking accidental.

README.md at a domain root — furniture, orientation addressed to a reader. The same call
.github/frontmatter-exempt makes for a repository's own README, and named explicitly so admitting
a second kind of loose file stays a decision.

The platforms extraction is dropped, not repaired

It parsed a buildSystemPrompt function in plan.go for a line reading Known platforms:. Neither
the function nor that string has existed in cmd/writ/writ/migrate since it was refactored. Two
guards — file.exists on the path, an empty function list — turned that into an empty list reported
as success. Every generated reference has carried platforms: [] while its three siblings populated
correctly.

Removed with everything that fed it: the _extract_platforms helper, the writ-structure.yaml
scrape that supplied its comparison set, and an undocumented_platform contract check that could
never fire because the list it iterated was always empty.

If platform vocabulary is wanted, it should come from a constant family the way the other three do,
not scraped from prose.

Also

The extractor writes references/writ-migrate-vocabulary.yaml rather than systems-reference.yaml
at the domain root. The old name described one of its four constant families — source systems,
encryption systems, repo layers, platforms — and left the rest looking arbitrary.

Tests

Thirteen, //go:build integration. Both halves: what is preserved, and each way the tree and its
index can disagree — including the three new provenance cases.

Ordering

devlore-registry's matching change lands second. It re-enables the index step, which builds
star from this repository's default branch, so merging it first would run the old indexer against
a tree it will refuse.

Phase A of docs/plans/cag-epic.md.

…ing a function that is gone

Second half of the indexer work begun in #719. That change stopped the indexer
destroying metadata; this one makes it record what it cannot know and stop
reporting a section it has never been able to fill.

PROVENANCE IS DECLARED, NEVER INFERRED

Every index entry now carries generated: true or false, and the indexer refuses on
an entry that omits it or declares a non-boolean. Whether a file is authored or
emitted by a pipeline is not derivable from its path --
knowledge/package-authoring/bindings/ holds pipeline output while its sibling
directories hold hand-written material -- and getting it wrong is how a
regeneration comes to overwrite something a person wrote. That is
devlore-registry#80, which deleted curated metadata precisely because nothing
recorded which was which.

A NEW file is recorded as authored rather than refused. Not because the path says
so, but because the two ways of being wrong are not symmetric: labelling a
generated file authored costs one needless review of a regeneration, while
labelling an authored file generated invites a pipeline to overwrite it. The
default errs toward the harm that is recoverable, and each one is announced in the
run output. A pipeline adding its own output should write the entry itself.

A NINTH AND TENTH ASSET TYPE

references/ holds generated reference material, so derived content has a home whose
name states what it is rather than sitting at a domain root looking accidental.
README.md is admitted at a domain root as furniture -- orientation addressed to a
reader, the same call .github/frontmatter-exempt makes for a repository's own
README. Named explicitly, so admitting a second kind of loose file stays a decision
somebody has to make.

THE PLATFORMS EXTRACTION IS DROPPED, NOT REPAIRED

It parsed a buildSystemPrompt function in plan.go for a line reading "Known
platforms:". Neither the function nor that string has existed in
cmd/writ/writ/migrate since it was refactored. Two guards -- file.exists on the
path, and an empty function list -- turned that into an empty list reported as
success, so every generated reference has carried `platforms: []` while its three
sibling sections populated correctly.

Removed with everything that fed it: the _extract_platforms helper, the
writ-structure.yaml scrape that supplied its comparison set, and an
undocumented_platform contract check that could never fire because the list it
iterated was always empty. If platform vocabulary is wanted it should be extracted
from a constant family the way the other three are, not scraped from prose.

The extractor also writes references/writ-migrate-vocabulary.yaml rather than
systems-reference.yaml at the domain root. The old name described one of its four
constant families and left the rest looking arbitrary; the new one states whose
vocabulary it is.

Thirteen integration tests cover both halves -- what is preserved, and each way the
tree and its index can disagree. Phase A of docs/plans/cag-epic.md.

devlore-registry's matching change lands second: it re-enables the index step,
which builds star from this branch's default.
@David-Noble-at-work
David-Noble-at-work merged commit 283fb50 into develop Aug 28, 2026
12 checks passed
@David-Noble-at-work
David-Noble-at-work deleted the fix/indexer-allows-domain-readme branch August 28, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant