Skip to content

chore: publish the corpus as @taskless/cli/reference.json - #260

Merged
thecodedrift merged 2 commits into
mainfrom
chore/reference-export-name
Sep 4, 2026
Merged

chore: publish the corpus as @taskless/cli/reference.json#260
thecodedrift merged 2 commits into
mainfrom
chore/reference-export-name

Conversation

@thecodedrift

@thecodedrift thecodedrift commented Sep 4, 2026

Copy link
Copy Markdown
Member

Renames the published subpath from @taskless/cli/demo-reference.json to
@taskless/cli/reference.json, and follows that through the code.

Why

The name carried "demo" into something consumers type, and into modules whose
subject is broader than the demo command. The sg and vale entries are
reference material too — they are simply not what taskless demo writes. So
scoping the corpus to "demo" was wrong in the same way the published name was.

Moves, by what each file is about

src/rules/demo/reference.ts   -> src/rules/reference.ts
src/rules/demo/constraints.ts -> src/rules/constraints.ts
assets/demo-reference.json    -> assets/reference.json

The constraints move furthest and had the least business being under demo/:
they describe what verify and test enforce on any rule. Nothing about
them is demonstration-specific, and the old location implied a scope they never
had.

src/rules/demo/ keeps manifest.ts and rule.ts — those really are the rules
the demo command writes.

Identifiers and tasks follow: buildDemoReferencebuildReference,
DemoReferenceReference, DEMO_REFERENCE_*REFERENCE_*,
write-demo-reference.tswrite-reference.ts, demo:reference
reference. Tests renamed to match the modules they cover.

demo:manifests and print-demo-manifests.ts keep the prefix, and that is
the line: they exist so CI can stage what the demo command writes.

The changeset is amended, not added to

It has not been released — the Version Packages PR is still open, and the only
artifact carrying the old name is last night's nightly, republished from main
on every merge. So the release note describes the name that will actually ship,
and one change still gets one note.

Verified

  • The payload is byte-identical. Regenerated after the move; it matched.
  • The asset guard still fires under the new path — removed files and
    watched the build fail:
    "./reference.json" points at ./assets/reference.json, which no "files"
    entry ships — it would resolve here and nowhere else
    
  • The tarball carries it: npm notice 12.8kB assets/reference.json
  • The export resolves: ./reference.json -> ./assets/reference.json,
    rules: sg,vale,runtime, constraints: 7
  • 1267 tests, lint and typecheck clean.

No behaviour change.

The subpath carried the word "demo" into a name consumers type. What the
file holds is a conformance corpus -- prompts, rules, held-out cases and
the constraints `verify` enforces -- and the demonstration command is one
of the things built ON that data rather than what the data is about.

Asset renamed to match the subpath, so `exports` and the file agree and
neither has to be read to predict the other.

The changeset is amended rather than added to. This changeset has not been
released: the version PR is still open and the only thing carrying the old
name is last night's nightly, which is republished from main on every
merge. So the release note describes the name that will actually ship, and
one change still gets one note.

Internal names keep the "demo" prefix on purpose -- the generator script,
its `demo:reference` task, and the test are all specifically about the
demonstration rules, and renaming them would churn without making anything
truer.

Verified the asset guard still refuses a mis-declared export by removing
`files` and watching the build fail with the message naming the new path,
and confirmed the tarball carries `assets/reference.json`.
Follows the subpath rename through the code. The `sg` and `vale` entries
are reference material too -- they are simply not what the demo command
writes -- so scoping the corpus to "demo" was wrong in the same way the
published name was.

Moves, by what each file is actually about rather than by where it started:

  src/rules/demo/reference.ts   -> src/rules/reference.ts
  src/rules/demo/constraints.ts -> src/rules/constraints.ts

The constraints move furthest and had the least business being there:
they describe what `verify` and `test` enforce on ANY rule. Nothing about
them is demonstration-specific, and filing them under `demo/` implied a
scope they never had.

`src/rules/demo/` keeps `manifest.ts` and `rule.ts`, which really are the
rules the demo command writes.

Identifiers follow: buildDemoReference -> buildReference, DemoReference ->
Reference, DEMO_REFERENCE_* -> REFERENCE_*. Script and task follow too:
`write-demo-reference.ts` -> `write-reference.ts`, and `demo:reference` ->
`reference`. Tests renamed to match the modules they cover.

`demo:manifests` and `print-demo-manifests.ts` keep the prefix, and that is
the line: they exist so CI can stage what the demo command writes, which is
genuinely about the demo.

No behaviour change. The payload is byte-identical -- regenerated after the
move and it matched -- and the asset guard was re-broken to confirm it
still refuses a mis-declared export under the new path.
@thecodedrift
thecodedrift merged commit f08fd11 into main Sep 4, 2026
7 checks passed
@thecodedrift
thecodedrift deleted the chore/reference-export-name branch September 4, 2026 03:24
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