Skip to content

WIP night spike: pulse-designer Layer-0 — interview → entities → solve, e2e green - #75

Merged
jack-champagne merged 31 commits into
mainfrom
aaron/night-l0-pulse-designer
Jul 8, 2026
Merged

WIP night spike: pulse-designer Layer-0 — interview → entities → solve, e2e green#75
jack-champagne merged 31 commits into
mainfrom
aaron/night-l0-pulse-designer

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

What this is

The Layer-0 pulse-designer track from tonight's spec (spec — drafted in Aaron's personal vault, spec-20260703-020630-amicode-opencode-thin-fork; will be socialized before team-canon promotion). It implements the front-of-chain interview (UX1 #46's storyboard) as opencode-native config: an agent + instructions + a bookkeeping tool pack. Nothing in the phased build moves — amico-run, run-dir contract, schemas, inspector, scheduler/Δ-cloud tracks are all untouched; the only modified prod file is opencode_config.ts (additive keys).

Commits

  1. feat(L0) interview spine in AGENTS.md — 8 stages, one-question-at-a-time, scoped to the pulse-designer persona so the default build agent behaves exactly as before
  2. test(L0) tiered e2e suite (A registration / B plugin load / C live turns / D full chain)
  3. feat(L0) amicode_* tool pack v0 + registration (plugin abs-path + agent block via OPENCODE_CONFIG_CONTENT — both verified live at 1.17.3)
  4. tier C + D enablement

Evidence (all on this branch, tonight)

  • Fast suite: 122 passed (was 91 on main)
  • e2e 4/4 tiers green incl. tier D full chain: 10 interview turns (free anonymous provider — zero creds on the machine!) → all four tools fired (System → Formulation → Run entities on disk) → agent authored solve.jl from the vetted template → detached amico-run launch → run-dir → FINISHEDF = 0.9998977, 60 iters
  • Repro: AMICODE_E2E_LIVE=1 AMICODE_E2E_FULLCHAIN=1 npx vitest run test/slow/interview_e2e.test.ts

Not in this PR

The opencode fork (branded binary — L1 "AMICODE" + build recipe) lives in a local-only clone, deliberately unpublished pending discussion. This branch runs green against the stock vendored binary too — the L0 layer is binary-agnostic by design.

Known follow-ups

.vsix packaging of opencode-plugin/ unverified (TODO in headers); set_model merges via json sidecar; Rydberg is recorded-honestly (template is transmon-only); free-model phrasing variance noted in the tier-D transcript.

🤖 Generated with Claude Code

@aarontrowbridge

Copy link
Copy Markdown
Member Author

T16 landed after the PR opened: amicode_to_hardware + amicode_calibrate guided stubs (no device I/O; gate/checks values pinned by the serializer). The pack now covers all 8 interview stages — 6 tools registered, 128 tests green. Also since opening: e2e re-verified 4/4 against the refreshed fork binary (fast suite + smoke + tiers; one tier-C flake traced to free-model sampling noise, passed on rerun — live tiers are env-gated off in CI).

🤖 Generated with Claude Code

@aarontrowbridge

Copy link
Copy Markdown
Member Author

Live-demo-driven additions (Aaron driving the dev host, ~03:00–04:00): Amico identity + proactive interview kickoff (fc7b13d) and amicode_ask — option-stage questions as button payloads, 7 tools registered (903ce76). The matching UI (entity rail, collapsed chips, ask-button cards, start-screen wordmark, en-default locale) lives in the local fork's patch stack (11 commits, unpublished — see the handoff note in the personal vault). All L0 changes here remain binary-agnostic: on a stock binary, amicode_ask degrades to a plain-text question with listed options.

🤖 Generated with Claude Code

@aarontrowbridge

Copy link
Copy Markdown
Member Author

This branch now additionally carries: the scores runtime (#76 merged, interview-as-data — score #0 v2 with ask-discipline + anchor-on-recorded-state), and the fixed opencode port (amicode.opencodePort, default 43117 — Remote-SSH users forward once). Suite: 203/203. Note for reviewers: 6471ed9 was momentarily red (hardcoded score-version literals in the stacked tests), fixed in 7f28414.

🤖 Generated with Claude Code

@aarontrowbridge

Copy link
Copy Markdown
Member Author

Final night addition: consolidated on opencode's native question tool (turn-blocking form — structurally prevents the self-answer/prose-repeat failure modes) as the one ask mechanism; amicode_ask deprecated-but-kept (8e9c89e). Score #0 at v3. Fork brands the native form and ships a 5-chip start screen with a repertoire-chips TODO (chips become one-per-entitled-score once a small endpoint exposes the compiled repertoire).

🤖 Generated with Claude Code

@aarontrowbridge
aarontrowbridge marked this pull request as ready for review July 3, 2026 10:46
@aarontrowbridge

Copy link
Copy Markdown
Member Author

Ready for review — merge gated on @jack-champagne's eyes (Aaron's call: everything ships except the merge).

Since the last update: scores runtime merged in (#76 content — interview-as-data, score #0 v3, guard, router, usage funnel), fixed port 43117, curated capabilities answer, native-question-tool consolidation, H-robot brand mark + spinner, and the distribution chain is live: the vendored binary now comes from the private mirror release harmoniqs/opencode v1.17.3-amicode.1 (linux-x64 + darwin-arm64), clean-fetch verified byte-identical.

Review pointers (the seams): opencode.lock.json + scripts/fetch_opencode.mjs (repo/tag + authenticated gh path), src/opencode_config.ts (additive agent/plugin/permission injection), opencode-plugin/ (Bun-side, single-export), scores/ (splice never touches source AGENTS.md — fallback intact). Suite: 206 fast + slow gates green, CI green both platforms. Setup for testing: root AGENTS.md (agent-forward) or packages/extension/TESTING.md (human).

Known-not-done, honestly: Rydberg CZ template is EXPERIMENTAL (vetting stalled, marked in-file); amicode_ask deprecated-not-removed; ask-card/bridge legacy code pending pruning; repertoire-driven start chips need a server endpoint.

🤖 Generated with Claude Code

jack-champagne pushed a commit that referenced this pull request Jul 3, 2026
…the per-solve "ask" nag (#79)

AGENTS.md instructs the agent to READ run artifacts (FINISHED/result.toml for
results, run.log for failure tracebacks) under the runs root — but the injected
permission.external_directory only granted the templates dir + /tmp/amicode-work.
opencode defaults external_directory to "ask", so every read-back fired a
permission prompt: one per solve, and repeatedly on failures (the 2026-07-03
live test hit this hard — four failing runs, agent in run.log each time).

Thread the resolved runsRoot (respects the amicode.runsRoot setting) into
buildOpencodeConfigContent and grant `${runsRoot}/**`. Still least-privilege:
scoped to the one additional root AGENTS.md actually sends the agent's file
tools into; amico-run's own subprocess writes never needed a grant.

Tests: unit (grant present + still path-scoped), real-opencode integration
(grant survives the 1.17.3 deep-merge alongside the user's global permission
keys). 93 pass, typecheck clean.

Note: Aaron's #75/#76 restructure the same permission block (adding entities/
scores grants — correctly); whichever lands second has a one-line rebase.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
aarontrowbridge and others added 20 commits July 3, 2026 17:02
Scoped to the pulse-designer persona (never hijacks the default build agent),
one-question-at-a-time, 8 stages PLATFORM→CALIBRATE, transmon fully wired /
Rydberg recorded-honestly, amicode_* tools as bookkeeping with bash+amico-run
still the launch mechanism. Tests: interview block + no-unknown-placeholder
assertion (only {{TEMPLATE_PATH}}/{{JULIA_PROJECT}} substituted).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…gin load / live turns)

Tier A green vs stock 1.17.3; B gates on the plugin file, C on creds
(none on this machine tonight — morning step: opencode auth login).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Four bookkeeping tools (pick_system / set_model / formulate / solve-record)
executed by opencode's embedded Bun runtime; entities as TOML under
~/.amico/runs/default/_entities ($AMICODE_ENTITIES_DIR override). Registration
via buildOpencodeConfigContent: plugin abs-path + pulse-designer agent block +
entities-dir permission grant (T8 probe: both mechanisms live at 1.17.3).
Plugin stays outside the extension bundle/tsconfig; load line on stderr
(debug-config stdout purity — regression-guarded). 99→122 tests green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Free anonymous provider (opencode/big-pickle) resolves without auth.json →
AMICODE_E2E_LIVE=1 forces the creds gate. Cadence assertion = stage-batching
check (multiple '?' inside one platform question is fine); transcript saved
to tmpdir for the experiment note.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Real-home mode now substitutes AGENTS.md via prepareOpencodeProject (stage 6
needs real template/julia paths). Keyword-routed answers, bounded turns,
run-dir poll. Result: 10 turns on the free model → all four amicode_* tools
fired (System→Formulation→Run stub) → authored solve.jl → amico-run launch →
F=0.9998977/60 iters. AMICODE_E2E_FULLCHAIN=1 gates it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
amicode_to_hardware (device_session stub; gate + checks PINNED by the
serializer so a stub can never claim an approval that didn't happen) and
amicode_calibrate (ILC stub, auto-refs device_session.toml). No device I/O —
explanations say so explicitly, mirroring AGENTS.md stage 8, which now names
both tools. 6 tools registered (verified via /experimental/tool/ids). 122→128
tests green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
'Who are you?' now answers 'I'm Amico — Amicode's pulse-design copilot'
(never 'opencode, an interactive CLI tool'), and a greeting/no-intent session
opener triggers the stage-1 PLATFORM question instead of a generic assistant
reply. Specific asks keep the skip rule.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Interview option-stages (platform, sim-vs-solve, problem/gate) now go through
amicode_ask(question, options[2-6]); the renderer draws buttons from the tool
part's input and a click sends the option text as the next user message.
Free-form values stay plain questions. 7 tools registered (runtime-verified).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Live-demo findings: the free model repeated the question in prose and answered
it itself. Tool return now says STOP HERE explicitly; AGENTS.md mirrors it.
New optional details[] arg — one dim qualifier per button (minimalist card,
slightly more context).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pixel <0110> face in brand yellow on the H silhouette (from the website
robot); currentColor body serves dark+light. Same asset ships in the fork's
logo/favicon (kept in sync manually — canonical geometry recorded there in
AMICODE-PATCHES.md).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ited stop

Work found staged in the night tree (parallel session / Aaron) — folded in
after validating build + full suite green. Fixes the Remote-SSH pain: forward
43117 once, restarts reuse it; stop() now resolves on child exit so a
fixed-port restart can't race the old process for the socket. Set 0 to restore
per-start ephemeral ports.
…e_manifest transport, scores-root grant, never-brick fallback
aarontrowbridge and others added 11 commits July 3, 2026 17:04
…s (score_guard sibling module, entitiesDir transport)
…ded-state (v2)

The compiled score is now what runtime users see — the STOP-HERE ask
discipline and optional per-option details move in from the AGENTS.md
fallback, plus the anti-drift anchor from Aaron's live session (rail said
rydberg while the interview asked transmon-omega): re-read the System entity
before stage-2+ questions; correct the record first if it's wrong.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ion cross-check

Score content bumps (v1->v2 tonight) must not red the suite; instead assert
the compiled banner and the manifest agree on whatever version ships.
… deprecated

Live finding: 1.17.3 ships a turn-blocking question tool (tool/question.ts)
with options+descriptions+custom answers — the model reached for it unprompted
and its semantics structurally kill self-answering and prose repeats. Score #0
v3 + AGENTS.md fallback now route all choice questions through it; amicode_ask
stays registered but deprecated. One mechanism, upstream-owned.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ine talk

The starter chip hit a Webfetch to the engine's website and a flat 3-sentence
reply. The canonical question now has a canonical answer: capability bullets
(interview, fast-path, live inspector, warm-start/resume, hardware preview),
honest scope line, then next-step options via the question tool.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…late

fetch_opencode gains repo/tag manifest fields with authenticated gh download
for the private harmoniqs/opencode release (206 tests). TESTING.md = the
7-point branch test script for the team. solve_rydberg_cz.jl: 2-atom 3-level
QuEra deep-blockade CZ, public-Piccolo-only (fixed-phase NLP + post-hoc
virtual-Z scan; free_phase kwarg is Piccolissimo-gated) — vetting solve in
flight, score wiring lands with its result.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Point an agent at the repo and it can set up, verify, and test the branch:
prerequisites with checks, ordered setup, five verification gates, dev facts
(fixed port, fork boundary, plugin runtime, scores), sharp edges.
…icode.1)

