Commit Graph
31 Commits
Author SHA1 Message Date
DottaandClaude Opus 5 e72925a848 feat(runner): Phase 7I interactive scenario chat over the mock control plane
Adds a chat surface to the Phase 7 browser explorer where the board sends
prompts to a scenario and sees exactly how the mock Paperclip control plane
was used on every turn — the point of the phase is that the activity stays
visible rather than hidden behind the conversation (PAP-16916).

Runtime owns the turn model, so the UI derives nothing:

- `Phase7ChatSession` keeps one long-lived mock core across turns, so the
  state a turn changes is still there for the next one. Turn 0 is the
  control-plane seed (checkout, wake routing, exposure) that exists before
  anyone can type.
- Timeline entries gain a `turn`; the artifact gains `turns[]` with per-turn
  exposure, authorization records, state diff, reconciliation events, counts,
  and a turn-scoped verdict. A new `user_message` kind joins the five
  existing ones.
- `phase7TurnParity` judges a turn on what that turn did. A session-level
  expectation about work nobody has asked for yet would read as a failure of
  turn 1 rather than as work still to come.
- Recording machinery moves to `scenario-execution.ts`, shared with the 7F
  single-shot runner so a scenario reads the same either way.

Two scenarios carry authored multi-turn scripts: `ap-mcp-gate-01` (allowed
turn, then a denied one) and `ix-checkbox-01` (open an interaction, then the
board answers it — a control-plane-owned action with no agent tool, which is
what makes the control plane schedule the continuation wake). Every other
corpus scenario falls back to its 7F plan as one scripted turn.

The surface implements the approved 7I interaction map: turn strips bridging
each turn to its evidence, the six-section activity stream, the mobile
Chat/Activity segments with a deny count chip, reset and scenario-switch
confirmation, and deterministic deep links including a staged streaming hold.
Deviations taken during implementation are recorded in §11a of the map rather
than left for a reviewer to find.

No ACPX implementation, no real control-plane integration, no credential in
the browser: Codex mode stays disabled with a named reason and scripted mode
drives the same in-page mock core offline.

Tests: 30 new runtime/component tests and 18 browser tests; 79 phase-7 unit
and 43 phase-7 browser tests pass. Ten §11 screenshots recorded by
`record:phase7i`, which fails the run on any horizontal page scroll.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-09 15:56:47 +00:00
DottaandPaperclip a8211dce1d test(runner): add Phase 7 eval conformance suite
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-09 14:05:17 +00:00
DottaandPaperclip 6930ba3f38 Polish Phase 7 scenario explorer UX
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-09 14:00:48 +00:00
DottaandClaude Opus 5 fb006b75ca feat(runner): add Phase 7 browser scenario explorer
Implements the standalone, package-local Phase 7 scenario explorer against the
approved interaction map (docs/design/phase-7-scenario-explorer-ux.md).

Scenario runtime (src/phase7, no DOM, no network):
- Scenario index over all 106 eval cases and 16 groups, with actor role, task
  mode, fixture seed, and catalog claims declared in a profile table rather
  than inferred from case prose. Claims that cannot unlock an operation in a
  scenario's task mode or for its actor role are dropped, so no scenario shows
  a grant that unlocks nothing.
- Deterministic fixture seeds and fake-agent plans: twelve authored plans for
  the UX acceptance scenarios, derived plans for the rest. Derived plans only
  invoke operations the run actually exposes, so any denial in a derived
  transcript is a real policy result, not a scripting artefact.
- A run-artifact builder that executes each plan against the Phase 7C mock
  control plane through the Phase 7D authorization engine and records the
  ordered timeline (both channels), tool exposure, authorization records, an
  immutable ten-domain state diff, and a parity verdict. Descriptor redaction
  rules are applied at the artifact boundary so no raw secret can reach a
  rendered record.
