Skip to content

feat(forms)!: Session Forms V1 (ask_user trait and form state API) - #77

Open
AndrewKirkovski wants to merge 137 commits into
masterfrom
codex/session-forms-v1-release
Open

AndrewKirkovski wants to merge 137 commits into
masterfrom
codex/session-forms-v1-release

Conversation

@AndrewKirkovski

@AndrewKirkovski AndrewKirkovski commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This pull request adds Session Forms V1 (EE2-2461). An agent with the wippy.session.forms:ask_user trait can ask the user one or more choice questions in chat. The Session stores the form as an artifact, accepts the answer through a state API, and gives the answer to the model as a user turn in the right order with typed steers. The branch contains master at 0.6.19 (5d518c5).

Changes

  • The wippy.session.forms:ask_user trait adds the ask_user tool and the prompt text that tells the model when to use it. A successful call ends the turn, and the answer starts the next one.
  • GET and POST /artifact/{id}/state read and submit a form. Submissions are owner-checked, size-capped, validated and idempotent by request id.
  • Two web components, wippy-form and wippy-form-answers, render the question card and the answers. The module serves them as static files through the new ui_server requirement.
  • Answers that arrive after the conversation moved on are kept as context, and the agent asks again before it acts on them.

Other behavior changes

These changes reach beyond forms, so please review them on their own:

  • Other users' artifacts answer 404, not 403.
  • Sessions finish 10 seconds after the last client leaves, not at once.
  • An enforced Stop leaves the session idle with no client error.
  • A stored running status reads as idle while no session process is registered.
  • Steering accepted after a turn's first message stays after that message.
  • Title generation runs in a background coroutine.
  • control_artifacts updates use meta_patch, so a stored meta that is not an object fails the turn.
  • Only a stored message moves last_message_date, which orders the session list. writer:update_status no longer sets it, and update_session_meta has kept it since fix(session): preserve message recency on metadata edits #92. Before fix(session): preserve message recency on metadata edits #92, a session that exited jumped to the top of the session list.

Please squash-merge with this title and footer

release-please reads the squash commit. bump-minor-pre-major is on, so this title and footer propose 0.7.0, and no Release-As is needed:

BREAKING CHANGE: reading another user's artifact returns 404 instead of 403. An enforced Stop stores the session as idle instead of failed, and a session stored as running with no live process reads as idle. Sessions finish 10 seconds after the last client leaves. The forms UI needs the ui_server requirement (default app:gateway).

Upgrade notes

The README has an "Upgrading to 0.7.0" section with each change and what a consumer must do. The question card needs the artifact-state API, which is in Wippy Web Host 1.0.65 and later. Browser testing covered Host 1.0.65, 1.0.67 and 1.0.68.

Packaging

The module now ships static files, so it must be packed with --config <checkout>/src, which embeds both bundle folders through src/wippy.yaml. A dry-run pack is 521.5 KB with the bundles and 219.2 KB without them, and scripts/check-ui.mjs fails if the embed is lost.

Session releases publish through the Framework companion workflow. wippyai/framework#244, now merged, makes it pack from src/wippy.yaml and stop when that pack is under 400 KB. publish.yml in this repository still stops with WIPPY_TOKEN is required, as it does for current releases.

Verification

On 800383e, the head of this pull request, which changes only writer:update_status and tests:

  • New tests: seven writer writes (status, failed status with its error, status with interaction, title, initial title, config, public metadata) keep last_message_date, and a stored message still moves it (writer_metadata_test). A session that finishes or fails keeps the date when it stores its exit status (plugin_test). On 43c02b7 the two update_status cases fail. With the pre-fix(session): preserve message recency on metadata edits #92 rule put back for a check, the two exit cases fail with the date set to the exit time.
  • On Windows with runtime 0.3.60a: wippy lint reports 0 issues, and 1236 tests pass. 5 bootstrap_test cases fail because jq is missing and the shell the tests start does not find make and sqlite3. 43c02b7 fails the same 5 in the same run. UI: 335 and 18 tests pass, and lint-ui and check-ui pass.
  • CI passes: Test, Lint, Required runtime handoff, and PostgreSQL persistence and handoff. All 10 new tests ran and passed in both the Test job and the PostgreSQL job.
  • Not rerun on this head: the Demo browser runs. The commit changes no form or UI code.

