Skip to content

feat(workspace): writer conformance suite with the amnesia test, and work evidence as a command - #3316

Merged
lex00 merged 2 commits into
mainfrom
ws-3159-writer-conformance
Oct 3, 2026
Merged

lex00 merged 2 commits into
mainfrom
ws-3159-writer-conformance

Conversation

@lex00

@lex00 lex00 commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

This adds a writer conformance suite beside the reader suite in @intentius/chant/workspace/conformance. It holds a tool to the write contract that ws-074 (the repo is the database) sets out, the same way the reader suite holds hud to the read contract. A consumer wires it like the reader suite. It passes a factory that builds its writer over a recording transport, plus a state directory outside the workspace for its private state. Then it calls runWorkspaceWriterConformance, or describeWorkspaceWriterConformance from the vitest entry.

The suite drives a script that performs each of the thirteen write actions at least once on a generated workspace: records new, amend, review and close; points ask and answer; work claim, renew, evidence and release; runs start, end and record. Each step the writer performs must make exactly one call, the step's command with its arguments and fields. The document it returns must be the one chant printed, valid against the command's output schema, and not a refusal. The only files and git refs that may change are the ones the document reports writing. After the script, facts() may only read. Anything left in the state directory must be declared in privateState as cache, telemetry, secret or runtime. With the state directory deleted and the writer rebuilt, facts() must return the same value (the amnesia test). Whatever the optional holds() names must exist in the repository, and every fact the script produced must read back through records --uncommitted, work history and runs. When a writer doesn't list an action, the suite performs that step itself, so later steps still have what they depend on.

The workspace is the reader suite's fixture plus a new overlay, writer_fixture, holding the reference workspace's work, answer and session kinds, its decision points and one open work item. A unit test checks those files against reference-workspace byte for byte.

workEvidence existed only as an Op activity, so a writer like hud had no way to attach evidence through chant. This adds chant workspace work evidence --holder --token --from <file|->, a thin wrapper over attachWorkEvidence that prints the existing work-evidence document. The ChantTransport's run takes an optional { input } for stdin, and the recorded ChantRun carries it. Existing readers are unaffected.

Shared files touched: packages/core/src/cli/main.ts (one help entry), docs/data/boundary.yaml and the generated boundary page (a row for work evidence and one for writer conformance), the docs sidebar, and scripts/docs-sentences-baseline.json (one entry for the new page, whose findings are on its front matter).

Verified locally with core tsc and build, the new unit test (writer.test.ts), the writer e2e and reader e2e tests (writer-conformance.e2e.test.ts, conformance.e2e.test.ts), work-cli.e2e.test.ts with new evidence cases, the boundary roster test, docs-check, the prose lint and the citations check. The full unit project passes apart from tests that need the sql lexicon's generated artifacts, which this worktree lacks.

Closes #3159

lex00 added 2 commits October 3, 2026 03:43
…work evidence as a command

The writer suite holds a tool to the write contract (ws-074): it drives a
script of the thirteen write actions through the tool's writer, checks that
each is one chant command whose document validates and whose file and ref
changes chant reports, then deletes the tool's private state and requires
the same facts back. It ships from @intentius/chant/workspace/conformance
beside the reader suite, with a vitest wrapper.

chant workspace work evidence wraps the workEvidence activity so a writer
outside an Op attaches evidence through chant under its lease.

Closes #3159
@lex00 lex00 added enhancement New feature or request area:workspace chant workspace epic (#2525) boundaries Epic: boundaries between chant, hud, studio, behold and fountain labels Oct 3, 2026
@lex00
lex00 merged commit b86f1f4 into main Oct 3, 2026
12 checks passed
@lex00
lex00 deleted the ws-3159-writer-conformance branch October 3, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:workspace chant workspace epic (#2525) boundaries Epic: boundaries between chant, hud, studio, behold and fountain enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

workspace conformance: a writer suite (writes only through chant, every file change chant's, amnesia test)

1 participant