- Parity is judged in the runtime, never in a component. Phase 7E's per-case
  result is carried through verbatim in its own labelled block and renders
  "Not run" when no report is bundled.

Explorer (examples/phase7-explorer):
- Read-only surface over the frozen SDK: hash routing, scenario picker with
  faceted filters, agent and control-plane transcript channels, and Context,
  Authorization, State diff, and Parity inspector tabs. Tokens only; the
  0.1.2 export surface is unchanged and the runtime is reached through the
  deliberately package-local @paperclip-runner-local/phase7 alias.
- Checked-in inputs arrive as declared virtual modules, so the example
  consumer keeps its boundary and fake mode does no network I/O.

Verification: 45 unit tests (index, plans, all-scenario runs and parity,
components, routes), 19 Playwright tests (route determinism, evidence routes,
credential boundary, keyboard paths, responsive), and the 24-image screenshot
acceptance set.

Fixes found while building: SDK badges overflowed at 390px inside disclosure
summaries; SDK badge capitalisation broke the label vocabulary; hash-change
deep links left the wrong mobile segment; screenshot capture leaked run state
between shots. All recorded as revisions in the interaction map.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-09 13:30:32 +00:00
DottaandPaperclip 154bd9d904 fix(runner): isolate secret tool model delivery
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-09 12:52:16 +00:00
DottaandPaperclip 3f20bf4626 feat(runner): add Phase 7 semantic tool authorization
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-09 12:43:29 +00:00
DottaandPaperclip 4d97afc2ed feat(runner): generate normative Phase 7 inventory
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-09 12:33:39 +00:00
DottaandPaperclip 99a9fa30f7 feat(runner): add deterministic Phase 7 control plane
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-09 12:25:21 +00:00
DottaandPaperclip 386433f178 fix(native-runner): complete recovery and conformance
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-09 04:19:01 +00:00
DottaandPaperclip 0ca23dd535 fix(runner): make native finalization restart-safe
Persist bound session checkpoints, verify durable completion evidence, and commit status/liveness effects atomically. Preserve unique event cursors during migration and add bounded recovery plus legacy compatibility coverage.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-09 03:44:38 +00:00
DottaandPaperclip 37c219b297 feat(runner): add feature-flagged Paperclip adapter tracer
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-09 03:08:55 +00:00
DottaandPaperclip 7fa15aaaf8 fix(runner): harden browser credential redaction
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-08 07:55:37 +00:00
DottaandPaperclip cc945e4c72 feat(runner): extract Phase 5 browser SDK
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-08 07:42:57 +00:00
DottaandClaude Opus 5 cda1fb03ab fix(runner): preserve phase 4b request terminal and goal semantics
Five protocol corrections from the CTO review of the Phase 4b work.

Canonical runtime request outcome. The real driver emitted `resolution`
while the scripted driver and browser read `action`, so a real resolved
card reported an unknown outcome. `harnessRuntimeRequestOutcome` is now
the one payload every driver emits for a terminal `runtime_request.*`
fact, carrying `requestId`, `requestKind`, `turnId`, and `itemId` in the
payload as well as the event binding.

Decoded request identities. Path segments are split before they are
decoded, so a percent-encoded reserved character stays inside the segment
the browser meant it for; malformed encoding fails with 400.

Resolution shapes validated by request kind.
`parseHarnessRuntimeRequestResolution` requires `answers` for a
`user_input` submit and `content` for an elicitation submit, and rejects
a mismatched body instead of accepting it as an empty response. Both
drivers and the browser transport run it, and the request card now sends
elicitation answers as `content`.

One terminal fact per reconnect. The demo server snapshots after the
close rather than before it, so requests the close already cancelled are
not replayed into the driver's stale-request recovery path and reported
terminal a second time. Reading afterwards also carries the closing
events' source sequence into the resumed session.

