Score runtime (D5): manifests, router, entitlements, stage guard, usage capture - #76

Closed
aarontrowbridge wants to merge 20 commits into
mainfrom
aaron/scores-runtime
Closed

Score runtime (D5): manifests, router, entitlements, stage guard, usage capture#76
aarontrowbridge wants to merge 20 commits into
mainfrom
aaron/scores-runtime

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

Implements the score runtime (D5) from spec spec-20260703-025314-amicode-scores-front-of-chain (personal vault, reviewer-approved), plan plan-20260703-040654-amicode-score-runtime. Built on top of aaron/night-l0-pulse-designer (#75) in a separate worktree.

What this adds

  • Scores are content, not codescores/<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.
  • Score #0 — the night build's 8-stage pulse-designer interview migrated to data. The hardcoded AGENTS.md section is untouched and serves as the fallback: score trouble can never brick the boot, and the night tests are unmodified.
  • Onset router — "What do you want to do today?" generated from installed × entitled scores (empty entitlements: = public; invalid/expired code → named error + public fallback; LocalEntitlementProvider stub implements the D3 interface).
  • "Data-defined, prompt-executed"prepareOpencodeProject compiles router + score over the injected AGENTS.md and drops score_manifest.json where the plugin looks (entitiesDir() — zero extension.ts changes).
  • Stage-order + gate guard in the amicode_* tools via a new dependency-free sibling opencode-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 captureusage.jsonl (session/stage/gate events) + funnel reconstruction; interview_state.json pins {score_id, score_version} so score revisions never disturb in-flight sessions.

Evidence

  • Unit suite 203/203 (baseline 128 + 75 new, incl. packaging asserted against a real .vsix).
  • Live e2e PASS (25 s, free tier): router options rendered → single-question cadence → LaTeX confirm → guard state on disk. Experiment note: 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.md and 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

aarontrowbridgeand others added 20 commits July 3, 2026 02:28
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>
…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>
@aarontrowbridge

Copy link
Copy Markdown
MemberAuthor

Merged into the night branch (d6f9719 on aaron/night-l0-pulse-designer, now in #75's diff) — 0 conflicts as predicted, suite 203/203, Bun single-export probe: 1 export / 7 tools. Inherited tasks done on the night branch: the 778e1bb ask-discipline prose + the anti-drift anchor-on-recorded-state rule are mirrored into scores/pulse-designer/SCORE.md (bumped to v2; prep tests made version-agnostic with a banner↔manifest cross-check, 7f28414). Also folded: the fixed-port feature found staged in the night tree (220794c, amicode.opencodePort default 43117). Merge order for main: #75 now carries everything; #76 can be closed into it or retargeted at Aaron's discretion.

🤖 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).
@aarontrowbridge

Copy link
Copy Markdown
MemberAuthor

Hygiene sweep 2026-08-27: closing as stale — opened 2026-07-03, CONFLICTING with ~2 months of main (the whole M0–M4 canonical-opencode migration + app-bundle overlay landed over it). The score runtime it builds (manifests/router/entitlements) shipped through later slices — score_manifest.json is live in problem workspaces. Branch survives if any piece was missed.

Sign up for freeto 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.

1 participant

@aarontrowbridge
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Score runtime (D5): manifests, router, entitlements, stage guard, usage capture - #76

Closed
aarontrowbridge wants to merge 20 commits into
mainfrom
aaron/scores-runtime
Closed

Score runtime (D5): manifests, router, entitlements, stage guard, usage capture#76
aarontrowbridge wants to merge 20 commits into
mainfrom
aaron/scores-runtime

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

Implements the score runtime (D5) from spec spec-20260703-025314-amicode-scores-front-of-chain (personal vault, reviewer-approved), plan plan-20260703-040654-amicode-score-runtime. Built on top of aaron/night-l0-pulse-designer (#75) in a separate worktree.

What this adds

  • Scores are content, not codescores/<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.
  • Score #0 — the night build's 8-stage pulse-designer interview migrated to data. The hardcoded AGENTS.md section is untouched and serves as the fallback: score trouble can never brick the boot, and the night tests are unmodified.
  • Onset router — "What do you want to do today?" generated from installed × entitled scores (empty entitlements: = public; invalid/expired code → named error + public fallback; LocalEntitlementProvider stub implements the D3 interface).
  • "Data-defined, prompt-executed"prepareOpencodeProject compiles router + score over the injected AGENTS.md and drops score_manifest.json where the plugin looks (entitiesDir() — zero extension.ts changes).
  • Stage-order + gate guard in the amicode_* tools via a new dependency-free sibling opencode-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 captureusage.jsonl (session/stage/gate events) + funnel reconstruction; interview_state.json pins {score_id, score_version} so score revisions never disturb in-flight sessions.

Evidence

  • Unit suite 203/203 (baseline 128 + 75 new, incl. packaging asserted against a real .vsix).
  • Live e2e PASS (25 s, free tier): router options rendered → single-question cadence → LaTeX confirm → guard state on disk. Experiment note: 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.md and 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

aarontrowbridgeand others added 20 commits July 3, 2026 02:28
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>
…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>
@aarontrowbridge

Copy link
Copy Markdown
MemberAuthor

Merged into the night branch (d6f9719 on aaron/night-l0-pulse-designer, now in #75's diff) — 0 conflicts as predicted, suite 203/203, Bun single-export probe: 1 export / 7 tools. Inherited tasks done on the night branch: the 778e1bb ask-discipline prose + the anti-drift anchor-on-recorded-state rule are mirrored into scores/pulse-designer/SCORE.md (bumped to v2; prep tests made version-agnostic with a banner↔manifest cross-check, 7f28414). Also folded: the fixed-port feature found staged in the night tree (220794c, amicode.opencodePort default 43117). Merge order for main: #75 now carries everything; #76 can be closed into it or retargeted at Aaron's discretion.

🤖 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).
@aarontrowbridge

Copy link
Copy Markdown
MemberAuthor

Hygiene sweep 2026-08-27: closing as stale — opened 2026-07-03, CONFLICTING with ~2 months of main (the whole M0–M4 canonical-opencode migration + app-bundle overlay landed over it). The score runtime it builds (manifests/router/entitlements) shipped through later slices — score_manifest.json is live in problem workspaces. Branch survives if any piece was missed.

Sign up for freeto 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.

1 participant

@aarontrowbridge
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Score runtime (D5): manifests, router, entitlements, stage guard, usage capture - #76

Closed
aarontrowbridge wants to merge 20 commits into
mainfrom
aaron/scores-runtime
Closed

Score runtime (D5): manifests, router, entitlements, stage guard, usage capture#76
aarontrowbridge wants to merge 20 commits into
mainfrom
aaron/scores-runtime

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

Implements the score runtime (D5) from spec spec-20260703-025314-amicode-scores-front-of-chain (personal vault, reviewer-approved), plan plan-20260703-040654-amicode-score-runtime. Built on top of aaron/night-l0-pulse-designer (#75) in a separate worktree.

What this adds

  • Scores are content, not codescores/<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.
  • Score #0 — the night build's 8-stage pulse-designer interview migrated to data. The hardcoded AGENTS.md section is untouched and serves as the fallback: score trouble can never brick the boot, and the night tests are unmodified.
  • Onset router — "What do you want to do today?" generated from installed × entitled scores (empty entitlements: = public; invalid/expired code → named error + public fallback; LocalEntitlementProvider stub implements the D3 interface).
  • "Data-defined, prompt-executed"prepareOpencodeProject compiles router + score over the injected AGENTS.md and drops score_manifest.json where the plugin looks (entitiesDir() — zero extension.ts changes).
  • Stage-order + gate guard in the amicode_* tools via a new dependency-free sibling opencode-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 captureusage.jsonl (session/stage/gate events) + funnel reconstruction; interview_state.json pins {score_id, score_version} so score revisions never disturb in-flight sessions.

Evidence

  • Unit suite 203/203 (baseline 128 + 75 new, incl. packaging asserted against a real .vsix).
  • Live e2e PASS (25 s, free tier): router options rendered → single-question cadence → LaTeX confirm → guard state on disk. Experiment note: 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.md and 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

aarontrowbridgeand others added 20 commits July 3, 2026 02:28
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>
…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>
@aarontrowbridge

Copy link
Copy Markdown
MemberAuthor

Merged into the night branch (d6f9719 on aaron/night-l0-pulse-designer, now in #75's diff) — 0 conflicts as predicted, suite 203/203, Bun single-export probe: 1 export / 7 tools. Inherited tasks done on the night branch: the 778e1bb ask-discipline prose + the anti-drift anchor-on-recorded-state rule are mirrored into scores/pulse-designer/SCORE.md (bumped to v2; prep tests made version-agnostic with a banner↔manifest cross-check, 7f28414). Also folded: the fixed-port feature found staged in the night tree (220794c, amicode.opencodePort default 43117). Merge order for main: #75 now carries everything; #76 can be closed into it or retargeted at Aaron's discretion.

🤖 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).
@aarontrowbridge

Copy link
Copy Markdown
MemberAuthor

Hygiene sweep 2026-08-27: closing as stale — opened 2026-07-03, CONFLICTING with ~2 months of main (the whole M0–M4 canonical-opencode migration + app-bundle overlay landed over it). The score runtime it builds (manifests/router/entitlements) shipped through later slices — score_manifest.json is live in problem workspaces. Branch survives if any piece was missed.

Sign up for freeto 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.

1 participant

@aarontrowbridge
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Score runtime (D5): manifests, router, entitlements, stage guard, usage capture - #76

Closed
aarontrowbridge wants to merge 20 commits into
mainfrom
aaron/scores-runtime
Closed

Score runtime (D5): manifests, router, entitlements, stage guard, usage capture#76
aarontrowbridge wants to merge 20 commits into
mainfrom
aaron/scores-runtime

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

Implements the score runtime (D5) from spec spec-20260703-025314-amicode-scores-front-of-chain (personal vault, reviewer-approved), plan plan-20260703-040654-amicode-score-runtime. Built on top of aaron/night-l0-pulse-designer (#75) in a separate worktree.

What this adds

  • Scores are content, not codescores/<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.
  • Score #0 — the night build's 8-stage pulse-designer interview migrated to data. The hardcoded AGENTS.md section is untouched and serves as the fallback: score trouble can never brick the boot, and the night tests are unmodified.
  • Onset router — "What do you want to do today?" generated from installed × entitled scores (empty entitlements: = public; invalid/expired code → named error + public fallback; LocalEntitlementProvider stub implements the D3 interface).
  • "Data-defined, prompt-executed"prepareOpencodeProject compiles router + score over the injected AGENTS.md and drops score_manifest.json where the plugin looks (entitiesDir() — zero extension.ts changes).
  • Stage-order + gate guard in the amicode_* tools via a new dependency-free sibling opencode-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 captureusage.jsonl (session/stage/gate events) + funnel reconstruction; interview_state.json pins {score_id, score_version} so score revisions never disturb in-flight sessions.

Evidence

  • Unit suite 203/203 (baseline 128 + 75 new, incl. packaging asserted against a real .vsix).
  • Live e2e PASS (25 s, free tier): router options rendered → single-question cadence → LaTeX confirm → guard state on disk. Experiment note: 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.md and 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

aarontrowbridgeand others added 20 commits July 3, 2026 02:28
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>
…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>
@aarontrowbridge

Copy link
Copy Markdown
MemberAuthor

Merged into the night branch (d6f9719 on aaron/night-l0-pulse-designer, now in #75's diff) — 0 conflicts as predicted, suite 203/203, Bun single-export probe: 1 export / 7 tools. Inherited tasks done on the night branch: the 778e1bb ask-discipline prose + the anti-drift anchor-on-recorded-state rule are mirrored into scores/pulse-designer/SCORE.md (bumped to v2; prep tests made version-agnostic with a banner↔manifest cross-check, 7f28414). Also folded: the fixed-port feature found staged in the night tree (220794c, amicode.opencodePort default 43117). Merge order for main: #75 now carries everything; #76 can be closed into it or retargeted at Aaron's discretion.

🤖 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).
@aarontrowbridge

Copy link
Copy Markdown
MemberAuthor

Hygiene sweep 2026-08-27: closing as stale — opened 2026-07-03, CONFLICTING with ~2 months of main (the whole M0–M4 canonical-opencode migration + app-bundle overlay landed over it). The score runtime it builds (manifests/router/entitlements) shipped through later slices — score_manifest.json is live in problem workspaces. Branch survives if any piece was missed.

Sign up for freeto 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.

1 participant

@aarontrowbridge
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Score runtime (D5): manifests, router, entitlements, stage guard, usage capture - #76

Closed
aarontrowbridge wants to merge 20 commits into
mainfrom
aaron/scores-runtime
Closed

Score runtime (D5): manifests, router, entitlements, stage guard, usage capture#76
aarontrowbridge wants to merge 20 commits into
mainfrom
aaron/scores-runtime

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

Implements the score runtime (D5) from spec spec-20260703-025314-amicode-scores-front-of-chain (personal vault, reviewer-approved), plan plan-20260703-040654-amicode-score-runtime. Built on top of aaron/night-l0-pulse-designer (#75) in a separate worktree.

What this adds

  • Scores are content, not codescores/<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.
  • Score #0 — the night build's 8-stage pulse-designer interview migrated to data. The hardcoded AGENTS.md section is untouched and serves as the fallback: score trouble can never brick the boot, and the night tests are unmodified.
  • Onset router — "What do you want to do today?" generated from installed × entitled scores (empty entitlements: = public; invalid/expired code → named error + public fallback; LocalEntitlementProvider stub implements the D3 interface).
  • "Data-defined, prompt-executed"prepareOpencodeProject compiles router + score over the injected AGENTS.md and drops score_manifest.json where the plugin looks (entitiesDir() — zero extension.ts changes).
  • Stage-order + gate guard in the amicode_* tools via a new dependency-free sibling opencode-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 captureusage.jsonl (session/stage/gate events) + funnel reconstruction; interview_state.json pins {score_id, score_version} so score revisions never disturb in-flight sessions.

Evidence

  • Unit suite 203/203 (baseline 128 + 75 new, incl. packaging asserted against a real .vsix).
  • Live e2e PASS (25 s, free tier): router options rendered → single-question cadence → LaTeX confirm → guard state on disk. Experiment note: 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.md and 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

aarontrowbridgeand others added 20 commits July 3, 2026 02:28
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>
…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>
@aarontrowbridge

Copy link
Copy Markdown
MemberAuthor

Merged into the night branch (d6f9719 on aaron/night-l0-pulse-designer, now in #75's diff) — 0 conflicts as predicted, suite 203/203, Bun single-export probe: 1 export / 7 tools. Inherited tasks done on the night branch: the 778e1bb ask-discipline prose + the anti-drift anchor-on-recorded-state rule are mirrored into scores/pulse-designer/SCORE.md (bumped to v2; prep tests made version-agnostic with a banner↔manifest cross-check, 7f28414). Also folded: the fixed-port feature found staged in the night tree (220794c, amicode.opencodePort default 43117). Merge order for main: #75 now carries everything; #76 can be closed into it or retargeted at Aaron's discretion.

🤖 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).
@aarontrowbridge

Copy link
Copy Markdown
MemberAuthor

Hygiene sweep 2026-08-27: closing as stale — opened 2026-07-03, CONFLICTING with ~2 months of main (the whole M0–M4 canonical-opencode migration + app-bundle overlay landed over it). The score runtime it builds (manifests/router/entitlements) shipped through later slices — score_manifest.json is live in problem workspaces. Branch survives if any piece was missed.

Sign up for freeto 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.

1 participant

@aarontrowbridge
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Score runtime (D5): manifests, router, entitlements, stage guard, usage capture - #76

Closed
aarontrowbridge wants to merge 20 commits into
mainfrom
aaron/scores-runtime
Closed

Score runtime (D5): manifests, router, entitlements, stage guard, usage capture#76
aarontrowbridge wants to merge 20 commits into
mainfrom
aaron/scores-runtime

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

Implements the score runtime (D5) from spec spec-20260703-025314-amicode-scores-front-of-chain (personal vault, reviewer-approved), plan plan-20260703-040654-amicode-score-runtime. Built on top of aaron/night-l0-pulse-designer (#75) in a separate worktree.

What this adds

  • Scores are content, not codescores/<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.
  • Score #0 — the night build's 8-stage pulse-designer interview migrated to data. The hardcoded AGENTS.md section is untouched and serves as the fallback: score trouble can never brick the boot, and the night tests are unmodified.
  • Onset router — "What do you want to do today?" generated from installed × entitled scores (empty entitlements: = public; invalid/expired code → named error + public fallback; LocalEntitlementProvider stub implements the D3 interface).
  • "Data-defined, prompt-executed"prepareOpencodeProject compiles router + score over the injected AGENTS.md and drops score_manifest.json where the plugin looks (entitiesDir() — zero extension.ts changes).
  • Stage-order + gate guard in the amicode_* tools via a new dependency-free sibling opencode-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 captureusage.jsonl (session/stage/gate events) + funnel reconstruction; interview_state.json pins {score_id, score_version} so score revisions never disturb in-flight sessions.

Evidence

  • Unit suite 203/203 (baseline 128 + 75 new, incl. packaging asserted against a real .vsix).
  • Live e2e PASS (25 s, free tier): router options rendered → single-question cadence → LaTeX confirm → guard state on disk. Experiment note: 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.md and 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

aarontrowbridgeand others added 20 commits July 3, 2026 02:28
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>
…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>
@aarontrowbridge

Copy link
Copy Markdown
MemberAuthor

Merged into the night branch (d6f9719 on aaron/night-l0-pulse-designer, now in #75's diff) — 0 conflicts as predicted, suite 203/203, Bun single-export probe: 1 export / 7 tools. Inherited tasks done on the night branch: the 778e1bb ask-discipline prose + the anti-drift anchor-on-recorded-state rule are mirrored into scores/pulse-designer/SCORE.md (bumped to v2; prep tests made version-agnostic with a banner↔manifest cross-check, 7f28414). Also folded: the fixed-port feature found staged in the night tree (220794c, amicode.opencodePort default 43117). Merge order for main: #75 now carries everything; #76 can be closed into it or retargeted at Aaron's discretion.

🤖 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).
@aarontrowbridge

Copy link
Copy Markdown
MemberAuthor

Hygiene sweep 2026-08-27: closing as stale — opened 2026-07-03, CONFLICTING with ~2 months of main (the whole M0–M4 canonical-opencode migration + app-bundle overlay landed over it). The score runtime it builds (manifests/router/entitlements) shipped through later slices — score_manifest.json is live in problem workspaces. Branch survives if any piece was missed.

Sign up for freeto 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.

1 participant

@aarontrowbridge
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Score runtime (D5): manifests, router, entitlements, stage guard, usage capture - #76

Closed
aarontrowbridge wants to merge 20 commits into
mainfrom
aaron/scores-runtime
Closed

Score runtime (D5): manifests, router, entitlements, stage guard, usage capture#76
aarontrowbridge wants to merge 20 commits into
mainfrom
aaron/scores-runtime

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

Implements the score runtime (D5) from spec spec-20260703-025314-amicode-scores-front-of-chain (personal vault, reviewer-approved), plan plan-20260703-040654-amicode-score-runtime. Built on top of aaron/night-l0-pulse-designer (#75) in a separate worktree.

What this adds

  • Scores are content, not codescores/<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.
  • Score #0 — the night build's 8-stage pulse-designer interview migrated to data. The hardcoded AGENTS.md section is untouched and serves as the fallback: score trouble can never brick the boot, and the night tests are unmodified.
  • Onset router — "What do you want to do today?" generated from installed × entitled scores (empty entitlements: = public; invalid/expired code → named error + public fallback; LocalEntitlementProvider stub implements the D3 interface).
  • "Data-defined, prompt-executed"prepareOpencodeProject compiles router + score over the injected AGENTS.md and drops score_manifest.json where the plugin looks (entitiesDir() — zero extension.ts changes).
  • Stage-order + gate guard in the amicode_* tools via a new dependency-free sibling opencode-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 captureusage.jsonl (session/stage/gate events) + funnel reconstruction; interview_state.json pins {score_id, score_version} so score revisions never disturb in-flight sessions.

Evidence

  • Unit suite 203/203 (baseline 128 + 75 new, incl. packaging asserted against a real .vsix).
  • Live e2e PASS (25 s, free tier): router options rendered → single-question cadence → LaTeX confirm → guard state on disk. Experiment note: 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.md and 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

aarontrowbridgeand others added 20 commits July 3, 2026 02:28
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>
…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>
@aarontrowbridge

Copy link
Copy Markdown
MemberAuthor

Merged into the night branch (d6f9719 on aaron/night-l0-pulse-designer, now in #75's diff) — 0 conflicts as predicted, suite 203/203, Bun single-export probe: 1 export / 7 tools. Inherited tasks done on the night branch: the 778e1bb ask-discipline prose + the anti-drift anchor-on-recorded-state rule are mirrored into scores/pulse-designer/SCORE.md (bumped to v2; prep tests made version-agnostic with a banner↔manifest cross-check, 7f28414). Also folded: the fixed-port feature found staged in the night tree (220794c, amicode.opencodePort default 43117). Merge order for main: #75 now carries everything; #76 can be closed into it or retargeted at Aaron's discretion.

🤖 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).
@aarontrowbridge

Copy link
Copy Markdown
MemberAuthor

Hygiene sweep 2026-08-27: closing as stale — opened 2026-07-03, CONFLICTING with ~2 months of main (the whole M0–M4 canonical-opencode migration + app-bundle overlay landed over it). The score runtime it builds (manifests/router/entitlements) shipped through later slices — score_manifest.json is live in problem workspaces. Branch survives if any piece was missed.

Sign up for freeto 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.

1 participant

@aarontrowbridge
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Score runtime (D5): manifests, router, entitlements, stage guard, usage capture - #76

Closed
aarontrowbridge wants to merge 20 commits into
mainfrom
aaron/scores-runtime
Closed

Score runtime (D5): manifests, router, entitlements, stage guard, usage capture#76
aarontrowbridge wants to merge 20 commits into
mainfrom
aaron/scores-runtime

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

Implements the score runtime (D5) from spec spec-20260703-025314-amicode-scores-front-of-chain (personal vault, reviewer-approved), plan plan-20260703-040654-amicode-score-runtime. Built on top of aaron/night-l0-pulse-designer (#75) in a separate worktree.

What this adds

  • Scores are content, not codescores/<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.
  • Score #0 — the night build's 8-stage pulse-designer interview migrated to data. The hardcoded AGENTS.md section is untouched and serves as the fallback: score trouble can never brick the boot, and the night tests are unmodified.
  • Onset router — "What do you want to do today?" generated from installed × entitled scores (empty entitlements: = public; invalid/expired code → named error + public fallback; LocalEntitlementProvider stub implements the D3 interface).
  • "Data-defined, prompt-executed"prepareOpencodeProject compiles router + score over the injected AGENTS.md and drops score_manifest.json where the plugin looks (entitiesDir() — zero extension.ts changes).
  • Stage-order + gate guard in the amicode_* tools via a new dependency-free sibling opencode-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 captureusage.jsonl (session/stage/gate events) + funnel reconstruction; interview_state.json pins {score_id, score_version} so score revisions never disturb in-flight sessions.

Evidence

  • Unit suite 203/203 (baseline 128 + 75 new, incl. packaging asserted against a real .vsix).
  • Live e2e PASS (25 s, free tier): router options rendered → single-question cadence → LaTeX confirm → guard state on disk. Experiment note: 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.md and 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

aarontrowbridgeand others added 20 commits July 3, 2026 02:28
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>
…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>
@aarontrowbridge

Copy link
Copy Markdown
MemberAuthor

Merged into the night branch (d6f9719 on aaron/night-l0-pulse-designer, now in #75's diff) — 0 conflicts as predicted, suite 203/203, Bun single-export probe: 1 export / 7 tools. Inherited tasks done on the night branch: the 778e1bb ask-discipline prose + the anti-drift anchor-on-recorded-state rule are mirrored into scores/pulse-designer/SCORE.md (bumped to v2; prep tests made version-agnostic with a banner↔manifest cross-check, 7f28414). Also folded: the fixed-port feature found staged in the night tree (220794c, amicode.opencodePort default 43117). Merge order for main: #75 now carries everything; #76 can be closed into it or retargeted at Aaron's discretion.

🤖 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).
@aarontrowbridge

Copy link
Copy Markdown
MemberAuthor

Hygiene sweep 2026-08-27: closing as stale — opened 2026-07-03, CONFLICTING with ~2 months of main (the whole M0–M4 canonical-opencode migration + app-bundle overlay landed over it). The score runtime it builds (manifests/router/entitlements) shipped through later slices — score_manifest.json is live in problem workspaces. Branch survives if any piece was missed.

Sign up for freeto 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.

1 participant

@aarontrowbridge