Skip to content

[Request]: Evaluate fixed-contract API adapters that preserve auth and store ownership #828

Closed

Description

@jimhoyd

Problem or use case

Test10 admin-crud and auth-profile agents attempted first-party auth/store composition, then replaced it with trusted functions implementing passwords, sessions, cookies, authorization and in-memory records to fit a frozen external JSON API. Admin-crud uses core 0.6.5 and passed 14/14 acceptance; auth-profile uses nested core 0.6.4 and passed 13/13. Both are invalid benchmark attempts for independent reasons, so these are authoring observations, not comparative performance evidence.

The headless-auth-profile recipe (#810) was discovered in admin-crud, but it demonstrates the extension-owned wire contract. The task instead requires paths such as /api/login and flat {email,role}, plus its own error taxonomy. Current auth returns its documented user/csrf envelopes. A field mapping alone is not proven sufficient: CSRF flows, registration requirements, identifiers and authorization semantics must also be reconciled.

Generated fallback code included application-owned password verification and session Maps; admin-crud's synthetic seeded-password helper used plain SHA-256 rather than the auth service's password facilities. Passing the task's HTTP assertions does not establish equivalent security properties.

Proposed behavior and alternatives

Evaluate and document a supported bounded adapter composition for pre-existing JSON APIs that keeps authentication, sessions, authorization and persistence owned by existing extensions/services. First identify which transformations are safe with existing public APIs and which exact contracts are deliberately incompatible. Keep incompatible security requirements explicit; never bypass CSRF, origin checks, cookie handling or principal ownership to match a benchmark.

Prefer a tested recipe/artifact built on public contracts before introducing generic response rewriting or a new extension. Show native-wire-contract and adapted-contract examples with independent denial/session tests, explicit supported field/path/error transformations and refusals. Do not imply arbitrary envelopes are already declaratively supported.

Corrections to agent feedback: auth mount prefixes are configurable, and session cookies use Path=/, not /account-only. packages/auth/docs/JSON-API.md already documents the wire contract; discovery is tracked separately under #822. #821 covers core error representation. This request is specifically about avoiding duplicated auth/store behavior when integrating a fixed external contract.

Activity

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

    @jimhoyd
    CollaboratorAuthor

    Decision (owner, 2026-09-27): option (a), a compatibility audit plus a tested recipe.

    • The audit: exactly which path, field and error mappings are safe with auth's and store's public APIs, and which are deliberately unsupported: CSRF, origin, cookie handling and principal ownership are never bypassed.
    • The recipe: a thin trusted adapter over the public service APIs, which never re-implements passwords, sessions or ownership.
    • Not included: no new runtime capability and no generic response rewriting.

    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