Skip to content

[Gap]: Evaluate inline forms confirmation while preserving CSRF admission #805

Closed

Description

@jimhoyd

What you were trying to do

Review repeated URLCode 0.6.4 builds of a synthetic HTML contact-form contract: GET renders name/email/message; invalid URL-encoded POST returns 422 with field errors; valid POST returns 201 immediately with HTML confirmation and the submitted name; a fresh GET must not show prior submission data.

Where it broke down

The forms extension supplies field validation and HTML rendering, but its built-in successful submission path redirects with 303 to confirmation. In v0.6.4, packages/forms/src/forms.ts defines confirmation title/message/show and calls redirect after success; no declarative option selects an inline 201 confirmation. One completed build installed/explored forms, then removed it and implemented parsing, validation, escaped HTML and confirmation in a custom function. The other completed build also used a custom function. Both passed the narrow task contract.

Evaluate an opt-in inline confirmation response with a bounded success-status choice, or a documented composition using the existing public forms exports that avoids duplicating field validation/rendering. This is a request to evaluate the capability, not a decision to add it. Related: #425 and #527; displaying opted-in fields is already supported, while response mode is the distinct gap here.

Code or YAML you had to write by hand

A reduced declaration from the workaround:

version: "1"
routes:
  /contact:
    methods: [GET, POST]
    function: functions/contact.mjs

The trusted function manually reads request.text(), parses URLSearchParams, validates name/email/message, escapes values into HTML, then returns new Response(html, {status: 201, headers: {'content-type': 'text/html; charset=utf-8'}}).

What you could not verify

This is source-verified against the pinned version and supported by captured acceptance and tool history, not an implementation of the proposed feature. Adding inline status alone would not make the current benchmark a native forms test: its direct POST fixtures do not retain a browser binding cookie or submit the required CSRF token. Preserve existing CSRF and admission checks; add a separately versioned browser-realistic benchmark rather than weakening them to fit the old task. No evidence here establishes that a universal template handler is needed.

No raw private transcripts, private paths, credentials or captured workspace files attached.

Activity

  1. added
    ai-first
    enhancement
    extension
    needs-decision
    on Sep 27, 2026
  2. jimhoyd commented on Sep 27, 2026

    @jimhoyd
    CollaboratorAuthor

    Decision (owner, 2026-09-27): add an opt-in declarative inline success mode to forms, with a bounded status of 200 or 201. Redirect-after-POST (303) stays the default. CSRF and admission checks are unchanged in both modes.


    Generated by Claude Code

  3. added
    in-progress
    and removed
    needs-decision
    on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-firstenhancementextensionin-progress

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions