Skip to content

Align error vocabulary with the architecture.md registry #316

Description

@taras

architecture.md (#314) locks the vocabulary for the error domain and states
the rule this issue carries out:

Existing documents and code get aligned to this section retroactively.

The engine still speaks the pre-registry vocabulary: policy where the registry
says error mode, diagnostic where it says printed error, and
collect/collection where it says printing failures. This issue is the
retroactive alignment — mechanical renames, zero behavior change.

Rename pairs

From To
<CollectFailures> <PrintErrors>
collectFailures() printErrors()
collectsFailures() printsErrors()
useFailureCollection() useFailurePrinting()
ErrorPolicy ErrorMode
AmbientErrorPolicy ErrorMode (context const merged onto the type's name)
"component.errorPolicy" "component.errorMode"
"collect" (mode value) "print"
AssertionDiagnostic AssertionReport (.diagnostic.report)

The union becomes "print" | "throw". "output" and fail-fast semantics are
not part of this issue — that is the semantics work, tracked separately.

Prose in the spec, code comments, and test names moves with the identifiers:
"policy" becomes error mode, "diagnostic" in the rendered-error sense becomes
printed error, and "collection"/"collects" in the error sense becomes printing
vocabulary. Test files carrying the old vocabulary get renamed.

Breaking changes

printErrors() replaces the published collectFailures() export, and
AssertionReport replaces AssertionDiagnostic. No aliases — the repo's
precedent for breaking renames. <CollectFailures> resolves like any other
unknown component afterward.

Sweep discipline

Every remaining occurrence of collect, collection, policy, diagnostic, capture,
and divergence gets audited into an explicit allowed category, listed in the PR.
Known legitimate survivors: <Capture> / <Capture as> (content binding, keeps
its name by decision), review and permission policies, lint diagnostics, the
diagnostic JSONL trace, and "divergence" in replay contexts.

Context: #314.


Correction applied (see comment): AssertionDiagnostic becomes
AssertionReport, not AssertionPrintedError. The class holds a rendered
Markdown assertion report written as ordinary content, not an ErrorSegment,
so a registered term must not name it. Its .diagnostic field becomes
.report, and buildDiagnostic() / failureDiagnostic() become
buildReport() / failureReport(). Where packages/testing prose does mean an
ErrorSegmentvalidationError(), the raise interception in <Test> — it
becomes printed error.

Second correction applied: the ambient context const is exported under the
type's own name — export type ErrorMode = "print" | "throw" beside
export const ErrorMode: Context<ErrorMode>, the same shape as Result/Ok.
There is no AmbientErrorMode. The "component.errorMode" key is unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions