Score runtime (D5): manifests, router, entitlements, stage guard, usage capture - #76
Draft
aarontrowbridge wants to merge 20 commits into
Draft
Score runtime (D5): manifests, router, entitlements, stage guard, usage capture#76aarontrowbridge wants to merge 20 commits into
aarontrowbridge wants to merge 20 commits into
Conversation
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>
…tlement registry)
…N, plugin-sidecar pattern)
…e_manifest transport, scores-root grant, never-brick fallback
…s (score_guard sibling module, entitiesDir transport)
aarontrowbridge
added a commit
that referenced
this pull request
Jul 3, 2026
Interview-as-data lands on the L0 stack: SCORE.md manifests + loader/lint, score #0 = the interview, onset router + entitlements, score_guard stage/gate enforcement, usage funnel. AGENTS.md stays the never-brick fallback. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
Author
|
Merged into the night branch ( 🤖 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>
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).
This was referenced Jul 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the score runtime (D5) from spec
spec-20260703-025314-amicode-scores-front-of-chain(personal vault, reviewer-approved), planplan-20260703-040654-amicode-score-runtime. Built on top ofaaron/night-l0-pulse-designer(#75) in a separate worktree.What this adds
scores/<id>/SCORE.md(YAML frontmatter + prose voice), validated + lint-gated (templates resolve, memory hooks resolve, lineage, entitlement registry, packaging). New user path = new directory, zero runtime changes.entitlements:= public; invalid/expired code → named error + public fallback;LocalEntitlementProviderstub implements the D3 interface).prepareOpencodeProjectcompiles router + score over the injected AGENTS.md and dropsscore_manifest.jsonwhere the plugin looks (entitiesDir()— zeroextension.tschanges).amicode_*tools via a new dependency-free siblingopencode-plugin/score_guard.ts(entity dependencies block; conversational stages don't; no manifest → pure bookkeeping as before). Single-export invariant preserved (Bun probe: 1 export, 7 tools).usage.jsonl(session/stage/gate events) + funnel reconstruction;interview_state.jsonpins{score_id, score_version}so score revisions never disturb in-flight sessions.Evidence
experiment-20260703-scores-runtime-e2e(personal vault).Coordination boundary
Nothing in the phased build moves. Shared files touched:
src/opencode_config.ts(additive: scores splice + grant),opencode-plugin/amicode_tools.ts(additive: guard calls).AGENTS.mdand all night tests untouched. Not in this PR (separate tracks per the spec): Altissimo GPU cloud (D1), Pulser/PasqalExecutor (D2), redemption service (D3), marketplace (D4), Layer-3 cards (D6), Pasqal score content.🤖 Generated with Claude Code