Goal support retired only on a provider denial. A transport or protocol
failure during `thread/goal/get` said nothing about what the build
supports but still set `goals: false`. `CodexRpcError` now carries the
JSON-RPC code, and the capability is retired only when the provider
answers that it will not serve the method.

Three defects surfaced while verifying the above are fixed here too: a
same-origin `EventSource` GET sends no `Origin`, so requiring one on
`/stream` rejected the console's own subscription and no live-console
test could connect; the browser payload redactor covered only
`.paperclip` paths and leaked the app-server's `~/.codex/memories`; and
the browser suite shares one server across 19 sessions against an
interactive cap of 16, now sized through `PAPERCLIP_PHASE4B_MAX_SESSIONS`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-08 06:04:03 +00:00
DottaandPaperclip 405a4a4506 fix(runner): secure phase4b browser transport
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-08 05:43:13 +00:00
96092b832d feat(runner): add phase 4b live codex protocol console
Add the package-local browser tracer over the Phase 4b protocol boundary as a
new Live console mode in the standalone devtool.

Surfaces derive only from canonical PRP events and the shared reducer: live
transcript and composer, same-turn steering with stale-turn recovery, three
distinct interrupt races, inline runtime request cards, capability-gated goal
controls, parent/child lineage, reconnect, refresh, replay, and a redacted
protocol inspector.

Add a deterministic scripted driver and eleven demo chats behind the same demo
server routes the real Codex driver uses, so every protocol state is reachable
without a provider account and PAPERCLIP_PHASE4B_DRIVER=codex swaps in the real
session.

Adapt shadcn/ui and Vercel AI Elements source with zero new runtime
dependencies, and extend the boundary check to keep it that way.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-08 05:26:45 +00:00
DottaandPaperclip 62d384b383 feat(runner): add phase 4b protocol server
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-08 04:44:00 +00:00
DottaandPaperclip 373b609ff1 fix(runner): reject cross-channel result conflicts
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-08 02:25:41 +00:00
DottaandPaperclip 3a8d4b3e21 fix(runner): persist exact-turn recovery state
Bind Codex reconciliation to the persisted active turn and retain semantic-result and terminal fingerprints across transport recovery. Align Phase 4 docs with content-idempotent retry behavior.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-08 02:13:44 +00:00
DottaandPaperclip 8d4ffe7f2b fix(runner): isolate Codex credentials and hostile output
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-08 02:07:33 +00:00
DottaandPaperclip 6391608e8f fix(runner): enforce phase 4 status authority
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-08 01:53:48 +00:00
DottaandPaperclip 2161ddcc4a feat(runner): add skillless Codex app-server tracer
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-08 01:33:36 +00:00
DottaandPaperclip abb5ceb6b6 fix(runner): close bootstrap auth race
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-08 00:03:08 +00:00
DottaandPaperclip 313c40cd9b fix(runner): close phase 3 security integrity gaps
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 23:51:38 +00:00
DottaandPaperclip b6ec51df04 feat(runner): add durable Phase 3 recovery transport
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 23:37:33 +00:00
DottaandPaperclip a9e6db06e0 fix(runner): address phase 2 tutorial QA
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 22:13:41 +00:00
DottaandPaperclip 90daf4ff00 fix(runner): polish live browser diagnostics
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 21:31:46 +00:00
DottaandPaperclip f32331a567 feat(runner): add Phase 2 local harness loop
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 21:09:14 +00:00
DottaandPaperclip 1b51f95c6c feat(runner): add phase 1 static replay contract
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 19:13:00 +00:00
DottaandPaperclip a86edda579 fix(runner): establish phase 0 rust boundary
Add the production-direction Cargo workspace, make the Rust tracer the default Phase 0 path, and enforce shared-fixture parity with the TypeScript reference. Extend standalone boundary checks and record the correction in the implementation plan and OKF journal.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 18:12:48 +00:00
DottaandPaperclip 164e44ef4e feat(runner): add standalone phase 0 skeleton
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-07 16:33:01 +00:00