Lock repointed to the mirror (both platform shas from the release assets);
clean-fetch verified end-to-end via the authenticated gh path — downloaded
binary is byte-identical to the deployed build (8aa718ad…) and serves
<title>Amicode</title>. Rydberg CZ template clearly marked EXPERIMENTAL
(vetting stalled on pathological first-iteration NLP cost; parked) and
TESTING.md de-overclaimed accordingly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ot signature

The rebase onto main folded in #79's runsRoot param (3rd position). These test
call sites predated it and passed pluginPath/scoresRoot into the wrong slots or
omitted runsRoot entirely. Insert runsRoot so scores + slow-e2e configs grant
the right paths. Fast suite 207 pass; tsc --noEmit clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@aarontrowbridge
aarontrowbridge force-pushed the aaron/night-l0-pulse-designer branch from 05db60f to d81e63f Compare July 3, 2026 21:08
jack-champagne added a commit that referenced this pull request Jul 4, 2026
The pre-solve formulation.toml emit could not run through the agent deploy
path: AGENTS.md copies solve_template.jl alone into a scratch dir and runs the
copy, so @__DIR__ was the scratch dir and include(emit_formulation.jl) resolved
to a file that was never copied — LoadError before solve!, on every run. CI
never executes the template, so it stayed green.

- Inline emit_formulation into solve_template.jl; delete the sibling helper.
  Sharing moves to a Julia package (AmicoRunDir.jl) when #75/#76 add a second
  template — the only share mechanism that survives the single-file copy.
- Tighten formulation.schema.json: per-family if/then — transmon requires and
  type-checks delta/levels/drive_max; formulation requires gate/T/N; Q/R
  optional; additionalProperties:true per family (unknown families lenient).
- Add template_deploy_contract.test.ts: reproduces the AGENTS.md single-file
  copy and asserts every include() resolves. Red on the bug, green inlined.

schema_version stays "1" (additive: no on-disk formulation.toml exists yet).
@jack-champagne
jack-champagne merged commit d81e63f into main Jul 8, 2026
1 of 5 checks passed
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.

2 participants