Skip to content

feat(kit): the answer may carry a session record; the receipt shows it and prints no root it was not given - #55

Draft
Adam Poulemanos (bashandbone) wants to merge 1 commit into
feat/engine-transformation-kindsfrom
feat/session-record
Draft

Adam Poulemanos (bashandbone) wants to merge 1 commit into
feat/engine-transformation-kindsfrom
feat/session-record

Conversation

@bashandbone

Copy link
Copy Markdown
Contributor

Why

The Receipt is the audit view. It showed "classifier id not set" for every live answer, because the engine's answer had no place to say who ran it, and its footer printed "session root: computed by the engine at seal" although no engine computes one. The kit must show only what it was given.

What changed

  • packages/core/src/types.ts, docs/CONTRACT.md: the answer may carry an optional session member beside document, with two optional strings, classifier_id and engine_version. An answer without it stays valid. The contract version string is unchanged (an added optional member).
  • packages/kit/src/render.ts: receipt(doc, session) reads the classifier id and the engine version from its session argument and falls back to the answer's own session. Only own string members count, and the argument wins when it carries a value. The engine version is shown in the footer.
  • The footer prints a session root only when the host passes one. The line that promised one at seal is gone.

Scope

Stacked on #54 (base branch feat/engine-transformation-kinds). No fixture changes. The engine side that writes session is on the engine's demo branch, not in a reviewed engine PR yet.

Tradeoffs

  • The answer carries no session root, digest, time or session id. None exists in the engine today, so none is in the contract.
  • The published 0.3.0 kit has no fallback to the answer's session; a host on it shows the classifier id only if it passes session itself.

Verification

  • vp run check: exit 0 (2 warnings, in files this change does not touch). vp run test: exit 0, 4 of 4 packages.
  • REUSE lint 6.2.0: compliant.
  • Seen in a browser on the engine's demo page with this build: header "demo-classifier-01", footer "Marque engine 1.0.0-rc.1", no root line; the fixture page still reads "classifier id not set".
  • Mutants by the builder, each failing a named test: the seal line restored; the fallback dropped; inherited or non-string members read.
  • Not checked: Word and Outlook add-ins.

Maintainer decisions

The matched decisions are matched by file path. None speaks about the receipt's header or footer or about a session record. MD-0004: the session record is the engine's statement in the answer, not kit state. MD-0021: the new tests are DOM tests under happy-dom.

[maintainer_decision_impact]
status = "complies"
decisions = ["MD-0003", "MD-0004", "MD-0007", "MD-0008", "MD-0010", "MD-0011", "MD-0012", "MD-0013", "MD-0018", "MD-0021", "MD-0023", "MD-0024"]
supersedes = []
reason = ""

🤖 Generated with Claude Code

…t and prints no root it was not given

The contract's answer gains an optional `session` member beside `document`
with two optional strings: `classifier_id` and `engine_version`. An answer
without it stays valid.

`receipt(doc, session)` reads the classifier id and the engine version from
its `session` argument and falls back to the answer's own `session` (own
string members only). It shows the engine version in its footer.

The footer no longer prints "session root: computed by the engine at seal".
No engine computes one today. A root is printed only when the host gives one.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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