Share prima's envelope tail and give step-file names one owner - #174
Open
DavertMik wants to merge 5 commits into
Open
Share prima's envelope tail and give step-file names one owner#174DavertMik wants to merge 5 commits into
DavertMik wants to merge 5 commits into
Conversation
successEnvelope/failureEnvelope/reportEnvelope each repeated instance/status/artifacts; collapse them into one envelopeTail() helper. writeSnapshot/saveStatus now return the artifact paths they wrote instead of stashing them on a mutable this.artifacts field that every builder had to read in the right order. Also swap requestStore().getRequests() for the surviving getMadeRequests() alias ahead of PR #173 deleting the old name. Steps 1 and 2 of plan 034 are committed together: Step 1 alone (saveStatus/writeSnapshot signature change, field deletion) leaves the three builders referencing a deleted field and treating an object as a string, so it doesn't compile or pass tests on its own. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
writeStepFiles wrote .aria.yaml/.html/.diff.yaml by string concatenation while envelope.ts advertised the same names as a hardcoded literal in its doc line, with nothing enforcing agreement. Export STEP_FILES next to ARTIFACT_FILES and have both the writer and the rendered doc line derive from it. Pin the doc line's exact extensions with a new test so the two can no longer drift silently. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The status action had its own hand-rolled copy of runPrima's lifecycle and, unlike every other command, never called prima.stop() — accidental divergence, not a deliberate choice. Give runPrima a browser/record toggle so status can reuse the shared path while staying browserless (the point of PR #166) and skipping session recording, picking up activity-line handling and prima.stop() for free. Exit code semantics are unchanged. Verified manually: `prima status nonexistent` returns a failure envelope, exits 1, and the Instance line shows the browser as not running. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The assertion checked the whole rendered envelope, so the 'html' value passed vacuously via base.artifacts's page.html path rather than the doc line under test. Scope it to the line that advertises the step-file names, per the plan's test-plan section. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
DenysKuchma
requested changes
Sep 2, 2026
| html: await result.combinedHtml(), | ||
| screenshot: result.screenshot, | ||
| requests: this.bot.requestStore().getRequests(), | ||
| requests: this.bot.requestStore().getMadeRequests(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
prima's three envelope builders each repeated the
instance/status/artifactstail and depended on an invisible ordering rule — awaitsaveStatusbefore reading a mutablethis.artifactsfield, or silently emit an envelope with no Artifacts section (the exact defect #166 fixed). NowsaveStatusreturns{hash, artifacts}and one privateenvelopeTailsupplies the shared keys; the field is gone. Adding the next shared envelope field is a one-line change.The per-step artifact filenames were written twice with nothing enforcing agreement —
writeStepFilesby string concatenation, the envelope renderer as a hardcoded literal. Both now derive from oneSTEP_FILESconstant inenvelope.ts; the pre-existing test pinning the exact rendered line proves byte-identical output, and a new test asserts the advertised line names every STEP_FILES extension so the writer and the advertisement can no longer drift.The
statusCLI action re-implemented the command lifecycle inline and diverged (never calledprima.stop()).runPrimagained{browser, record}flags andstatusroutes through it — still browserless (verified:status nonexistentprints a failure envelope, exit 1, Instance line "not running"), now with the same stop/activity handling as every other command. Theconfig/reportunification was deliberately skipped: they diverge on stop() and would need a variation flag.Note:
writeSnapshotnow callsgetMadeRequests()(same list; thegetRequestsalias is being removed by open PR #173 — this avoids a conflict between the two PRs). And for the maintainer: the main snapshot still writesaria.ymlwhile step files write.aria.yaml— same content kind, two spellings, now visible side by side inenvelope.ts; unifying is a deliberate contract change left undone.Testing:
bun test boat/prima/tests tests/integration/prima-smoke.test.ts146 pass / 1 skip / 0 fail (incl. the new STEP_FILES test),bun test tests/unit1225 pass / 0 fail, biome format + lint clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01Jz7wTcYsy68jUUjcWttd1B