On 43c02b7:

  • Dependencies match the 2026-11-09 releases. Both lock files use agent 0.5.12, llm 0.5.15, migration 0.3.26 and views 0.5.14, and the test lock also uses relay 0.3.20 and test 0.4.24. CI checks out framework b000b42 instead of bc90331. Both form packages use @wippy-fe ^0.0.68 (Web Host 1.0.68). The declared minimum versions are unchanged.
  • @wippy-fe/proxy 0.0.68 types every form field kind, so the card's state boundary now keeps only choice fields and drops answers that are not choice answers. A version 1 form holds nothing else, so nothing changes for it.
  • CI passes: Test, Lint, Required runtime handoff, and PostgreSQL persistence and handoff.
  • On Windows with runtime 0.3.60a, after deleting the test workspace and database: wippy lint reports 0 issues, and 1225 tests pass. 6 bootstrap_test cases fail because sh is not on the Windows PATH; the unchanged b57f894 fails the same 6. test-runtime and test-admission pass against framework b000b42. UI: 335 and 18 tests pass, and lint-ui and check-ui pass.
  • Through the Demo (feat(session-forms): add the Session Forms demo app#39 with app master merged: Host 1.0.68, facade 0.6.51, views 0.5.14, agent 0.5.12, llm 0.5.15), with modules reinstalled and a new database:
    • The core case passes in all four cells (compat and managed layouts, each with the iframe and fragment engines): ask, answer, reload, one answer row, no console, page or request errors, only Host 1.0.68 loaded, and the served bundles match dist by sha256. Managed layout does not reopen the last chat after a reload, as before, so there the stored rows are read through the session API.
    • session-forms e2e, which runs with the iframe engine only, because it finds the demo page by its iframe: 6 of 6 in compat. In managed layout 5 of 6 pass, and the reload case fails for the same managed-layout reason. Version leak passes.
    • On the Demo e2e runtime, also with a new database: chat-compatibility passes 1 and skips 1 as before. The Attention helper spec passes 51, and the Attention suites pass 33 in the visual-capture cell and skip 3 by design (short action lifetime, Attention off, touch).

Earlier evidence:

On b57f894:

  • CI passes: Test, Lint, Required runtime handoff, and PostgreSQL persistence and handoff.
  • 1226 tests pass on Windows with runtime 0.3.57a. The same 5 bootstrap_test cases fail there and pass in CI.

On 6f52cd9, the last head that changed the UI:

  • UI: 331 and 18 tests pass, and check-ui confirms the committed bundles match a fresh build.

On 4c4052a, on Windows with runtime 0.3.57a:

  • wippy lint reports 0 issues. 1224 tests pass. 5 bootstrap_test cases fail because make, jq and sqlite3 are absent on that machine, and they pass in CI.
  • Through the Demo: session-forms e2e and version leak, 7 passed. Attention passed 33 and chat-compatibility passed 1 on the earlier ea35d94 Demo head.

On b1fa43a, in a visible browser through the facade flow, with Host 1.0.67 and runtime 0.3.57a:

  • Core cases pass in all four cells: compat and managed layouts, each with the iframe and fragment engines. The served bundles match dist by sha256.
  • Recovery cases pass: runtime stopped during a tool, Stop during a tool, a turn that failed or hit its limit after assistant text, and an inline artifact in the same round as ask_user. In each, the card never reads complete, and no row is duplicated.
  • A card recovers by itself after repeated failed refreshes, and retries stop on a 404.
  • Host 1.0.65 passes the core and late-answer cases with no failed request.

One real-model turn with DeepSeek V4.1 Flash passed on b236ec2.

Three small wippy-form fixes came after that browser run: the answered-elsewhere notice, the error banner on a rebind, and Enter on an Optional question. Unit tests cover all three. The Demo e2e above ran with the first two, and not with the last one, which is the Enter on a checkbox row change in 4bad08c. The fresh Demo run above used the current bundle, which has all three. Its e2e covers Enter on a checkbox row. The answered-elsewhere notice and the rebind banner have unit tests only.

A form answer now stays whole when a checkpoint restores its request (7accea5). The 6000-byte excerpt used to cut the JSON record, and four 2000-character answers were enough to cause it. Ordinary requests are still excerpted. test/prompt_builder_test.lua covers this, and no browser run does. A restored answer counts against the prompt, so an answer too large for the model's window fails the turn at admission with context_window.

The published boot in the release is the next browser check.

Review note from 2026-10-31

The port this note asks for is done, and the footer above is the re-evaluated one. The note is kept as written, and it describes the branch before the port.

Head 1e031e7d63fd42f588506dd5a97640948d96c5cf fixes a reproduced false-completion shortcut: a full 50-row tool-only history window reported an accepted answer as complete without a reply. Delivery now pages forward from the admitted answer using the message store's existing cursor API. Only an actual assistant or completed-form reply supplies completion. No new store, status engine, SQL dialect path or guessed row-count cutoff is introduced. The module repository URL is also corrected.

  • The new tool-only regression fails before the fix (complete instead of interrupted). Tests retain both the negative case and a real reply after the first full tool page.
  • Native SQLite suite on official Runtime v0.3.56a reports 885 tests, six explicit existing PostgreSQL/benchmark-only skips, and no failures. Native lint passes.
  • Changed form-state suite on real disposable PostgreSQL on Towers: 33/33 passed, including both new boundary cases and the two PostgreSQL deletion/acceptance races. The tested source hashes match the pushed files.
  • Frontend maintained Make gates pass: 308 form tests plus 18 answer-carrier tests, lint/type checking, and committed-bundle/metadata agreement. Static/compliance review found no confirmed MUST failure; hosted browser/theme acceptance remains unqualified.
  • Towers scratch databases, processes, private connection settings and owned staging (including the temporary verified jq prerequisite) are removed. Setup-only failures were retained as evidence and do not count as product failures or passing qualification.

The complete feature remains draft: merging current master conflicts in 22 files spanning message ordering, artifact presentation, persistence, steering and turn/control handlers. Current Session 0.6.17 behavior and previously shipped fixes must be preserved during a deliberate feature port. Historical UI/E2E and the original release-impact list do not qualify the integrated revision; some originally listed behavior has since shipped separately. Re-evaluate the breaking-change footer and generated release proposal after that port. No Session release or dependent Docs #46 publication is included in this refinement.

Evidence: /home/wolfy-j/review-evidence/next5-golua-forms-20261031/.

make.ps1 and make.bat run the same targets from test/: test (removes the
test database first), lint, install and clean. Set WIPPY to use a runtime
binary that is not on PATH. A failing wippy command or an unknown target
exits with code 1.
…vents

Artifact updates:
- artifact_repo.update takes opts.tx (run on the caller's transaction) and
  opts.expected_version (conditional update). A stale version returns a
  CONFLICT error with current_version; a missing row returns NOT_FOUND.
  It returns the new content_version, read back in the same transaction.
- updates.meta_patch / updates.meta_remove change single metadata keys.
  The agent control path uses meta_patch, so an update no longer drops
  display_type, page_id or preview.
- list functions and the artifact catalog return content_version.

Events: after a committed update, artifact_events.publish_updated sends
artifact:<id> with the same projection as GET /artifact/{id} to the owner's
relay hub only (never the caller's). No hub means no event.

Transactions: persist/tx.lua runs a function in one transaction with
commit, rollback and release on every path. message_repo.create (now also
opts.tx), create_batch and session_repo.delete use it.

Message order: dates are fixed width (9-digit fraction, host offset) and
strictly increasing per session inside the insert transaction. Two writes
in one clock tick could get the same date, and the tie fell to message_id,
so a later message could sort first (the base commit failed about 1 in 8
test runs on this). On UTC hosts the trimmed fraction also sorted ".1Z"
after ".15Z".
Adds session forms V1 (single choice with an optional Other answer).

- Trait wippy.session.forms:ask_user and the ask_user tool. A valid
  definition stores one form artifact bound to its session, turn and tool
  call and ends the turn. Invalid definitions and a second form in a turn
  return a tool error and store nothing.
- GET/POST /artifact/{id}/state. Owner-only, no-store. A submit is
  validated, then one transaction marks the form answered and inserts one
  pending user message. Same request id replays; conflicts and field
  errors use stable codes.
- Pending answers are admitted after the active turn, at once when idle,
  or on session start. A stopped session is started through the session
  plugin's new wake topic. Stop and finish drains leave answers pending.
- Calls with control effects are settled only after their effects commit.
- The wippy-form web component (frontend/wippy-form, built into
  src/forms/ui/dist) with unit tests; make build-ui builds it.
- wippy-form renders V1 choice forms as a question card: one question at a
  time with a counter, numbered rows with number keys, notes on answers,
  an Other box, previous/next and a review step. The radio/checkbox form
  stays for V2 fields. Styling API (tokens, parts, classes, card-state host
  attribute) is documented in the README.
- The answer message is the agent's answered_message sentence plus the
  self-contained answer record in the record attribute of an empty,
  auto-registered <wippy-form-answers> element, so the answered form is the
  only visible copy. read_form returns the same record.
- Admission keeps acceptance order, hides answers the running turn has not
  admitted, delivers answers of a stopped turn without starting a turn, and
  settles sessions a crash left running (session APIs report them failed).
- Persistence: a transaction guard, message ordering that does not depend on
  timestamp round trips, conflict-safe meta patches, stricter recovery of
  created forms, and a paged status query.
- Input and API hardening: linear trimming with byte caps, Unicode blank and
  control checks, line-start Markdown escaping, JSON-only answer POST with a
  streamed body cap, and one 404 for foreign or missing artifacts.
Typed input follows the upstream input policy (block or steer). Form
answers are not typed input: they are never steered into a running turn,
stay pending until the session admits them, and the running turn cannot
read them.

- Answers and steering rows keep acceptance order. A step applies
  steering only up to the first pending answer. Admitting an answer first
  applies the steering accepted before it, and steering is never anchored
  to a pending answer.
- The turn after admitted answers starts at the latest steering row still
  pending, or at the latest answer. Steering accepted after a turn's first
  message is placed after it.
- A created form still ends its turn (D11). Steering pending at that point
  starts the next turn instead of a continuation step.
- Stop admits the turn's answers without a turn; steering sent after them
  stays pending, as after any Stop.
- An answer that arrives while idle is admitted in the session inbox, like
  an idle typed message, so the two cannot start competing turns.
- Upstream admit, apply_inputs and stop_with_input_rollback run through
  tx.run with the session lock, and admit dates its row with message_date.
- get_session and list_sessions report an interaction that matches a
  crashed turn reported as failed.
- A multiple-choice tick made while that row's note is open is kept.
- After losing a race, focus moves to the answered view's status.
- Length and server errors are linked to their input (aria-invalid,
  aria-describedby).
- The single-question card and the answered summary show the form title and
  description.
- Answer rows are aria-disabled while offline or sending.
- An unsupported form version reflects card-state="unsupported".
- The form reloads on the Host '@REconnect' event, so it recovers after a
  server restart.
…tifacts

- The session title is generated in the background, so the first form in a
  session no longer waits for a title model call (it waited 5-10 s).
- Artifact and artifact-content endpoints answer 404 with a generic body for
  missing, foreign and orphaned artifacts, so they no longer confirm that
  another user's artifact exists.
- A session left running by a stopped runtime is settled, and reported, as
  idle with can_send true instead of failed, so the user can continue with a
  message; pending calls are still repaired and the recovery notice is sent.
- A turn that admitted answers goes straight into the next turn without an
  idle/running flicker.
- Tests cover choosing a model right after an agent (the agent now sticks),
  live announcement of a reply stored after Stop, and steering placement after
  a turn's first message.
- Artifact meta is stored with sorted top-level keys; a patch keeps the
  stored text of keys it does not name, and session form meta is written in
  a fixed order with answers in definition order, so stored submissions are
  canonical. Replay detection already compared structured answers; a test now
  guards retries whose keys arrive in another order.
- Live content events of a reply carry the stored row's date, so a reply
  stored after Stop is dated when it was written, not when the turn started.
- A passive tab no longer shows "answered elsewhere" unless it had unsent input.
- Ticked answers draw the check mark (readonly Checkbox instead of a disabled one).
- Multi-line Other answers keep their line breaks in the answered view.
- Field errors use the danger color.
- Single-answer rows are one Tab stop with roving tabindex.
- Fix the gap under question descriptions.
- Reflect card-state="loading" before the first artifact load.
- Document Escape in a note and the Tab behavior.
- Prove the error Message id is the aria-describedby target in a real render.
Suites mount with attachTo: document.body and never unmounted, so a
global document query could find another test's element.
The artifact repository spliced stored meta text member by member so that
form meta kept a canonical layout, but nothing reads the stored text: replay
compares definition.encode_answers of the decoded answers. Meta patches go
back to decode, merge and encode, and form meta is written as a plain table.

A new test checks that a patch keeps keys it does not name, including an
empty list, an empty object and a nested object, through two patches.
The answer record, the questions of read_form, the read_form result, the
state API bodies and the canonical answers used for replay each built JSON
by hand. They now all use wippy.session.forms:ordered_json, which writes
keys in the order given and a nil value as null. The output is unchanged.
meta.session_form was read in six places, and only form_artifact.parse
checked its version. wippy.session.forms:form_meta now owns the record key
and version and reads the record, its origin and its submission; it imports
nothing, so message_repo uses it as well.

The prompt builder and process_tools each built the set of forms whose
answer is not admitted yet. form_index.pending_answers builds it once, and
reads the answer rows only when a form of the session holds an answer, for
both callers. message_repo exports is_form_answer and answer_form_id for the
answer row marker.
checkpoint.lua kept its own copy of the prompt builder's pattern for a
<wippy-form-answers> tag the user typed. answer_text.neutralize now owns it,
built from answer_text.TAG, and both the prompt builder and the checkpoint
summary use it with message_repo.is_form_answer.
The artifact endpoints (artifact_access.find_owned) and the form state
service (load_form) each implemented "missing, foreign, or in a foreign or
missing session reads as not found", and both matched error text for "not
found". artifact_repo.get_owned is now the one check and returns a NOT_FOUND
error that artifact_repo.is_not_found recognises. The endpoints and the
state service call it; the state service also uses it on the acceptance
transaction and after a failed one, so a session removed meanwhile still
answers 404 without matching the lock error's text.
get_session.lua and list_sessions.lua carried copies of the same
reported-status code, and the form state service and the plugin's stale
status scan applied the same "stored running, no registered session
process" test on their own. wippy.session.process:session_status now owns
it: such a session reads as idle, with the interaction recovery will store,
which takes input. All four use it. The stale comment that said a crashed
turn is reported as failed is gone with the copies.

The endpoints return to their plain handler shape, so the two test-only
library registrations of their sources (get_session_module,
list_sessions_module) are removed; the status test now drives the library.
…-typing submit errors

submit-error.ts guessed error shape by name/status/formErrors presence and
still accepted raw Axios errors, which the Host client never throws (every
failure, network included, is wrapped into ArtifactStateError before it
reaches this component). Check the Host's realm-stable brand
(Symbol.for('wippy.artifactStateError')) instead, matching how the Host's
own isArtifactStateError works. The published @wippy-fe/proxy version this
component builds against does not export that helper yet, so the brand is
checked locally in one small function rather than duck-typed.

Also drops the dead 429 branch: V1 has no rate limiting per spec and D30,
so classifySubmitError no longer invents a rate_limited code for a status
that never occurs; an unmapped status now falls through the existing
generic case. Test mocks across submit-error.test.ts, use-form-submit.test.ts
and wippy-form.test.ts now set the same brand a real Host error carries.
Added coverage for 413 and 415, which the spec's submission-response table
documents.
… otherTextLength alias

Blank/length checks for "Other" and note text were trimmed with plain
.trim() in at least two independent places: answers.ts's
normalizeOtherText/normalizeNote (used by the dormant V2 serializer and by
missingRequiredFields/fieldsWithBlankOther), and seven separate inline
a.other.trim() calls across use-question-card.ts and three question-card
.vue files, which is the path V1 actually submits through. All of them
happened to use the same method, but nothing kept them in sync if that
ever needed to change. Added one exported trimAnswerText() in answers.ts
and pointed every call site at it.

The server is moving to trim exactly the JS String.prototype.trim set, so
this matters: trim() strips U+3000 IDEOGRAPHIC SPACE (real Unicode
whitespace) but leaves U+200B ZERO WIDTH SPACE alone (Unicode Format
category, not whitespace) - an answer that is only a zero-width space
still counts as content. Added tests for both code points, built from
String.fromCharCode rather than literal characters in source since they
are otherwise invisible in a diff.

Also deletes the otherTextLength export - a same-signature alias for
codePointLength kept "for existing callers", but grep showed only its own
test used it.
… stub instead of working around it

wippy-form-answers pinned Vitest 3.2.4 while the sibling wippy-form package
already used 4.1.11, with separate lockfiles and setup. Bumped to ^4.1.11
to match; npm install (not --legacy-peer-deps) removed 10 packages and
added 3, net smaller tree.

hidden-css.ts inlined the element's one :host{display:none} rule as a
plain TS string, reasoning that both ?inline and ?raw CSS imports resolved
to an empty string "for both vitest and vite build". Verified instead of
assuming: reproduced the empty string under vitest with no css.include
config, confirmed a real vite build already bundles the actual CSS text
regardless (inspected the built dist/index.js), and confirmed adding the
same css.include fix wippy-form/vitest.config.ts already carries for its
own styles.css?inline makes the vitest-side failure go away too. So the
empty string was a Vitest-only stub, the exact issue the sibling package
already solved - not something vite build ever had. Added a real
src/styles.css, imported it via ?inline the same way wippy-form does, and
deleted the hand-written workaround.

Also documents why this element extends WippyElement even though it
subscribes to the Host's @theme broadcast for no purpose (renders
nothing): the compliance gate requires a view.component to extend
WippyElement/WippyVueElement and this package exports no lighter base.
…ts, test names and READMEs

Comments, test descriptions and both package READMEs cited internal
review artifacts that mean nothing to a reader who does not have them:
round/item numbers ("round B, item 7"), finding ids ("F-1", "M05"),
decision ids ("D27"), and links to .local/work/... design docs that do
not ship with the package (broken for any reader outside this repo
checkout). Reworded each to state the technical reason in plain language
- what the code/test guards against - and dropped the id. No behavior
change; this is comments, describe/it names, and README prose only.

Also names the one form_version this component renders interactively as
SUPPORTED_FORM_VERSION in wippy-form.vue, instead of the literal 1
repeated in both unsupportedVersion checks.
…ers fixes

Rebuilds src/forms/ui/dist (wippy-form) and src/forms/ui/answers-dist
(wippy-form-answers) to match the preceding four source commits: the
ArtifactStateError brand check, the trimAnswerText consolidation, the
?inline CSS fix replacing hidden-css.ts, and the comment/test cleanup.
src/api/_index.yaml registered three endpoint sources a second time as
libraries only so tests could reach their _serve and body-helper seams, and
message_handlers.admit_answers existed only for tests. The registry refuses
a test entry whose source lies outside the test tree, so the logic moves
into libraries the endpoints call instead:

- artifact_access now holds the request handling of GET /artifact/{id} and
  GET /artifact/{id}/content after authentication; the function entries
  read the HTTP context and the actor and call it.
- request_body holds the Content-Type gate and the capped body read of the
  form state POST endpoint.

The tests drive those libraries, and the admission tests call
admit_in_order, the path production uses. admit_answers is removed.
message_repo.recover_pending knew the form meta shape, ran its own artifact
query and repeated the ask_user result sentence. recover_pending now takes
an optional settle(row) step and otherwise reports a pending call as
interrupted, as before forms. form_recovery.settle_call is that step for a
committed form; the plugin and both session recovery call sites pass it.
The sentence lives in form_artifact.created_message, used by ask_user and
by recovery, and artifact_repo.find reads an artifact that may be missing
without an error.
message_repo parsed acceptance and creation dates as RFC3339 only and fell
back to comparing text. A creation date that comes back in a timestamp
column layout ("2001-03-01 10:00:00 +0000 UTC") then sorted before every
RFC3339 acceptance time, so a form answered earlier read as stale.
message_date.parse_stored, which already knows every layout a stored date
comes back in, is exported and used for the comparison.
The form component trims Other text and notes with String.prototype.trim,
but the server trimmed ASCII whitespace only and treated zero-width
characters as blank. An Other answer padded with U+00A0 or U+3000 was
refused as containing control characters (U+2028), kept its padding, or a
lone U+200B the component sends was refused as blank. The server now trims
Other text and notes with exactly the characters JavaScript trim removes,
and an Other answer is blank only when nothing is left. Agent-authored
definition text keeps the stricter rule that zero-width characters alone
are blank.

definition.lua decoded UTF-8 twice. It now has one decoder that every text
rule uses. A runtime probe showed that v0.3.43a (Lua 5.3, Wippy
modification) has no global utf8 table, so the decoder stays.
The answer row's metadata.session_form carried submission_id and late, and
nothing in the Session module, the Host, the form components or the demo
fixture reads them: replay uses the form's submission.request_id, and the
late flag is in the answer record text and the form's submission. The
marker keeps artifact_id and pending, which admission, prompt building and
delivery read.
message_handlers (attachment ids) and control_handlers (form artifact ids)
each defined the same UUID pattern. It is now consts.UUID_PATTERN.
Shipped Lua comments and test names cited probe, finding and decision ids
(probe J2/J5, H3, H-review, P0-11, D11), and the steering placement comment
narrated how an earlier version anchored rows. They now state the rule and
its reason only.
…'s status changes

F-C3: after a user Stop that settles the turn with no pending answer to
admit, the Session stores no reply message at all — only the session's own
status flips. An answered card whose delivery that Stop interrupted
(`delivery: "interrupted"`) only ever reloaded on `session:<id>:message:*`,
which never fires for that case, so it kept showing "The assistant is
reading your answer." until something else (a reload, a later message)
happened to refresh it, even though the state API already had the correct
`delivery: "interrupted"` and a reload already showed the right copy.

Host docs (websocket-topics.md, ws-message.ts, dispatch.ts, read-only)
confirm `session:<id>` (no further segments) is a distinct, narrower topic
than `session:<id>:message:*` — "Session-level metadata update", data
optionally carrying `status`, and dispatched to a different sink event
than per-message updates. topic-matcher.ts's exact part-count check means
subscribing to the bare `session:<id>` pattern only ever matches that
topic, never a `:message:<id>` one. Subscribed to it alongside the
existing message listener, in the same `watch(watchedSessionId, ...)` so
it starts/stops on the identical gate (only while this card's own delivery
could still change) and is cleaned up the same way.
A failed background reload allowed one retry and then none until a load
succeeded. After the turn ends no event arrives, so the card stayed on
"Could not refresh this form" until a page reload.

The retry now doubles from 5 s to a 60 s cap until a load succeeds, the id
is rebound or the component unmounts. A 401, 403 or 404 is not retried;
events, visibility and reconnect still load. The status comes from the same
reader the submit path uses.
Enter in an empty Other box did nothing and gave no sign why. It now shows
"Type your answer, or choose another option." through the question's own
error alert, which also marks the box invalid and describes it. Focus stays
in the box and typing clears the message. A several-answer question with
nothing chosen shows the existing tick-one message.
…h and minor

wippy-form: @iconify/vue 5.0.5, autoprefixer 10.6.2, pinia 4.1.0, postcss 8.5.32,
vite 6.4.5, vitest 4.1.12, vue 3.5.45. wippy-form-answers: @iconify/vue 5.0.5,
vite 6.4.5, vitest 4.1.12. Peer ranges and @wippy-fe/* at ^0.0.67 are
unchanged. The built index.js files are byte-identical; only the copied
package.json in each wippy-meta.json changes.
…rrors honest

The answered-elsewhere notice stays hidden while a send is in flight and after a send whose outcome is unknown. A banner from a failed send no longer carries over when the element is rebound to another form. Enter in an empty Other box shows its reason only on a required question.
A turn cut by a checkpoint restores its request with an excerpt of 6000
bytes. For a form answer, the omission note landed inside a JSON string, so
the model received a broken record. Four 2000-character answers are enough.

A form answer is now restored whole. The form body limit bounds it, and a
prompt that does not fit the model window still fails at admission.
Ordinary requests are still excerpted.
A record repeats question text and escapes some characters, so it can exceed
the 64 KiB body limit. The definition and body limits together bound it.
- wippy.lock and test/wippy.lock: agent 0.5.12, llm 0.5.15, migration
  0.3.26 and views 0.5.14; the test lock also moves relay to 0.3.20 and
  test to 0.4.24. The declared minimum versions stay as they are.
- CI checks out framework b000b42 (the release of agent 0.5.12, llm
  0.5.15, usage 0.3.27, facade 0.6.51 and views 0.5.14) instead of bc90331.
- Both form packages move their @wippy-fe ranges to ^0.0.68 (Web Host
  1.0.68). Only the @wippy-fe lock entries change. The rebuilt bundles are
  identical; only the dependency ranges in wippy-meta.json change.
…oundary

@wippy-fe/proxy 0.0.68 types every form field kind, and number and boolean
answers, so vue-tsc rejected the V1 state boundary. The card renders only
choice fields, and only for form version 1, so the boundary now keeps the
choice fields of a stored definition and drops answers that are not choice
answers. A version 1 form holds nothing else, so nothing changes for it.
A newer form version still shows the "needs a newer version" message.
writer:update_status set last_message_date to the current time, so a status
write moved a session to the top of the session list without a new message.
Now only a stored message moves the date, which session_repo has done for
metadata writes since #92. A caller can still pass an explicit date to
session_repo.update_session_meta or session_service.update.

The new tests cover status, error, interaction, title, initial title, config
and public metadata writes through the writer, and the status that a session
exit stores. A stored message still moves the date.
@AndrewKirkovski
AndrewKirkovski marked this pull request as ready for review November 9, 2026 13:21
@AndrewKirkovski

Copy link
Copy Markdown
Contributor Author

@wolfy-j @skhaz this pull request is ready for review. Could you take a look?

  • The P2 finding from 2026-10-22 is fixed. submit now validates the answers against the definition it reads inside the acceptance transaction (src/forms/state_service.lua, around line 450). The test "revalidates against a definition changed before acceptance without writing an answer" in test/forms/state_service_test.lua covers the race.
  • The branch is up to date with master. It uses the 2026-11-09 framework releases and Web Host 1.0.68.
  • All four CI jobs pass on 800383e, including the PostgreSQL job.

The docs for this feature are in wippyai/docs#46, and the demo is in wippyai/app#39.

Brings in 0.6.20 and 0.6.21, including the prompt-cache thinking expiry (#117).

Conflicts in src/process/message_handlers.lua keep both sides:
- CONTROL_TABLE_FIELDS keeps "forms" next to the new cache helpers.
- latest_message_id keeps the pending-answer skip and also returns the row date.
- handle_message reads that date in the existing pre-admission read.
- complete_turn uses interaction_for and stores the cache fields.

src/process/_index.yaml keeps the branch's import list. The branch no longer imports message_order there, and master only dropped input_metadata.

master also removed the unused hash require; the branch uses hash.sha256, so the require stays.
@AndrewKirkovski

Copy link
Copy Markdown
Contributor Author

@wolfy-j @skhaz, a reminder: this still waits for a review. I merged master (0.6.21, including the prompt-cache thinking expiry from #117) into the branch in 90c223c, so it has no merge conflicts now. The merge commit message lists how each conflict in src/process/message_handlers.lua was resolved.

Local checks on Windows: lint reports no issues, and the test suite passes (1294 tests) except the External test bootstrap cases, which need sh. CI is running on the new head.

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.

3 participants