feat(onboarding): add links stage + bridge onboarding to profile.json - #513

Merged
jeonghun-jj-lee merged 15 commits into
mainfrom
profile-onboarding-bridge
Aug 23, 2026
Merged

feat(onboarding): add links stage + bridge onboarding to profile.json#513
jeonghun-jj-lee merged 15 commits into
mainfrom
profile-onboarding-bridge

Conversation

@jeonghun-jj-lee

@jeonghun-jj-leejeonghun-jj-lee commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Part of harmoniqs/opencode#231

Bridges onboarding data into ~/.amico/profile.json so the new profile dropdown popover (opencode PR #234) is populated immediately after onboarding completes.

Changes

  • ENTITY_FIELDS expandeddescription, research_area, experiment_kind, scholar, github, custom_link_url, custom_link_label no longer silently dropped by sanitizePayload
  • Links stage — new optional stage in the overture asking for Scholar, GitHub, and custom link URLs
  • materializeProfileJson() — on onboarding_completed, replays events stream and writes identity fields to profile.json (additive merge, never clobbers inline edits)
  • Tool description updated — documents all accepted profile fields

Summary by CodeRabbit

  • New Features

    • Added guided pulse-design workflow covering platform selection, modeling, targets, solving, and result review.
    • Onboarding now collects research and profile details, including affiliations and links.
    • Completed onboarding information is saved to the local profile for future sessions.
    • Added editable pre-filled values for text questions.
  • Improvements

    • Improved onboarding resume and completion detection.
    • Updated routing so pulse design and user-provided problems start the appropriate workflow directly.
    • Expanded profile documentation and supported fields.

@jeonghun-jj-leejeonghun-jj-lee added the hitl Needs human decision or review label Aug 23, 2026
@coderabbitai

coderabbitaiBot commented Aug 23, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d7d3fe9e-c9f9-4c1d-a305-5676a5a07fab

📥 Commits

Reviewing files that changed from the base of the PR and between 5011b9b and 16a8afe.

⛔ Files ignored due to path filters (1)
  • packages/app-bundle/overlay/packages/sdk/js/src/v2/gen/types.gen.ts is excluded by !**/gen/**
📒 Files selected for processing (18)
  • packages/app-bundle/overlay/packages/app/src/pages/session/composer/session-question-dock.tsx
  • packages/app-bundle/overlay/packages/schema/src/question.ts
  • packages/app-bundle/overlay/packages/schema/src/v1/question.ts
  • packages/extension/opencode-plugin/amicode_tools.ts
  • packages/extension/opencode-plugin/onboarding.ts
  • packages/extension/scores/overture/SCORE.md
  • packages/extension/skills/design-a-pulse/SKILL.md
  • packages/extension/src/opencode_config.ts
  • packages/extension/src/scores/compiler.ts
  • packages/extension/src/scores/router.ts
  • packages/extension/src/substrate/vault_store.ts
  • packages/extension/test/scores/compiler.test.ts
  • packages/extension/test/scores/golden/compile-chained.md
  • packages/extension/test/scores/golden/compile-score.md
  • packages/extension/test/scores/golden/router-section.md
  • packages/extension/test/scores/overture_rewrite.test.ts
  • packages/extension/test/scores/overture_routing.test.ts
  • packages/extension/test/scores/prep_integration.test.ts

📝 Walkthrough

Walkthrough

The PR adds text-question defaults, rewrites overture onboarding around profile.json and filesystem completion markers, introduces the public design-a-pulse skill, and changes score compilation, routing, session preparation, and completion detection.

Changes

Onboarding and profile persistence

Layer / File(s)Summary
Question defaults
packages/app-bundle/overlay/packages/schema/src/question.ts, packages/app-bundle/overlay/packages/schema/src/v1/question.ts, packages/app-bundle/overlay/packages/app/src/pages/session/composer/session-question-dock.tsx
Question schemas now support optional text defaults. The question dock uses defaults when cached state is absent.
Profile-backed onboarding
packages/extension/scores/overture/SCORE.md, packages/extension/opencode-plugin/onboarding.ts, packages/extension/opencode-plugin/amicode_tools.ts, packages/extension/substrate/vault_store.ts, packages/extension/test/scores/golden/compile-chained.md, packages/extension/test/scores/overture_*
Overture now collects profile data through fixed stages, persists it to profile.json, supports resume and redo behavior, and records completion with a filesystem marker. Completion materializes merged profile data.
Pulse design skill
packages/extension/skills/design-a-pulse/SKILL.md
A public skill now defines platform selection, system modeling, target selection, formulation, solve execution, and run inspection.

Session routing and score compilation

Layer / File(s)Summary
Session orchestration
packages/extension/src/opencode_config.ts, packages/extension/src/substrate/vault_store.ts, packages/extension/test/scores/prep_integration.test.ts
Onboarding runs as a standalone overture. Later sessions inject routing and copilot content instead of a compiled primary score. State access covers the full Amico directory.
Score compilation and routing
packages/extension/src/scores/compiler.ts, packages/extension/src/scores/router.ts, packages/extension/test/scores/compiler.test.ts, packages/extension/test/scores/golden/compile-score.md, packages/extension/test/scores/golden/router-section.md
Compiled scores use a splice marker and dynamic headings. The router sends pulse requests to design-a-pulse, joins supplied problems to matching workflows, and excludes onboarding cards.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
participant Session
participant Router
participant DesignAPulse
participant AmicoTools
Session->>Router: provide live state and opening request
Router->>DesignAPulse: invoke pulse-design workflow
DesignAPulse->>AmicoTools: record staged choices
DesignAPulse-->>Session: report solve or inspection status
Loading

Suggested reviewers:aarontrowbridge

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch profile-onboarding-bridge

Comment @coderabbitai help to get the list of available commands.

- Expand ENTITY_FIELDS.profile to accept description, research_area,
experiment_kind, scholar, github, custom_link_url, custom_link_label
(previously silently dropped by sanitizePayload)
- Add 'links' stage to overture SCORE: asks for Scholar, GitHub, and
custom link URLs (all optional/skippable)
- Add materializeProfileJson(): on onboarding_completed, replay the
events stream and write identity fields to ~/.amico/profile.json
(additive merge — never clobbers fields already set by inline editor)
- Update amicode_profile tool description to document new fields
- Regenerate golden snapshot
Field mapping (onboarding → profile.json):
name → name, role → role, org → affiliation, research_area → focus,
description → description, scholar → scholar, github → github,
custom_link_url + custom_link_label → custom_link: {url, label}
Part of harmoniqs/opencode#231
The overture (generic researcher onboarding) was chained directly into
the pulse-designer interview, forcing quantum-specific questions on all
users immediately after onboarding. This made no sense for a
domain-neutral product.
Now the overture runs standalone. The pulse-designer (or any domain
interview) starts in a subsequent session via the onset router, only
when the user actively chooses it.
- Remove compileChainedScore/chainManifest usage from routing
- shouldOnboard no longer requires score0 (pulse-designer) to be present
- Update routing test to expect standalone overture behavior
… exists
When onboarding runs on a user who already has a complete profile (all of
name, intent, goals present), the overture now asks 'keep my current
profile' or 'start fresh' before proceeding. Prevents the interview from
skipping all stages and doing nothing useful on a redo.
Partial profiles (resumed sessions) still skip answered stages as before.
The question tool requires an options array with label+description for
choice questions. Clarify the SCORE instruction to explicitly specify
the options format so the agent generates valid tool calls.
When events.jsonl is empty/missing (e.g. the agent wrote the profile via
a different path), the bridge now accepts an optional inline profile
payload so profile.json is still written. This closes the edge case where
redo-onboarding clears events.jsonl but the distiller writes the vault
note from session context.
…ol call
The agent was generating invalid question tool calls (missing options
array) because the instruction format was ambiguous. Now includes the
exact JSON payload so the agent produces a valid choice question.
…e intent
Reorder stages so the identity card fields are collected first:
1. orientation: name → role → affiliation (was just name)
2. links: Scholar, GitHub, custom link (was stage 8, now stage 2)
3. context_seed (unchanged)
4. intent (unchanged)
5-9. goals, research_area, environment, devices, handoff (unchanged)
This ensures the profile dropdown is populated with the core identity
fields early in the interview, and link pills are filled before the
more domain-specific questions.
…g path
The agent was bypassing the events pipeline and writing profile data
directly to vault markdown files. This left events.jsonl empty and
profile.json never got written (the dropdown was blank).
Add an explicit HARD RULE in the SCORE body forbidding any path other
than amicode_profile for recording onboarding answers.
…uestions
The question tool schema requires the 'options' key even for kind:'text'
questions (it can be an empty array but must be present). The agent was
omitting it, causing SchemaError. Updated the protocol instruction to
make this explicit.
…ystem writes
Three issues addressed:
1. Jargon leakage: agent was saying 'vault', 'distiller', 'materialize',
'events pipeline' etc. to users during onboarding. Added strict language
rules that ban all internal/infrastructure terms from user-facing dialogue.
2. Filesystem writes: agent was bypassing amicode_profile and writing directly
to ~/.amico/ files (events.jsonl, vault notes, etc.). Added an absolute
filesystem prohibition — the agent must NEVER write/edit/create any file
under ~/.amico/ during onboarding. The only persistence path is
amicode_profile; if unavailable, nothing is saved (transcript is backup).
3. Tone: rewrote the persona and greeting to be warmer and more conversational.
'Ciao — I'm Amico. Let me get to know you a little so I can be actually
useful from the start.' instead of the transactional 'I'll remember your
setup so we can move fast.'
Also: added tool-unavailability fallback (proceed fresh if amicode_profile
isn't in tool list, never tell user about tool issues).
@jeonghun-jj-lee
jeonghun-jj-leeforce-pushed the profile-onboarding-bridge branch from e4edfc5 to cf607fbCompareAugust 23, 2026 12:22
The overture was drifting off-script — asking about transmon parameters,
generating invalid question calls, and conflating onboarding with the
pulse-designer interview. Root causes:
1. Too many conditional stages (environment, devices, context_seed) gave the
agent room to improvise and branch incorrectly.
2. No explicit scope fence — the agent could see the pulse-designer interview
in the same compiled prompt and sometimes started running it.
3. Free-form guidance ('weave naturally') invited freestyle.
Fix: rewrite to exactly 6 stages with mechanical instructions:
1. orientation (name, role, affiliation)
2. links (scholar, github, custom — all skippable)
3. intent (multi-select)
4. goals (free text)
5. research_area (only if experiments intent — 2 questions)
6. handoff (auto-description + completion marker)
Removed: context_seed (move to a post-onboarding flow), environment, devices
(these are pulse-designer concerns, not profile concerns).
Added a SCOPE FENCE at the top: explicit prohibition on asking about quantum
hardware, Hamiltonians, pulse parameters, etc. Those belong to a different
interview in a different session.
Added a hard STOP fence at the end: after Stage 6, the interview is OVER —
no more questions, no pulse-designer, no suggested next steps beyond 'start
a new session.'
…, not pulse-designer
The compiler was hardcoding '## Pulse-designer interview' as the heading for
ALL compiled scores — including the overture. The agent would see that heading
during onboarding and naturally think it should run a pulse-designer interview.
Fix: compileScore now uses a dynamic heading based on the score id:
- 'overture' → '## Onboarding interview'
- anything else → '## Pulse-designer interview'
Also: added a hidden HTML comment marker (SPLICE_MARKER) so spliceIntoAgentsMd
can locate the section reliably regardless of heading text. Falls back to the
legacy heading for backward compat.
…demand only
The full pulse-designer interview (270 lines of quantum-specific protocol)
was being compiled into EVERY post-onboarding session's AGENTS.md. This
polluted the context for general users and caused the agent to proactively
start pulse-design interviews even when users just wanted to code.
Now: post-onboarding sessions get only the onset router + a minimal stub
that says 'you are a general-purpose autoresearch copilot, do NOT start
domain interviews unless explicitly asked.' The pulse-design workflow is
still available on-demand via the skill system (transmon, atoms, bosonic,
etc.) when the user asks for it.
Also updated the onset router to remove pulse-designer-centric framing:
- Removed the SYSTEM_FIRST_SCORE constant
- 'Design a new pulse' is now described generically (invoke platform skill)
- Router language no longer references 'the interview below'
…mand content
Created skills/design-a-pulse/SKILL.md: the orchestration guide for walking
a user through pulse design (platform → model → formulation → solve → inspect).
It's a thin coordination layer that tells the agent which platform skills to
invoke (transmon, atoms, bosonic, etc.) and what stages to follow.
This replaces the old approach of compiling the full pulse-designer SCORE body
into every session's system prompt. Now it loads on-demand when the user asks
to design a pulse, keeping general sessions lean.
Also updated the onset router to reference the skill by name:
'invoke the design-a-pulse skill for the guided interview.'
Two issues fixed:
1. The amicode_profile plugin tool wasn't loading (the local-built opencode
binary silently failed to import it), so the onboarding agent had no way
to persist answers. Fix: the SCORE now instructs the agent to write
~/.amico/profile.json directly using standard file tools. The plugin tool
is nice-to-have for analytics but no longer the critical path.
2. The link questions (Scholar, GitHub, custom) didn't pre-fill with 'skip',
forcing users to type it. Fix: added `default` field support to the
question schema overlay + UI initialization from it, and the SCORE now
passes `default: "skip"` on each link question.
Changes:
- Grant ~/.amico/** in external_directory permissions (subsumes library,
problems, onboarding — all already under ~/.amico)
- SCORE rewritten: reads/writes ~/.amico/profile.json directly; completion
marker is now a file (~/.amico/amicode/onboarding/completed)
- hasOnboardingCompleted() checks for both the new file marker and the
legacy events.jsonl marker
- QuestionV2 schema overlay + SDK types: added optional `default` field
- session-question-dock.tsx: initializes text input from question.default
- Tests updated to match new SCORE content
@jeonghun-jj-lee
jeonghun-jj-lee marked this pull request as ready for review August 23, 2026 13:50
@jeonghun-jj-lee
jeonghun-jj-lee merged commit 85925d8 into mainAug 23, 2026
7 of 8 checks passed
aarontrowbridge added a commit that referenced this pull request Aug 23, 2026
…#513 drift break) (#531)
* fix(app-bundle): re-extract overlay at fork v1.18.10-amicode.16
Repairs the #513 drift-gate break on main: the overlay hand-edit is
superseded by the fork's canonical question-default implementation
(opencode#232, included in the .16 tag). 80 files added, 63 changed —
the full UI wave (workspace engine, retheme, status-dot semantics,
theme fixes). Round-trip verified: all 502 files byte-identical to the
tag; drift gate PASS.
Closes#530. Fork tag tracked by harmoniqs/opencode#238.
* fix(vendor): pin opencode binary to v1.18.10-amicode.16
Aligns the vendored binary with the app-bundle overlay pin and the
frozen server binary (same fork revision, 77bb1c8b7). Asset hashes
recorded from the release.
* test(goldens): re-record amicode service fixtures at the .16 pin
The contract suite's self-tracking check caught the pin bump — goldens
re-recorded via scripts/record_amicode_fixtures.mjs (71 entries).
* fix(widgets): sync builtin widget sources to the fork's .16 re-theme
The parity suite caught the pin bump's second-order effect: the fork's
re-theme wave (opencode#235) restyled all seven builtin widgets; the
extension's copies lagged. Synced verbatim from the fork's
widgets-src — the fork binary is the parity source of truth.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hitlNeeds human decision or review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@jeonghun-jj-lee
, '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

feat(onboarding): add links stage + bridge onboarding to profile.json - #513

Merged
jeonghun-jj-lee merged 15 commits into
mainfrom
profile-onboarding-bridge
Aug 23, 2026
Merged

feat(onboarding): add links stage + bridge onboarding to profile.json#513
jeonghun-jj-lee merged 15 commits into
mainfrom
profile-onboarding-bridge

Conversation

@jeonghun-jj-lee

@jeonghun-jj-leejeonghun-jj-lee commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Part of harmoniqs/opencode#231

Bridges onboarding data into ~/.amico/profile.json so the new profile dropdown popover (opencode PR #234) is populated immediately after onboarding completes.

Changes

  • ENTITY_FIELDS expandeddescription, research_area, experiment_kind, scholar, github, custom_link_url, custom_link_label no longer silently dropped by sanitizePayload
  • Links stage — new optional stage in the overture asking for Scholar, GitHub, and custom link URLs
  • materializeProfileJson() — on onboarding_completed, replays events stream and writes identity fields to profile.json (additive merge, never clobbers inline edits)
  • Tool description updated — documents all accepted profile fields

Summary by CodeRabbit

  • New Features

    • Added guided pulse-design workflow covering platform selection, modeling, targets, solving, and result review.
    • Onboarding now collects research and profile details, including affiliations and links.
    • Completed onboarding information is saved to the local profile for future sessions.
    • Added editable pre-filled values for text questions.
  • Improvements

    • Improved onboarding resume and completion detection.
    • Updated routing so pulse design and user-provided problems start the appropriate workflow directly.
    • Expanded profile documentation and supported fields.

@jeonghun-jj-leejeonghun-jj-lee added the hitl Needs human decision or review label Aug 23, 2026
@coderabbitai

coderabbitaiBot commented Aug 23, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d7d3fe9e-c9f9-4c1d-a305-5676a5a07fab

📥 Commits

Reviewing files that changed from the base of the PR and between 5011b9b and 16a8afe.

⛔ Files ignored due to path filters (1)
  • packages/app-bundle/overlay/packages/sdk/js/src/v2/gen/types.gen.ts is excluded by !**/gen/**
📒 Files selected for processing (18)
  • packages/app-bundle/overlay/packages/app/src/pages/session/composer/session-question-dock.tsx
  • packages/app-bundle/overlay/packages/schema/src/question.ts
  • packages/app-bundle/overlay/packages/schema/src/v1/question.ts
  • packages/extension/opencode-plugin/amicode_tools.ts
  • packages/extension/opencode-plugin/onboarding.ts
  • packages/extension/scores/overture/SCORE.md
  • packages/extension/skills/design-a-pulse/SKILL.md
  • packages/extension/src/opencode_config.ts
  • packages/extension/src/scores/compiler.ts
  • packages/extension/src/scores/router.ts
  • packages/extension/src/substrate/vault_store.ts
  • packages/extension/test/scores/compiler.test.ts
  • packages/extension/test/scores/golden/compile-chained.md
  • packages/extension/test/scores/golden/compile-score.md
  • packages/extension/test/scores/golden/router-section.md
  • packages/extension/test/scores/overture_rewrite.test.ts
  • packages/extension/test/scores/overture_routing.test.ts
  • packages/extension/test/scores/prep_integration.test.ts

📝 Walkthrough

Walkthrough

The PR adds text-question defaults, rewrites overture onboarding around profile.json and filesystem completion markers, introduces the public design-a-pulse skill, and changes score compilation, routing, session preparation, and completion detection.

Changes

Onboarding and profile persistence

Layer / File(s)Summary
Question defaults
packages/app-bundle/overlay/packages/schema/src/question.ts, packages/app-bundle/overlay/packages/schema/src/v1/question.ts, packages/app-bundle/overlay/packages/app/src/pages/session/composer/session-question-dock.tsx
Question schemas now support optional text defaults. The question dock uses defaults when cached state is absent.
Profile-backed onboarding
packages/extension/scores/overture/SCORE.md, packages/extension/opencode-plugin/onboarding.ts, packages/extension/opencode-plugin/amicode_tools.ts, packages/extension/substrate/vault_store.ts, packages/extension/test/scores/golden/compile-chained.md, packages/extension/test/scores/overture_*
Overture now collects profile data through fixed stages, persists it to profile.json, supports resume and redo behavior, and records completion with a filesystem marker. Completion materializes merged profile data.
Pulse design skill
packages/extension/skills/design-a-pulse/SKILL.md
A public skill now defines platform selection, system modeling, target selection, formulation, solve execution, and run inspection.

Session routing and score compilation

Layer / File(s)Summary
Session orchestration
packages/extension/src/opencode_config.ts, packages/extension/src/substrate/vault_store.ts, packages/extension/test/scores/prep_integration.test.ts
Onboarding runs as a standalone overture. Later sessions inject routing and copilot content instead of a compiled primary score. State access covers the full Amico directory.
Score compilation and routing
packages/extension/src/scores/compiler.ts, packages/extension/src/scores/router.ts, packages/extension/test/scores/compiler.test.ts, packages/extension/test/scores/golden/compile-score.md, packages/extension/test/scores/golden/router-section.md
Compiled scores use a splice marker and dynamic headings. The router sends pulse requests to design-a-pulse, joins supplied problems to matching workflows, and excludes onboarding cards.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
participant Session
participant Router
participant DesignAPulse
participant AmicoTools
Session->>Router: provide live state and opening request
Router->>DesignAPulse: invoke pulse-design workflow
DesignAPulse->>AmicoTools: record staged choices
DesignAPulse-->>Session: report solve or inspection status
Loading

Suggested reviewers:aarontrowbridge

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch profile-onboarding-bridge

Comment @coderabbitai help to get the list of available commands.

- Expand ENTITY_FIELDS.profile to accept description, research_area,
experiment_kind, scholar, github, custom_link_url, custom_link_label
(previously silently dropped by sanitizePayload)
- Add 'links' stage to overture SCORE: asks for Scholar, GitHub, and
custom link URLs (all optional/skippable)
- Add materializeProfileJson(): on onboarding_completed, replay the
events stream and write identity fields to ~/.amico/profile.json
(additive merge — never clobbers fields already set by inline editor)
- Update amicode_profile tool description to document new fields
- Regenerate golden snapshot
Field mapping (onboarding → profile.json):
name → name, role → role, org → affiliation, research_area → focus,
description → description, scholar → scholar, github → github,
custom_link_url + custom_link_label → custom_link: {url, label}
Part of harmoniqs/opencode#231
The overture (generic researcher onboarding) was chained directly into
the pulse-designer interview, forcing quantum-specific questions on all
users immediately after onboarding. This made no sense for a
domain-neutral product.
Now the overture runs standalone. The pulse-designer (or any domain
interview) starts in a subsequent session via the onset router, only
when the user actively chooses it.
- Remove compileChainedScore/chainManifest usage from routing
- shouldOnboard no longer requires score0 (pulse-designer) to be present
- Update routing test to expect standalone overture behavior
… exists
When onboarding runs on a user who already has a complete profile (all of
name, intent, goals present), the overture now asks 'keep my current
profile' or 'start fresh' before proceeding. Prevents the interview from
skipping all stages and doing nothing useful on a redo.
Partial profiles (resumed sessions) still skip answered stages as before.
The question tool requires an options array with label+description for
choice questions. Clarify the SCORE instruction to explicitly specify
the options format so the agent generates valid tool calls.
When events.jsonl is empty/missing (e.g. the agent wrote the profile via
a different path), the bridge now accepts an optional inline profile
payload so profile.json is still written. This closes the edge case where
redo-onboarding clears events.jsonl but the distiller writes the vault
note from session context.
…ol call
The agent was generating invalid question tool calls (missing options
array) because the instruction format was ambiguous. Now includes the
exact JSON payload so the agent produces a valid choice question.
…e intent
Reorder stages so the identity card fields are collected first:
1. orientation: name → role → affiliation (was just name)
2. links: Scholar, GitHub, custom link (was stage 8, now stage 2)
3. context_seed (unchanged)
4. intent (unchanged)
5-9. goals, research_area, environment, devices, handoff (unchanged)
This ensures the profile dropdown is populated with the core identity
fields early in the interview, and link pills are filled before the
more domain-specific questions.
…g path
The agent was bypassing the events pipeline and writing profile data
directly to vault markdown files. This left events.jsonl empty and
profile.json never got written (the dropdown was blank).
Add an explicit HARD RULE in the SCORE body forbidding any path other
than amicode_profile for recording onboarding answers.
…uestions
The question tool schema requires the 'options' key even for kind:'text'
questions (it can be an empty array but must be present). The agent was
omitting it, causing SchemaError. Updated the protocol instruction to
make this explicit.
…ystem writes
Three issues addressed:
1. Jargon leakage: agent was saying 'vault', 'distiller', 'materialize',
'events pipeline' etc. to users during onboarding. Added strict language
rules that ban all internal/infrastructure terms from user-facing dialogue.
2. Filesystem writes: agent was bypassing amicode_profile and writing directly
to ~/.amico/ files (events.jsonl, vault notes, etc.). Added an absolute
filesystem prohibition — the agent must NEVER write/edit/create any file
under ~/.amico/ during onboarding. The only persistence path is
amicode_profile; if unavailable, nothing is saved (transcript is backup).
3. Tone: rewrote the persona and greeting to be warmer and more conversational.
'Ciao — I'm Amico. Let me get to know you a little so I can be actually
useful from the start.' instead of the transactional 'I'll remember your
setup so we can move fast.'
Also: added tool-unavailability fallback (proceed fresh if amicode_profile
isn't in tool list, never tell user about tool issues).
@jeonghun-jj-lee
jeonghun-jj-leeforce-pushed the profile-onboarding-bridge branch from e4edfc5 to cf607fbCompareAugust 23, 2026 12:22
The overture was drifting off-script — asking about transmon parameters,
generating invalid question calls, and conflating onboarding with the
pulse-designer interview. Root causes:
1. Too many conditional stages (environment, devices, context_seed) gave the
agent room to improvise and branch incorrectly.
2. No explicit scope fence — the agent could see the pulse-designer interview
in the same compiled prompt and sometimes started running it.
3. Free-form guidance ('weave naturally') invited freestyle.
Fix: rewrite to exactly 6 stages with mechanical instructions:
1. orientation (name, role, affiliation)
2. links (scholar, github, custom — all skippable)
3. intent (multi-select)
4. goals (free text)
5. research_area (only if experiments intent — 2 questions)
6. handoff (auto-description + completion marker)
Removed: context_seed (move to a post-onboarding flow), environment, devices
(these are pulse-designer concerns, not profile concerns).
Added a SCOPE FENCE at the top: explicit prohibition on asking about quantum
hardware, Hamiltonians, pulse parameters, etc. Those belong to a different
interview in a different session.
Added a hard STOP fence at the end: after Stage 6, the interview is OVER —
no more questions, no pulse-designer, no suggested next steps beyond 'start
a new session.'
…, not pulse-designer
The compiler was hardcoding '## Pulse-designer interview' as the heading for
ALL compiled scores — including the overture. The agent would see that heading
during onboarding and naturally think it should run a pulse-designer interview.
Fix: compileScore now uses a dynamic heading based on the score id:
- 'overture' → '## Onboarding interview'
- anything else → '## Pulse-designer interview'
Also: added a hidden HTML comment marker (SPLICE_MARKER) so spliceIntoAgentsMd
can locate the section reliably regardless of heading text. Falls back to the
legacy heading for backward compat.
…demand only
The full pulse-designer interview (270 lines of quantum-specific protocol)
was being compiled into EVERY post-onboarding session's AGENTS.md. This
polluted the context for general users and caused the agent to proactively
start pulse-design interviews even when users just wanted to code.
Now: post-onboarding sessions get only the onset router + a minimal stub
that says 'you are a general-purpose autoresearch copilot, do NOT start
domain interviews unless explicitly asked.' The pulse-design workflow is
still available on-demand via the skill system (transmon, atoms, bosonic,
etc.) when the user asks for it.
Also updated the onset router to remove pulse-designer-centric framing:
- Removed the SYSTEM_FIRST_SCORE constant
- 'Design a new pulse' is now described generically (invoke platform skill)
- Router language no longer references 'the interview below'
…mand content
Created skills/design-a-pulse/SKILL.md: the orchestration guide for walking
a user through pulse design (platform → model → formulation → solve → inspect).
It's a thin coordination layer that tells the agent which platform skills to
invoke (transmon, atoms, bosonic, etc.) and what stages to follow.
This replaces the old approach of compiling the full pulse-designer SCORE body
into every session's system prompt. Now it loads on-demand when the user asks
to design a pulse, keeping general sessions lean.
Also updated the onset router to reference the skill by name:
'invoke the design-a-pulse skill for the guided interview.'
Two issues fixed:
1. The amicode_profile plugin tool wasn't loading (the local-built opencode
binary silently failed to import it), so the onboarding agent had no way
to persist answers. Fix: the SCORE now instructs the agent to write
~/.amico/profile.json directly using standard file tools. The plugin tool
is nice-to-have for analytics but no longer the critical path.
2. The link questions (Scholar, GitHub, custom) didn't pre-fill with 'skip',
forcing users to type it. Fix: added `default` field support to the
question schema overlay + UI initialization from it, and the SCORE now
passes `default: "skip"` on each link question.
Changes:
- Grant ~/.amico/** in external_directory permissions (subsumes library,
problems, onboarding — all already under ~/.amico)
- SCORE rewritten: reads/writes ~/.amico/profile.json directly; completion
marker is now a file (~/.amico/amicode/onboarding/completed)
- hasOnboardingCompleted() checks for both the new file marker and the
legacy events.jsonl marker
- QuestionV2 schema overlay + SDK types: added optional `default` field
- session-question-dock.tsx: initializes text input from question.default
- Tests updated to match new SCORE content
@jeonghun-jj-lee
jeonghun-jj-lee marked this pull request as ready for review August 23, 2026 13:50
@jeonghun-jj-lee
jeonghun-jj-lee merged commit 85925d8 into mainAug 23, 2026
7 of 8 checks passed
aarontrowbridge added a commit that referenced this pull request Aug 23, 2026
…#513 drift break) (#531)
* fix(app-bundle): re-extract overlay at fork v1.18.10-amicode.16
Repairs the #513 drift-gate break on main: the overlay hand-edit is
superseded by the fork's canonical question-default implementation
(opencode#232, included in the .16 tag). 80 files added, 63 changed —
the full UI wave (workspace engine, retheme, status-dot semantics,
theme fixes). Round-trip verified: all 502 files byte-identical to the
tag; drift gate PASS.
Closes#530. Fork tag tracked by harmoniqs/opencode#238.
* fix(vendor): pin opencode binary to v1.18.10-amicode.16
Aligns the vendored binary with the app-bundle overlay pin and the
frozen server binary (same fork revision, 77bb1c8b7). Asset hashes
recorded from the release.
* test(goldens): re-record amicode service fixtures at the .16 pin
The contract suite's self-tracking check caught the pin bump — goldens
re-recorded via scripts/record_amicode_fixtures.mjs (71 entries).
* fix(widgets): sync builtin widget sources to the fork's .16 re-theme
The parity suite caught the pin bump's second-order effect: the fork's
re-theme wave (opencode#235) restyled all seven builtin widgets; the
extension's copies lagged. Synced verbatim from the fork's
widgets-src — the fork binary is the parity source of truth.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hitlNeeds human decision or review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@jeonghun-jj-lee
, '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

feat(onboarding): add links stage + bridge onboarding to profile.json - #513

Merged
jeonghun-jj-lee merged 15 commits into
mainfrom
profile-onboarding-bridge
Aug 23, 2026
Merged

feat(onboarding): add links stage + bridge onboarding to profile.json#513
jeonghun-jj-lee merged 15 commits into
mainfrom
profile-onboarding-bridge

Conversation

@jeonghun-jj-lee

@jeonghun-jj-leejeonghun-jj-lee commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Part of harmoniqs/opencode#231

Bridges onboarding data into ~/.amico/profile.json so the new profile dropdown popover (opencode PR #234) is populated immediately after onboarding completes.

Changes

  • ENTITY_FIELDS expandeddescription, research_area, experiment_kind, scholar, github, custom_link_url, custom_link_label no longer silently dropped by sanitizePayload
  • Links stage — new optional stage in the overture asking for Scholar, GitHub, and custom link URLs
  • materializeProfileJson() — on onboarding_completed, replays events stream and writes identity fields to profile.json (additive merge, never clobbers inline edits)
  • Tool description updated — documents all accepted profile fields

Summary by CodeRabbit

  • New Features

    • Added guided pulse-design workflow covering platform selection, modeling, targets, solving, and result review.
    • Onboarding now collects research and profile details, including affiliations and links.
    • Completed onboarding information is saved to the local profile for future sessions.
    • Added editable pre-filled values for text questions.
  • Improvements

    • Improved onboarding resume and completion detection.
    • Updated routing so pulse design and user-provided problems start the appropriate workflow directly.
    • Expanded profile documentation and supported fields.

@jeonghun-jj-leejeonghun-jj-lee added the hitl Needs human decision or review label Aug 23, 2026
@coderabbitai

coderabbitaiBot commented Aug 23, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d7d3fe9e-c9f9-4c1d-a305-5676a5a07fab

📥 Commits

Reviewing files that changed from the base of the PR and between 5011b9b and 16a8afe.

⛔ Files ignored due to path filters (1)
  • packages/app-bundle/overlay/packages/sdk/js/src/v2/gen/types.gen.ts is excluded by !**/gen/**
📒 Files selected for processing (18)
  • packages/app-bundle/overlay/packages/app/src/pages/session/composer/session-question-dock.tsx
  • packages/app-bundle/overlay/packages/schema/src/question.ts
  • packages/app-bundle/overlay/packages/schema/src/v1/question.ts
  • packages/extension/opencode-plugin/amicode_tools.ts
  • packages/extension/opencode-plugin/onboarding.ts
  • packages/extension/scores/overture/SCORE.md
  • packages/extension/skills/design-a-pulse/SKILL.md
  • packages/extension/src/opencode_config.ts
  • packages/extension/src/scores/compiler.ts
  • packages/extension/src/scores/router.ts
  • packages/extension/src/substrate/vault_store.ts
  • packages/extension/test/scores/compiler.test.ts
  • packages/extension/test/scores/golden/compile-chained.md
  • packages/extension/test/scores/golden/compile-score.md
  • packages/extension/test/scores/golden/router-section.md
  • packages/extension/test/scores/overture_rewrite.test.ts
  • packages/extension/test/scores/overture_routing.test.ts
  • packages/extension/test/scores/prep_integration.test.ts

📝 Walkthrough

Walkthrough

The PR adds text-question defaults, rewrites overture onboarding around profile.json and filesystem completion markers, introduces the public design-a-pulse skill, and changes score compilation, routing, session preparation, and completion detection.

Changes

Onboarding and profile persistence

Layer / File(s)Summary
Question defaults
packages/app-bundle/overlay/packages/schema/src/question.ts, packages/app-bundle/overlay/packages/schema/src/v1/question.ts, packages/app-bundle/overlay/packages/app/src/pages/session/composer/session-question-dock.tsx
Question schemas now support optional text defaults. The question dock uses defaults when cached state is absent.
Profile-backed onboarding
packages/extension/scores/overture/SCORE.md, packages/extension/opencode-plugin/onboarding.ts, packages/extension/opencode-plugin/amicode_tools.ts, packages/extension/substrate/vault_store.ts, packages/extension/test/scores/golden/compile-chained.md, packages/extension/test/scores/overture_*
Overture now collects profile data through fixed stages, persists it to profile.json, supports resume and redo behavior, and records completion with a filesystem marker. Completion materializes merged profile data.
Pulse design skill
packages/extension/skills/design-a-pulse/SKILL.md
A public skill now defines platform selection, system modeling, target selection, formulation, solve execution, and run inspection.

Session routing and score compilation

Layer / File(s)Summary
Session orchestration
packages/extension/src/opencode_config.ts, packages/extension/src/substrate/vault_store.ts, packages/extension/test/scores/prep_integration.test.ts
Onboarding runs as a standalone overture. Later sessions inject routing and copilot content instead of a compiled primary score. State access covers the full Amico directory.
Score compilation and routing
packages/extension/src/scores/compiler.ts, packages/extension/src/scores/router.ts, packages/extension/test/scores/compiler.test.ts, packages/extension/test/scores/golden/compile-score.md, packages/extension/test/scores/golden/router-section.md
Compiled scores use a splice marker and dynamic headings. The router sends pulse requests to design-a-pulse, joins supplied problems to matching workflows, and excludes onboarding cards.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
participant Session
participant Router
participant DesignAPulse
participant AmicoTools
Session->>Router: provide live state and opening request
Router->>DesignAPulse: invoke pulse-design workflow
DesignAPulse->>AmicoTools: record staged choices
DesignAPulse-->>Session: report solve or inspection status
Loading

Suggested reviewers:aarontrowbridge

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch profile-onboarding-bridge

Comment @coderabbitai help to get the list of available commands.

- Expand ENTITY_FIELDS.profile to accept description, research_area,
experiment_kind, scholar, github, custom_link_url, custom_link_label
(previously silently dropped by sanitizePayload)
- Add 'links' stage to overture SCORE: asks for Scholar, GitHub, and
custom link URLs (all optional/skippable)
- Add materializeProfileJson(): on onboarding_completed, replay the
events stream and write identity fields to ~/.amico/profile.json
(additive merge — never clobbers fields already set by inline editor)
- Update amicode_profile tool description to document new fields
- Regenerate golden snapshot
Field mapping (onboarding → profile.json):
name → name, role → role, org → affiliation, research_area → focus,
description → description, scholar → scholar, github → github,
custom_link_url + custom_link_label → custom_link: {url, label}
Part of harmoniqs/opencode#231
The overture (generic researcher onboarding) was chained directly into
the pulse-designer interview, forcing quantum-specific questions on all
users immediately after onboarding. This made no sense for a
domain-neutral product.
Now the overture runs standalone. The pulse-designer (or any domain
interview) starts in a subsequent session via the onset router, only
when the user actively chooses it.
- Remove compileChainedScore/chainManifest usage from routing
- shouldOnboard no longer requires score0 (pulse-designer) to be present
- Update routing test to expect standalone overture behavior
… exists
When onboarding runs on a user who already has a complete profile (all of
name, intent, goals present), the overture now asks 'keep my current
profile' or 'start fresh' before proceeding. Prevents the interview from
skipping all stages and doing nothing useful on a redo.
Partial profiles (resumed sessions) still skip answered stages as before.
The question tool requires an options array with label+description for
choice questions. Clarify the SCORE instruction to explicitly specify
the options format so the agent generates valid tool calls.
When events.jsonl is empty/missing (e.g. the agent wrote the profile via
a different path), the bridge now accepts an optional inline profile
payload so profile.json is still written. This closes the edge case where
redo-onboarding clears events.jsonl but the distiller writes the vault
note from session context.
…ol call
The agent was generating invalid question tool calls (missing options
array) because the instruction format was ambiguous. Now includes the
exact JSON payload so the agent produces a valid choice question.
…e intent
Reorder stages so the identity card fields are collected first:
1. orientation: name → role → affiliation (was just name)
2. links: Scholar, GitHub, custom link (was stage 8, now stage 2)
3. context_seed (unchanged)
4. intent (unchanged)
5-9. goals, research_area, environment, devices, handoff (unchanged)
This ensures the profile dropdown is populated with the core identity
fields early in the interview, and link pills are filled before the
more domain-specific questions.
…g path
The agent was bypassing the events pipeline and writing profile data
directly to vault markdown files. This left events.jsonl empty and
profile.json never got written (the dropdown was blank).
Add an explicit HARD RULE in the SCORE body forbidding any path other
than amicode_profile for recording onboarding answers.
…uestions
The question tool schema requires the 'options' key even for kind:'text'
questions (it can be an empty array but must be present). The agent was
omitting it, causing SchemaError. Updated the protocol instruction to
make this explicit.
…ystem writes
Three issues addressed:
1. Jargon leakage: agent was saying 'vault', 'distiller', 'materialize',
'events pipeline' etc. to users during onboarding. Added strict language
rules that ban all internal/infrastructure terms from user-facing dialogue.
2. Filesystem writes: agent was bypassing amicode_profile and writing directly
to ~/.amico/ files (events.jsonl, vault notes, etc.). Added an absolute
filesystem prohibition — the agent must NEVER write/edit/create any file
under ~/.amico/ during onboarding. The only persistence path is
amicode_profile; if unavailable, nothing is saved (transcript is backup).
3. Tone: rewrote the persona and greeting to be warmer and more conversational.
'Ciao — I'm Amico. Let me get to know you a little so I can be actually
useful from the start.' instead of the transactional 'I'll remember your
setup so we can move fast.'
Also: added tool-unavailability fallback (proceed fresh if amicode_profile
isn't in tool list, never tell user about tool issues).
@jeonghun-jj-lee
jeonghun-jj-leeforce-pushed the profile-onboarding-bridge branch from e4edfc5 to cf607fbCompareAugust 23, 2026 12:22
The overture was drifting off-script — asking about transmon parameters,
generating invalid question calls, and conflating onboarding with the
pulse-designer interview. Root causes:
1. Too many conditional stages (environment, devices, context_seed) gave the
agent room to improvise and branch incorrectly.
2. No explicit scope fence — the agent could see the pulse-designer interview
in the same compiled prompt and sometimes started running it.
3. Free-form guidance ('weave naturally') invited freestyle.
Fix: rewrite to exactly 6 stages with mechanical instructions:
1. orientation (name, role, affiliation)
2. links (scholar, github, custom — all skippable)
3. intent (multi-select)
4. goals (free text)
5. research_area (only if experiments intent — 2 questions)
6. handoff (auto-description + completion marker)
Removed: context_seed (move to a post-onboarding flow), environment, devices
(these are pulse-designer concerns, not profile concerns).
Added a SCOPE FENCE at the top: explicit prohibition on asking about quantum
hardware, Hamiltonians, pulse parameters, etc. Those belong to a different
interview in a different session.
Added a hard STOP fence at the end: after Stage 6, the interview is OVER —
no more questions, no pulse-designer, no suggested next steps beyond 'start
a new session.'
…, not pulse-designer
The compiler was hardcoding '## Pulse-designer interview' as the heading for
ALL compiled scores — including the overture. The agent would see that heading
during onboarding and naturally think it should run a pulse-designer interview.
Fix: compileScore now uses a dynamic heading based on the score id:
- 'overture' → '## Onboarding interview'
- anything else → '## Pulse-designer interview'
Also: added a hidden HTML comment marker (SPLICE_MARKER) so spliceIntoAgentsMd
can locate the section reliably regardless of heading text. Falls back to the
legacy heading for backward compat.
…demand only
The full pulse-designer interview (270 lines of quantum-specific protocol)
was being compiled into EVERY post-onboarding session's AGENTS.md. This
polluted the context for general users and caused the agent to proactively
start pulse-design interviews even when users just wanted to code.
Now: post-onboarding sessions get only the onset router + a minimal stub
that says 'you are a general-purpose autoresearch copilot, do NOT start
domain interviews unless explicitly asked.' The pulse-design workflow is
still available on-demand via the skill system (transmon, atoms, bosonic,
etc.) when the user asks for it.
Also updated the onset router to remove pulse-designer-centric framing:
- Removed the SYSTEM_FIRST_SCORE constant
- 'Design a new pulse' is now described generically (invoke platform skill)
- Router language no longer references 'the interview below'
…mand content
Created skills/design-a-pulse/SKILL.md: the orchestration guide for walking
a user through pulse design (platform → model → formulation → solve → inspect).
It's a thin coordination layer that tells the agent which platform skills to
invoke (transmon, atoms, bosonic, etc.) and what stages to follow.
This replaces the old approach of compiling the full pulse-designer SCORE body
into every session's system prompt. Now it loads on-demand when the user asks
to design a pulse, keeping general sessions lean.
Also updated the onset router to reference the skill by name:
'invoke the design-a-pulse skill for the guided interview.'
Two issues fixed:
1. The amicode_profile plugin tool wasn't loading (the local-built opencode
binary silently failed to import it), so the onboarding agent had no way
to persist answers. Fix: the SCORE now instructs the agent to write
~/.amico/profile.json directly using standard file tools. The plugin tool
is nice-to-have for analytics but no longer the critical path.
2. The link questions (Scholar, GitHub, custom) didn't pre-fill with 'skip',
forcing users to type it. Fix: added `default` field support to the
question schema overlay + UI initialization from it, and the SCORE now
passes `default: "skip"` on each link question.
Changes:
- Grant ~/.amico/** in external_directory permissions (subsumes library,
problems, onboarding — all already under ~/.amico)
- SCORE rewritten: reads/writes ~/.amico/profile.json directly; completion
marker is now a file (~/.amico/amicode/onboarding/completed)
- hasOnboardingCompleted() checks for both the new file marker and the
legacy events.jsonl marker
- QuestionV2 schema overlay + SDK types: added optional `default` field
- session-question-dock.tsx: initializes text input from question.default
- Tests updated to match new SCORE content
@jeonghun-jj-lee
jeonghun-jj-lee marked this pull request as ready for review August 23, 2026 13:50
@jeonghun-jj-lee
jeonghun-jj-lee merged commit 85925d8 into mainAug 23, 2026
7 of 8 checks passed
aarontrowbridge added a commit that referenced this pull request Aug 23, 2026
…#513 drift break) (#531)
* fix(app-bundle): re-extract overlay at fork v1.18.10-amicode.16
Repairs the #513 drift-gate break on main: the overlay hand-edit is
superseded by the fork's canonical question-default implementation
(opencode#232, included in the .16 tag). 80 files added, 63 changed —
the full UI wave (workspace engine, retheme, status-dot semantics,
theme fixes). Round-trip verified: all 502 files byte-identical to the
tag; drift gate PASS.
Closes#530. Fork tag tracked by harmoniqs/opencode#238.
* fix(vendor): pin opencode binary to v1.18.10-amicode.16
Aligns the vendored binary with the app-bundle overlay pin and the
frozen server binary (same fork revision, 77bb1c8b7). Asset hashes
recorded from the release.
* test(goldens): re-record amicode service fixtures at the .16 pin
The contract suite's self-tracking check caught the pin bump — goldens
re-recorded via scripts/record_amicode_fixtures.mjs (71 entries).
* fix(widgets): sync builtin widget sources to the fork's .16 re-theme
The parity suite caught the pin bump's second-order effect: the fork's
re-theme wave (opencode#235) restyled all seven builtin widgets; the
extension's copies lagged. Synced verbatim from the fork's
widgets-src — the fork binary is the parity source of truth.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hitlNeeds human decision or review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@jeonghun-jj-lee
, '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

feat(onboarding): add links stage + bridge onboarding to profile.json - #513

Merged
jeonghun-jj-lee merged 15 commits into
mainfrom
profile-onboarding-bridge
Aug 23, 2026
Merged

feat(onboarding): add links stage + bridge onboarding to profile.json#513
jeonghun-jj-lee merged 15 commits into
mainfrom
profile-onboarding-bridge

Conversation

@jeonghun-jj-lee

@jeonghun-jj-leejeonghun-jj-lee commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Part of harmoniqs/opencode#231

Bridges onboarding data into ~/.amico/profile.json so the new profile dropdown popover (opencode PR #234) is populated immediately after onboarding completes.

Changes

  • ENTITY_FIELDS expandeddescription, research_area, experiment_kind, scholar, github, custom_link_url, custom_link_label no longer silently dropped by sanitizePayload
  • Links stage — new optional stage in the overture asking for Scholar, GitHub, and custom link URLs
  • materializeProfileJson() — on onboarding_completed, replays events stream and writes identity fields to profile.json (additive merge, never clobbers inline edits)
  • Tool description updated — documents all accepted profile fields

Summary by CodeRabbit

  • New Features

    • Added guided pulse-design workflow covering platform selection, modeling, targets, solving, and result review.
    • Onboarding now collects research and profile details, including affiliations and links.
    • Completed onboarding information is saved to the local profile for future sessions.
    • Added editable pre-filled values for text questions.
  • Improvements

    • Improved onboarding resume and completion detection.
    • Updated routing so pulse design and user-provided problems start the appropriate workflow directly.
    • Expanded profile documentation and supported fields.

@jeonghun-jj-leejeonghun-jj-lee added the hitl Needs human decision or review label Aug 23, 2026
@coderabbitai

coderabbitaiBot commented Aug 23, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d7d3fe9e-c9f9-4c1d-a305-5676a5a07fab

📥 Commits

Reviewing files that changed from the base of the PR and between 5011b9b and 16a8afe.

⛔ Files ignored due to path filters (1)
  • packages/app-bundle/overlay/packages/sdk/js/src/v2/gen/types.gen.ts is excluded by !**/gen/**
📒 Files selected for processing (18)
  • packages/app-bundle/overlay/packages/app/src/pages/session/composer/session-question-dock.tsx
  • packages/app-bundle/overlay/packages/schema/src/question.ts
  • packages/app-bundle/overlay/packages/schema/src/v1/question.ts
  • packages/extension/opencode-plugin/amicode_tools.ts
  • packages/extension/opencode-plugin/onboarding.ts
  • packages/extension/scores/overture/SCORE.md
  • packages/extension/skills/design-a-pulse/SKILL.md
  • packages/extension/src/opencode_config.ts
  • packages/extension/src/scores/compiler.ts
  • packages/extension/src/scores/router.ts
  • packages/extension/src/substrate/vault_store.ts
  • packages/extension/test/scores/compiler.test.ts
  • packages/extension/test/scores/golden/compile-chained.md
  • packages/extension/test/scores/golden/compile-score.md
  • packages/extension/test/scores/golden/router-section.md
  • packages/extension/test/scores/overture_rewrite.test.ts
  • packages/extension/test/scores/overture_routing.test.ts
  • packages/extension/test/scores/prep_integration.test.ts

📝 Walkthrough

Walkthrough

The PR adds text-question defaults, rewrites overture onboarding around profile.json and filesystem completion markers, introduces the public design-a-pulse skill, and changes score compilation, routing, session preparation, and completion detection.

Changes

Onboarding and profile persistence

Layer / File(s)Summary
Question defaults
packages/app-bundle/overlay/packages/schema/src/question.ts, packages/app-bundle/overlay/packages/schema/src/v1/question.ts, packages/app-bundle/overlay/packages/app/src/pages/session/composer/session-question-dock.tsx
Question schemas now support optional text defaults. The question dock uses defaults when cached state is absent.
Profile-backed onboarding
packages/extension/scores/overture/SCORE.md, packages/extension/opencode-plugin/onboarding.ts, packages/extension/opencode-plugin/amicode_tools.ts, packages/extension/substrate/vault_store.ts, packages/extension/test/scores/golden/compile-chained.md, packages/extension/test/scores/overture_*
Overture now collects profile data through fixed stages, persists it to profile.json, supports resume and redo behavior, and records completion with a filesystem marker. Completion materializes merged profile data.
Pulse design skill
packages/extension/skills/design-a-pulse/SKILL.md
A public skill now defines platform selection, system modeling, target selection, formulation, solve execution, and run inspection.

Session routing and score compilation

Layer / File(s)Summary
Session orchestration
packages/extension/src/opencode_config.ts, packages/extension/src/substrate/vault_store.ts, packages/extension/test/scores/prep_integration.test.ts
Onboarding runs as a standalone overture. Later sessions inject routing and copilot content instead of a compiled primary score. State access covers the full Amico directory.
Score compilation and routing
packages/extension/src/scores/compiler.ts, packages/extension/src/scores/router.ts, packages/extension/test/scores/compiler.test.ts, packages/extension/test/scores/golden/compile-score.md, packages/extension/test/scores/golden/router-section.md
Compiled scores use a splice marker and dynamic headings. The router sends pulse requests to design-a-pulse, joins supplied problems to matching workflows, and excludes onboarding cards.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
participant Session
participant Router
participant DesignAPulse
participant AmicoTools
Session->>Router: provide live state and opening request
Router->>DesignAPulse: invoke pulse-design workflow
DesignAPulse->>AmicoTools: record staged choices
DesignAPulse-->>Session: report solve or inspection status
Loading

Suggested reviewers:aarontrowbridge

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch profile-onboarding-bridge

Comment @coderabbitai help to get the list of available commands.

- Expand ENTITY_FIELDS.profile to accept description, research_area,
experiment_kind, scholar, github, custom_link_url, custom_link_label
(previously silently dropped by sanitizePayload)
- Add 'links' stage to overture SCORE: asks for Scholar, GitHub, and
custom link URLs (all optional/skippable)
- Add materializeProfileJson(): on onboarding_completed, replay the
events stream and write identity fields to ~/.amico/profile.json
(additive merge — never clobbers fields already set by inline editor)
- Update amicode_profile tool description to document new fields
- Regenerate golden snapshot
Field mapping (onboarding → profile.json):
name → name, role → role, org → affiliation, research_area → focus,
description → description, scholar → scholar, github → github,
custom_link_url + custom_link_label → custom_link: {url, label}
Part of harmoniqs/opencode#231
The overture (generic researcher onboarding) was chained directly into
the pulse-designer interview, forcing quantum-specific questions on all
users immediately after onboarding. This made no sense for a
domain-neutral product.
Now the overture runs standalone. The pulse-designer (or any domain
interview) starts in a subsequent session via the onset router, only
when the user actively chooses it.
- Remove compileChainedScore/chainManifest usage from routing
- shouldOnboard no longer requires score0 (pulse-designer) to be present
- Update routing test to expect standalone overture behavior
… exists
When onboarding runs on a user who already has a complete profile (all of
name, intent, goals present), the overture now asks 'keep my current
profile' or 'start fresh' before proceeding. Prevents the interview from
skipping all stages and doing nothing useful on a redo.
Partial profiles (resumed sessions) still skip answered stages as before.
The question tool requires an options array with label+description for
choice questions. Clarify the SCORE instruction to explicitly specify
the options format so the agent generates valid tool calls.
When events.jsonl is empty/missing (e.g. the agent wrote the profile via
a different path), the bridge now accepts an optional inline profile
payload so profile.json is still written. This closes the edge case where
redo-onboarding clears events.jsonl but the distiller writes the vault
note from session context.
…ol call
The agent was generating invalid question tool calls (missing options
array) because the instruction format was ambiguous. Now includes the
exact JSON payload so the agent produces a valid choice question.
…e intent
Reorder stages so the identity card fields are collected first:
1. orientation: name → role → affiliation (was just name)
2. links: Scholar, GitHub, custom link (was stage 8, now stage 2)
3. context_seed (unchanged)
4. intent (unchanged)
5-9. goals, research_area, environment, devices, handoff (unchanged)
This ensures the profile dropdown is populated with the core identity
fields early in the interview, and link pills are filled before the
more domain-specific questions.
…g path
The agent was bypassing the events pipeline and writing profile data
directly to vault markdown files. This left events.jsonl empty and
profile.json never got written (the dropdown was blank).
Add an explicit HARD RULE in the SCORE body forbidding any path other
than amicode_profile for recording onboarding answers.
…uestions
The question tool schema requires the 'options' key even for kind:'text'
questions (it can be an empty array but must be present). The agent was
omitting it, causing SchemaError. Updated the protocol instruction to
make this explicit.
…ystem writes
Three issues addressed:
1. Jargon leakage: agent was saying 'vault', 'distiller', 'materialize',
'events pipeline' etc. to users during onboarding. Added strict language
rules that ban all internal/infrastructure terms from user-facing dialogue.
2. Filesystem writes: agent was bypassing amicode_profile and writing directly
to ~/.amico/ files (events.jsonl, vault notes, etc.). Added an absolute
filesystem prohibition — the agent must NEVER write/edit/create any file
under ~/.amico/ during onboarding. The only persistence path is
amicode_profile; if unavailable, nothing is saved (transcript is backup).
3. Tone: rewrote the persona and greeting to be warmer and more conversational.
'Ciao — I'm Amico. Let me get to know you a little so I can be actually
useful from the start.' instead of the transactional 'I'll remember your
setup so we can move fast.'
Also: added tool-unavailability fallback (proceed fresh if amicode_profile
isn't in tool list, never tell user about tool issues).
@jeonghun-jj-lee
jeonghun-jj-leeforce-pushed the profile-onboarding-bridge branch from e4edfc5 to cf607fbCompareAugust 23, 2026 12:22
The overture was drifting off-script — asking about transmon parameters,
generating invalid question calls, and conflating onboarding with the
pulse-designer interview. Root causes:
1. Too many conditional stages (environment, devices, context_seed) gave the
agent room to improvise and branch incorrectly.
2. No explicit scope fence — the agent could see the pulse-designer interview
in the same compiled prompt and sometimes started running it.
3. Free-form guidance ('weave naturally') invited freestyle.
Fix: rewrite to exactly 6 stages with mechanical instructions:
1. orientation (name, role, affiliation)
2. links (scholar, github, custom — all skippable)
3. intent (multi-select)
4. goals (free text)
5. research_area (only if experiments intent — 2 questions)
6. handoff (auto-description + completion marker)
Removed: context_seed (move to a post-onboarding flow), environment, devices
(these are pulse-designer concerns, not profile concerns).
Added a SCOPE FENCE at the top: explicit prohibition on asking about quantum
hardware, Hamiltonians, pulse parameters, etc. Those belong to a different
interview in a different session.
Added a hard STOP fence at the end: after Stage 6, the interview is OVER —
no more questions, no pulse-designer, no suggested next steps beyond 'start
a new session.'
…, not pulse-designer
The compiler was hardcoding '## Pulse-designer interview' as the heading for
ALL compiled scores — including the overture. The agent would see that heading
during onboarding and naturally think it should run a pulse-designer interview.
Fix: compileScore now uses a dynamic heading based on the score id:
- 'overture' → '## Onboarding interview'
- anything else → '## Pulse-designer interview'
Also: added a hidden HTML comment marker (SPLICE_MARKER) so spliceIntoAgentsMd
can locate the section reliably regardless of heading text. Falls back to the
legacy heading for backward compat.
…demand only
The full pulse-designer interview (270 lines of quantum-specific protocol)
was being compiled into EVERY post-onboarding session's AGENTS.md. This
polluted the context for general users and caused the agent to proactively
start pulse-design interviews even when users just wanted to code.
Now: post-onboarding sessions get only the onset router + a minimal stub
that says 'you are a general-purpose autoresearch copilot, do NOT start
domain interviews unless explicitly asked.' The pulse-design workflow is
still available on-demand via the skill system (transmon, atoms, bosonic,
etc.) when the user asks for it.
Also updated the onset router to remove pulse-designer-centric framing:
- Removed the SYSTEM_FIRST_SCORE constant
- 'Design a new pulse' is now described generically (invoke platform skill)
- Router language no longer references 'the interview below'
…mand content
Created skills/design-a-pulse/SKILL.md: the orchestration guide for walking
a user through pulse design (platform → model → formulation → solve → inspect).
It's a thin coordination layer that tells the agent which platform skills to
invoke (transmon, atoms, bosonic, etc.) and what stages to follow.
This replaces the old approach of compiling the full pulse-designer SCORE body
into every session's system prompt. Now it loads on-demand when the user asks
to design a pulse, keeping general sessions lean.
Also updated the onset router to reference the skill by name:
'invoke the design-a-pulse skill for the guided interview.'
Two issues fixed:
1. The amicode_profile plugin tool wasn't loading (the local-built opencode
binary silently failed to import it), so the onboarding agent had no way
to persist answers. Fix: the SCORE now instructs the agent to write
~/.amico/profile.json directly using standard file tools. The plugin tool
is nice-to-have for analytics but no longer the critical path.
2. The link questions (Scholar, GitHub, custom) didn't pre-fill with 'skip',
forcing users to type it. Fix: added `default` field support to the
question schema overlay + UI initialization from it, and the SCORE now
passes `default: "skip"` on each link question.
Changes:
- Grant ~/.amico/** in external_directory permissions (subsumes library,
problems, onboarding — all already under ~/.amico)
- SCORE rewritten: reads/writes ~/.amico/profile.json directly; completion
marker is now a file (~/.amico/amicode/onboarding/completed)
- hasOnboardingCompleted() checks for both the new file marker and the
legacy events.jsonl marker
- QuestionV2 schema overlay + SDK types: added optional `default` field
- session-question-dock.tsx: initializes text input from question.default
- Tests updated to match new SCORE content
@jeonghun-jj-lee
jeonghun-jj-lee marked this pull request as ready for review August 23, 2026 13:50
@jeonghun-jj-lee
jeonghun-jj-lee merged commit 85925d8 into mainAug 23, 2026
7 of 8 checks passed
aarontrowbridge added a commit that referenced this pull request Aug 23, 2026
…#513 drift break) (#531)
* fix(app-bundle): re-extract overlay at fork v1.18.10-amicode.16
Repairs the #513 drift-gate break on main: the overlay hand-edit is
superseded by the fork's canonical question-default implementation
(opencode#232, included in the .16 tag). 80 files added, 63 changed —
the full UI wave (workspace engine, retheme, status-dot semantics,
theme fixes). Round-trip verified: all 502 files byte-identical to the
tag; drift gate PASS.
Closes#530. Fork tag tracked by harmoniqs/opencode#238.
* fix(vendor): pin opencode binary to v1.18.10-amicode.16
Aligns the vendored binary with the app-bundle overlay pin and the
frozen server binary (same fork revision, 77bb1c8b7). Asset hashes
recorded from the release.
* test(goldens): re-record amicode service fixtures at the .16 pin
The contract suite's self-tracking check caught the pin bump — goldens
re-recorded via scripts/record_amicode_fixtures.mjs (71 entries).
* fix(widgets): sync builtin widget sources to the fork's .16 re-theme
The parity suite caught the pin bump's second-order effect: the fork's
re-theme wave (opencode#235) restyled all seven builtin widgets; the
extension's copies lagged. Synced verbatim from the fork's
widgets-src — the fork binary is the parity source of truth.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hitlNeeds human decision or review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@jeonghun-jj-lee
, '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

feat(onboarding): add links stage + bridge onboarding to profile.json - #513

Merged
jeonghun-jj-lee merged 15 commits into
mainfrom
profile-onboarding-bridge
Aug 23, 2026
Merged

feat(onboarding): add links stage + bridge onboarding to profile.json#513
jeonghun-jj-lee merged 15 commits into
mainfrom
profile-onboarding-bridge

Conversation

@jeonghun-jj-lee

@jeonghun-jj-leejeonghun-jj-lee commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Part of harmoniqs/opencode#231

Bridges onboarding data into ~/.amico/profile.json so the new profile dropdown popover (opencode PR #234) is populated immediately after onboarding completes.

Changes

  • ENTITY_FIELDS expandeddescription, research_area, experiment_kind, scholar, github, custom_link_url, custom_link_label no longer silently dropped by sanitizePayload
  • Links stage — new optional stage in the overture asking for Scholar, GitHub, and custom link URLs
  • materializeProfileJson() — on onboarding_completed, replays events stream and writes identity fields to profile.json (additive merge, never clobbers inline edits)
  • Tool description updated — documents all accepted profile fields

Summary by CodeRabbit

  • New Features

    • Added guided pulse-design workflow covering platform selection, modeling, targets, solving, and result review.
    • Onboarding now collects research and profile details, including affiliations and links.
    • Completed onboarding information is saved to the local profile for future sessions.
    • Added editable pre-filled values for text questions.
  • Improvements

    • Improved onboarding resume and completion detection.
    • Updated routing so pulse design and user-provided problems start the appropriate workflow directly.
    • Expanded profile documentation and supported fields.

@jeonghun-jj-leejeonghun-jj-lee added the hitl Needs human decision or review label Aug 23, 2026
@coderabbitai

coderabbitaiBot commented Aug 23, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d7d3fe9e-c9f9-4c1d-a305-5676a5a07fab

📥 Commits

Reviewing files that changed from the base of the PR and between 5011b9b and 16a8afe.

⛔ Files ignored due to path filters (1)
  • packages/app-bundle/overlay/packages/sdk/js/src/v2/gen/types.gen.ts is excluded by !**/gen/**
📒 Files selected for processing (18)
  • packages/app-bundle/overlay/packages/app/src/pages/session/composer/session-question-dock.tsx
  • packages/app-bundle/overlay/packages/schema/src/question.ts
  • packages/app-bundle/overlay/packages/schema/src/v1/question.ts
  • packages/extension/opencode-plugin/amicode_tools.ts
  • packages/extension/opencode-plugin/onboarding.ts
  • packages/extension/scores/overture/SCORE.md
  • packages/extension/skills/design-a-pulse/SKILL.md
  • packages/extension/src/opencode_config.ts
  • packages/extension/src/scores/compiler.ts
  • packages/extension/src/scores/router.ts
  • packages/extension/src/substrate/vault_store.ts
  • packages/extension/test/scores/compiler.test.ts
  • packages/extension/test/scores/golden/compile-chained.md
  • packages/extension/test/scores/golden/compile-score.md
  • packages/extension/test/scores/golden/router-section.md
  • packages/extension/test/scores/overture_rewrite.test.ts
  • packages/extension/test/scores/overture_routing.test.ts
  • packages/extension/test/scores/prep_integration.test.ts

📝 Walkthrough

Walkthrough

The PR adds text-question defaults, rewrites overture onboarding around profile.json and filesystem completion markers, introduces the public design-a-pulse skill, and changes score compilation, routing, session preparation, and completion detection.

Changes

Onboarding and profile persistence

Layer / File(s)Summary
Question defaults
packages/app-bundle/overlay/packages/schema/src/question.ts, packages/app-bundle/overlay/packages/schema/src/v1/question.ts, packages/app-bundle/overlay/packages/app/src/pages/session/composer/session-question-dock.tsx
Question schemas now support optional text defaults. The question dock uses defaults when cached state is absent.
Profile-backed onboarding
packages/extension/scores/overture/SCORE.md, packages/extension/opencode-plugin/onboarding.ts, packages/extension/opencode-plugin/amicode_tools.ts, packages/extension/substrate/vault_store.ts, packages/extension/test/scores/golden/compile-chained.md, packages/extension/test/scores/overture_*
Overture now collects profile data through fixed stages, persists it to profile.json, supports resume and redo behavior, and records completion with a filesystem marker. Completion materializes merged profile data.
Pulse design skill
packages/extension/skills/design-a-pulse/SKILL.md
A public skill now defines platform selection, system modeling, target selection, formulation, solve execution, and run inspection.

Session routing and score compilation

Layer / File(s)Summary
Session orchestration
packages/extension/src/opencode_config.ts, packages/extension/src/substrate/vault_store.ts, packages/extension/test/scores/prep_integration.test.ts
Onboarding runs as a standalone overture. Later sessions inject routing and copilot content instead of a compiled primary score. State access covers the full Amico directory.
Score compilation and routing
packages/extension/src/scores/compiler.ts, packages/extension/src/scores/router.ts, packages/extension/test/scores/compiler.test.ts, packages/extension/test/scores/golden/compile-score.md, packages/extension/test/scores/golden/router-section.md
Compiled scores use a splice marker and dynamic headings. The router sends pulse requests to design-a-pulse, joins supplied problems to matching workflows, and excludes onboarding cards.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
participant Session
participant Router
participant DesignAPulse
participant AmicoTools
Session->>Router: provide live state and opening request
Router->>DesignAPulse: invoke pulse-design workflow
DesignAPulse->>AmicoTools: record staged choices
DesignAPulse-->>Session: report solve or inspection status
Loading

Suggested reviewers:aarontrowbridge

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch profile-onboarding-bridge

Comment @coderabbitai help to get the list of available commands.

- Expand ENTITY_FIELDS.profile to accept description, research_area,
experiment_kind, scholar, github, custom_link_url, custom_link_label
(previously silently dropped by sanitizePayload)
- Add 'links' stage to overture SCORE: asks for Scholar, GitHub, and
custom link URLs (all optional/skippable)
- Add materializeProfileJson(): on onboarding_completed, replay the
events stream and write identity fields to ~/.amico/profile.json
(additive merge — never clobbers fields already set by inline editor)
- Update amicode_profile tool description to document new fields
- Regenerate golden snapshot
Field mapping (onboarding → profile.json):
name → name, role → role, org → affiliation, research_area → focus,
description → description, scholar → scholar, github → github,
custom_link_url + custom_link_label → custom_link: {url, label}
Part of harmoniqs/opencode#231
The overture (generic researcher onboarding) was chained directly into
the pulse-designer interview, forcing quantum-specific questions on all
users immediately after onboarding. This made no sense for a
domain-neutral product.
Now the overture runs standalone. The pulse-designer (or any domain
interview) starts in a subsequent session via the onset router, only
when the user actively chooses it.
- Remove compileChainedScore/chainManifest usage from routing
- shouldOnboard no longer requires score0 (pulse-designer) to be present
- Update routing test to expect standalone overture behavior
… exists
When onboarding runs on a user who already has a complete profile (all of
name, intent, goals present), the overture now asks 'keep my current
profile' or 'start fresh' before proceeding. Prevents the interview from
skipping all stages and doing nothing useful on a redo.
Partial profiles (resumed sessions) still skip answered stages as before.
The question tool requires an options array with label+description for
choice questions. Clarify the SCORE instruction to explicitly specify
the options format so the agent generates valid tool calls.
When events.jsonl is empty/missing (e.g. the agent wrote the profile via
a different path), the bridge now accepts an optional inline profile
payload so profile.json is still written. This closes the edge case where
redo-onboarding clears events.jsonl but the distiller writes the vault
note from session context.
…ol call
The agent was generating invalid question tool calls (missing options
array) because the instruction format was ambiguous. Now includes the
exact JSON payload so the agent produces a valid choice question.
…e intent
Reorder stages so the identity card fields are collected first:
1. orientation: name → role → affiliation (was just name)
2. links: Scholar, GitHub, custom link (was stage 8, now stage 2)
3. context_seed (unchanged)
4. intent (unchanged)
5-9. goals, research_area, environment, devices, handoff (unchanged)
This ensures the profile dropdown is populated with the core identity
fields early in the interview, and link pills are filled before the
more domain-specific questions.
…g path
The agent was bypassing the events pipeline and writing profile data
directly to vault markdown files. This left events.jsonl empty and
profile.json never got written (the dropdown was blank).
Add an explicit HARD RULE in the SCORE body forbidding any path other
than amicode_profile for recording onboarding answers.
…uestions
The question tool schema requires the 'options' key even for kind:'text'
questions (it can be an empty array but must be present). The agent was
omitting it, causing SchemaError. Updated the protocol instruction to
make this explicit.
…ystem writes
Three issues addressed:
1. Jargon leakage: agent was saying 'vault', 'distiller', 'materialize',
'events pipeline' etc. to users during onboarding. Added strict language
rules that ban all internal/infrastructure terms from user-facing dialogue.
2. Filesystem writes: agent was bypassing amicode_profile and writing directly
to ~/.amico/ files (events.jsonl, vault notes, etc.). Added an absolute
filesystem prohibition — the agent must NEVER write/edit/create any file
under ~/.amico/ during onboarding. The only persistence path is
amicode_profile; if unavailable, nothing is saved (transcript is backup).
3. Tone: rewrote the persona and greeting to be warmer and more conversational.
'Ciao — I'm Amico. Let me get to know you a little so I can be actually
useful from the start.' instead of the transactional 'I'll remember your
setup so we can move fast.'
Also: added tool-unavailability fallback (proceed fresh if amicode_profile
isn't in tool list, never tell user about tool issues).
@jeonghun-jj-lee
jeonghun-jj-leeforce-pushed the profile-onboarding-bridge branch from e4edfc5 to cf607fbCompareAugust 23, 2026 12:22
The overture was drifting off-script — asking about transmon parameters,
generating invalid question calls, and conflating onboarding with the
pulse-designer interview. Root causes:
1. Too many conditional stages (environment, devices, context_seed) gave the
agent room to improvise and branch incorrectly.
2. No explicit scope fence — the agent could see the pulse-designer interview
in the same compiled prompt and sometimes started running it.
3. Free-form guidance ('weave naturally') invited freestyle.
Fix: rewrite to exactly 6 stages with mechanical instructions:
1. orientation (name, role, affiliation)
2. links (scholar, github, custom — all skippable)
3. intent (multi-select)
4. goals (free text)
5. research_area (only if experiments intent — 2 questions)
6. handoff (auto-description + completion marker)
Removed: context_seed (move to a post-onboarding flow), environment, devices
(these are pulse-designer concerns, not profile concerns).
Added a SCOPE FENCE at the top: explicit prohibition on asking about quantum
hardware, Hamiltonians, pulse parameters, etc. Those belong to a different
interview in a different session.
Added a hard STOP fence at the end: after Stage 6, the interview is OVER —
no more questions, no pulse-designer, no suggested next steps beyond 'start
a new session.'
…, not pulse-designer
The compiler was hardcoding '## Pulse-designer interview' as the heading for
ALL compiled scores — including the overture. The agent would see that heading
during onboarding and naturally think it should run a pulse-designer interview.
Fix: compileScore now uses a dynamic heading based on the score id:
- 'overture' → '## Onboarding interview'
- anything else → '## Pulse-designer interview'
Also: added a hidden HTML comment marker (SPLICE_MARKER) so spliceIntoAgentsMd
can locate the section reliably regardless of heading text. Falls back to the
legacy heading for backward compat.
…demand only
The full pulse-designer interview (270 lines of quantum-specific protocol)
was being compiled into EVERY post-onboarding session's AGENTS.md. This
polluted the context for general users and caused the agent to proactively
start pulse-design interviews even when users just wanted to code.
Now: post-onboarding sessions get only the onset router + a minimal stub
that says 'you are a general-purpose autoresearch copilot, do NOT start
domain interviews unless explicitly asked.' The pulse-design workflow is
still available on-demand via the skill system (transmon, atoms, bosonic,
etc.) when the user asks for it.
Also updated the onset router to remove pulse-designer-centric framing:
- Removed the SYSTEM_FIRST_SCORE constant
- 'Design a new pulse' is now described generically (invoke platform skill)
- Router language no longer references 'the interview below'
…mand content
Created skills/design-a-pulse/SKILL.md: the orchestration guide for walking
a user through pulse design (platform → model → formulation → solve → inspect).
It's a thin coordination layer that tells the agent which platform skills to
invoke (transmon, atoms, bosonic, etc.) and what stages to follow.
This replaces the old approach of compiling the full pulse-designer SCORE body
into every session's system prompt. Now it loads on-demand when the user asks
to design a pulse, keeping general sessions lean.
Also updated the onset router to reference the skill by name:
'invoke the design-a-pulse skill for the guided interview.'
Two issues fixed:
1. The amicode_profile plugin tool wasn't loading (the local-built opencode
binary silently failed to import it), so the onboarding agent had no way
to persist answers. Fix: the SCORE now instructs the agent to write
~/.amico/profile.json directly using standard file tools. The plugin tool
is nice-to-have for analytics but no longer the critical path.
2. The link questions (Scholar, GitHub, custom) didn't pre-fill with 'skip',
forcing users to type it. Fix: added `default` field support to the
question schema overlay + UI initialization from it, and the SCORE now
passes `default: "skip"` on each link question.
Changes:
- Grant ~/.amico/** in external_directory permissions (subsumes library,
problems, onboarding — all already under ~/.amico)
- SCORE rewritten: reads/writes ~/.amico/profile.json directly; completion
marker is now a file (~/.amico/amicode/onboarding/completed)
- hasOnboardingCompleted() checks for both the new file marker and the
legacy events.jsonl marker
- QuestionV2 schema overlay + SDK types: added optional `default` field
- session-question-dock.tsx: initializes text input from question.default
- Tests updated to match new SCORE content
@jeonghun-jj-lee
jeonghun-jj-lee marked this pull request as ready for review August 23, 2026 13:50
@jeonghun-jj-lee
jeonghun-jj-lee merged commit 85925d8 into mainAug 23, 2026
7 of 8 checks passed
aarontrowbridge added a commit that referenced this pull request Aug 23, 2026
…#513 drift break) (#531)
* fix(app-bundle): re-extract overlay at fork v1.18.10-amicode.16
Repairs the #513 drift-gate break on main: the overlay hand-edit is
superseded by the fork's canonical question-default implementation
(opencode#232, included in the .16 tag). 80 files added, 63 changed —
the full UI wave (workspace engine, retheme, status-dot semantics,
theme fixes). Round-trip verified: all 502 files byte-identical to the
tag; drift gate PASS.
Closes#530. Fork tag tracked by harmoniqs/opencode#238.
* fix(vendor): pin opencode binary to v1.18.10-amicode.16
Aligns the vendored binary with the app-bundle overlay pin and the
frozen server binary (same fork revision, 77bb1c8b7). Asset hashes
recorded from the release.
* test(goldens): re-record amicode service fixtures at the .16 pin
The contract suite's self-tracking check caught the pin bump — goldens
re-recorded via scripts/record_amicode_fixtures.mjs (71 entries).
* fix(widgets): sync builtin widget sources to the fork's .16 re-theme
The parity suite caught the pin bump's second-order effect: the fork's
re-theme wave (opencode#235) restyled all seven builtin widgets; the
extension's copies lagged. Synced verbatim from the fork's
widgets-src — the fork binary is the parity source of truth.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hitlNeeds human decision or review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@jeonghun-jj-lee
, '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

feat(onboarding): add links stage + bridge onboarding to profile.json - #513

Merged
jeonghun-jj-lee merged 15 commits into
mainfrom
profile-onboarding-bridge
Aug 23, 2026
Merged

feat(onboarding): add links stage + bridge onboarding to profile.json#513
jeonghun-jj-lee merged 15 commits into
mainfrom
profile-onboarding-bridge

Conversation

@jeonghun-jj-lee

@jeonghun-jj-leejeonghun-jj-lee commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Part of harmoniqs/opencode#231

Bridges onboarding data into ~/.amico/profile.json so the new profile dropdown popover (opencode PR #234) is populated immediately after onboarding completes.

Changes

  • ENTITY_FIELDS expandeddescription, research_area, experiment_kind, scholar, github, custom_link_url, custom_link_label no longer silently dropped by sanitizePayload
  • Links stage — new optional stage in the overture asking for Scholar, GitHub, and custom link URLs
  • materializeProfileJson() — on onboarding_completed, replays events stream and writes identity fields to profile.json (additive merge, never clobbers inline edits)
  • Tool description updated — documents all accepted profile fields

Summary by CodeRabbit

  • New Features

    • Added guided pulse-design workflow covering platform selection, modeling, targets, solving, and result review.
    • Onboarding now collects research and profile details, including affiliations and links.
    • Completed onboarding information is saved to the local profile for future sessions.
    • Added editable pre-filled values for text questions.
  • Improvements

    • Improved onboarding resume and completion detection.
    • Updated routing so pulse design and user-provided problems start the appropriate workflow directly.
    • Expanded profile documentation and supported fields.

@jeonghun-jj-leejeonghun-jj-lee added the hitl Needs human decision or review label Aug 23, 2026
@coderabbitai

coderabbitaiBot commented Aug 23, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d7d3fe9e-c9f9-4c1d-a305-5676a5a07fab

📥 Commits

Reviewing files that changed from the base of the PR and between 5011b9b and 16a8afe.

⛔ Files ignored due to path filters (1)
  • packages/app-bundle/overlay/packages/sdk/js/src/v2/gen/types.gen.ts is excluded by !**/gen/**
📒 Files selected for processing (18)
  • packages/app-bundle/overlay/packages/app/src/pages/session/composer/session-question-dock.tsx
  • packages/app-bundle/overlay/packages/schema/src/question.ts
  • packages/app-bundle/overlay/packages/schema/src/v1/question.ts
  • packages/extension/opencode-plugin/amicode_tools.ts
  • packages/extension/opencode-plugin/onboarding.ts
  • packages/extension/scores/overture/SCORE.md
  • packages/extension/skills/design-a-pulse/SKILL.md
  • packages/extension/src/opencode_config.ts
  • packages/extension/src/scores/compiler.ts
  • packages/extension/src/scores/router.ts
  • packages/extension/src/substrate/vault_store.ts
  • packages/extension/test/scores/compiler.test.ts
  • packages/extension/test/scores/golden/compile-chained.md
  • packages/extension/test/scores/golden/compile-score.md
  • packages/extension/test/scores/golden/router-section.md
  • packages/extension/test/scores/overture_rewrite.test.ts
  • packages/extension/test/scores/overture_routing.test.ts
  • packages/extension/test/scores/prep_integration.test.ts

📝 Walkthrough

Walkthrough

The PR adds text-question defaults, rewrites overture onboarding around profile.json and filesystem completion markers, introduces the public design-a-pulse skill, and changes score compilation, routing, session preparation, and completion detection.

Changes

Onboarding and profile persistence

Layer / File(s)Summary
Question defaults
packages/app-bundle/overlay/packages/schema/src/question.ts, packages/app-bundle/overlay/packages/schema/src/v1/question.ts, packages/app-bundle/overlay/packages/app/src/pages/session/composer/session-question-dock.tsx
Question schemas now support optional text defaults. The question dock uses defaults when cached state is absent.
Profile-backed onboarding
packages/extension/scores/overture/SCORE.md, packages/extension/opencode-plugin/onboarding.ts, packages/extension/opencode-plugin/amicode_tools.ts, packages/extension/substrate/vault_store.ts, packages/extension/test/scores/golden/compile-chained.md, packages/extension/test/scores/overture_*
Overture now collects profile data through fixed stages, persists it to profile.json, supports resume and redo behavior, and records completion with a filesystem marker. Completion materializes merged profile data.
Pulse design skill
packages/extension/skills/design-a-pulse/SKILL.md
A public skill now defines platform selection, system modeling, target selection, formulation, solve execution, and run inspection.

Session routing and score compilation

Layer / File(s)Summary
Session orchestration
packages/extension/src/opencode_config.ts, packages/extension/src/substrate/vault_store.ts, packages/extension/test/scores/prep_integration.test.ts
Onboarding runs as a standalone overture. Later sessions inject routing and copilot content instead of a compiled primary score. State access covers the full Amico directory.
Score compilation and routing
packages/extension/src/scores/compiler.ts, packages/extension/src/scores/router.ts, packages/extension/test/scores/compiler.test.ts, packages/extension/test/scores/golden/compile-score.md, packages/extension/test/scores/golden/router-section.md
Compiled scores use a splice marker and dynamic headings. The router sends pulse requests to design-a-pulse, joins supplied problems to matching workflows, and excludes onboarding cards.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
participant Session
participant Router
participant DesignAPulse
participant AmicoTools
Session->>Router: provide live state and opening request
Router->>DesignAPulse: invoke pulse-design workflow
DesignAPulse->>AmicoTools: record staged choices
DesignAPulse-->>Session: report solve or inspection status
Loading

Suggested reviewers:aarontrowbridge

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch profile-onboarding-bridge

Comment @coderabbitai help to get the list of available commands.

- Expand ENTITY_FIELDS.profile to accept description, research_area,
experiment_kind, scholar, github, custom_link_url, custom_link_label
(previously silently dropped by sanitizePayload)
- Add 'links' stage to overture SCORE: asks for Scholar, GitHub, and
custom link URLs (all optional/skippable)
- Add materializeProfileJson(): on onboarding_completed, replay the
events stream and write identity fields to ~/.amico/profile.json
(additive merge — never clobbers fields already set by inline editor)
- Update amicode_profile tool description to document new fields
- Regenerate golden snapshot
Field mapping (onboarding → profile.json):
name → name, role → role, org → affiliation, research_area → focus,
description → description, scholar → scholar, github → github,
custom_link_url + custom_link_label → custom_link: {url, label}
Part of harmoniqs/opencode#231
The overture (generic researcher onboarding) was chained directly into
the pulse-designer interview, forcing quantum-specific questions on all
users immediately after onboarding. This made no sense for a
domain-neutral product.
Now the overture runs standalone. The pulse-designer (or any domain
interview) starts in a subsequent session via the onset router, only
when the user actively chooses it.
- Remove compileChainedScore/chainManifest usage from routing
- shouldOnboard no longer requires score0 (pulse-designer) to be present
- Update routing test to expect standalone overture behavior
… exists
When onboarding runs on a user who already has a complete profile (all of
name, intent, goals present), the overture now asks 'keep my current
profile' or 'start fresh' before proceeding. Prevents the interview from
skipping all stages and doing nothing useful on a redo.
Partial profiles (resumed sessions) still skip answered stages as before.
The question tool requires an options array with label+description for
choice questions. Clarify the SCORE instruction to explicitly specify
the options format so the agent generates valid tool calls.
When events.jsonl is empty/missing (e.g. the agent wrote the profile via
a different path), the bridge now accepts an optional inline profile
payload so profile.json is still written. This closes the edge case where
redo-onboarding clears events.jsonl but the distiller writes the vault
note from session context.
…ol call
The agent was generating invalid question tool calls (missing options
array) because the instruction format was ambiguous. Now includes the
exact JSON payload so the agent produces a valid choice question.
…e intent
Reorder stages so the identity card fields are collected first:
1. orientation: name → role → affiliation (was just name)
2. links: Scholar, GitHub, custom link (was stage 8, now stage 2)
3. context_seed (unchanged)
4. intent (unchanged)
5-9. goals, research_area, environment, devices, handoff (unchanged)
This ensures the profile dropdown is populated with the core identity
fields early in the interview, and link pills are filled before the
more domain-specific questions.
…g path
The agent was bypassing the events pipeline and writing profile data
directly to vault markdown files. This left events.jsonl empty and
profile.json never got written (the dropdown was blank).
Add an explicit HARD RULE in the SCORE body forbidding any path other
than amicode_profile for recording onboarding answers.
…uestions
The question tool schema requires the 'options' key even for kind:'text'
questions (it can be an empty array but must be present). The agent was
omitting it, causing SchemaError. Updated the protocol instruction to
make this explicit.
…ystem writes
Three issues addressed:
1. Jargon leakage: agent was saying 'vault', 'distiller', 'materialize',
'events pipeline' etc. to users during onboarding. Added strict language
rules that ban all internal/infrastructure terms from user-facing dialogue.
2. Filesystem writes: agent was bypassing amicode_profile and writing directly
to ~/.amico/ files (events.jsonl, vault notes, etc.). Added an absolute
filesystem prohibition — the agent must NEVER write/edit/create any file
under ~/.amico/ during onboarding. The only persistence path is
amicode_profile; if unavailable, nothing is saved (transcript is backup).
3. Tone: rewrote the persona and greeting to be warmer and more conversational.
'Ciao — I'm Amico. Let me get to know you a little so I can be actually
useful from the start.' instead of the transactional 'I'll remember your
setup so we can move fast.'
Also: added tool-unavailability fallback (proceed fresh if amicode_profile
isn't in tool list, never tell user about tool issues).
@jeonghun-jj-lee
jeonghun-jj-leeforce-pushed the profile-onboarding-bridge branch from e4edfc5 to cf607fbCompareAugust 23, 2026 12:22
The overture was drifting off-script — asking about transmon parameters,
generating invalid question calls, and conflating onboarding with the
pulse-designer interview. Root causes:
1. Too many conditional stages (environment, devices, context_seed) gave the
agent room to improvise and branch incorrectly.
2. No explicit scope fence — the agent could see the pulse-designer interview
in the same compiled prompt and sometimes started running it.
3. Free-form guidance ('weave naturally') invited freestyle.
Fix: rewrite to exactly 6 stages with mechanical instructions:
1. orientation (name, role, affiliation)
2. links (scholar, github, custom — all skippable)
3. intent (multi-select)
4. goals (free text)
5. research_area (only if experiments intent — 2 questions)
6. handoff (auto-description + completion marker)
Removed: context_seed (move to a post-onboarding flow), environment, devices
(these are pulse-designer concerns, not profile concerns).
Added a SCOPE FENCE at the top: explicit prohibition on asking about quantum
hardware, Hamiltonians, pulse parameters, etc. Those belong to a different
interview in a different session.
Added a hard STOP fence at the end: after Stage 6, the interview is OVER —
no more questions, no pulse-designer, no suggested next steps beyond 'start
a new session.'
…, not pulse-designer
The compiler was hardcoding '## Pulse-designer interview' as the heading for
ALL compiled scores — including the overture. The agent would see that heading
during onboarding and naturally think it should run a pulse-designer interview.
Fix: compileScore now uses a dynamic heading based on the score id:
- 'overture' → '## Onboarding interview'
- anything else → '## Pulse-designer interview'
Also: added a hidden HTML comment marker (SPLICE_MARKER) so spliceIntoAgentsMd
can locate the section reliably regardless of heading text. Falls back to the
legacy heading for backward compat.
…demand only
The full pulse-designer interview (270 lines of quantum-specific protocol)
was being compiled into EVERY post-onboarding session's AGENTS.md. This
polluted the context for general users and caused the agent to proactively
start pulse-design interviews even when users just wanted to code.
Now: post-onboarding sessions get only the onset router + a minimal stub
that says 'you are a general-purpose autoresearch copilot, do NOT start
domain interviews unless explicitly asked.' The pulse-design workflow is
still available on-demand via the skill system (transmon, atoms, bosonic,
etc.) when the user asks for it.
Also updated the onset router to remove pulse-designer-centric framing:
- Removed the SYSTEM_FIRST_SCORE constant
- 'Design a new pulse' is now described generically (invoke platform skill)
- Router language no longer references 'the interview below'
…mand content
Created skills/design-a-pulse/SKILL.md: the orchestration guide for walking
a user through pulse design (platform → model → formulation → solve → inspect).
It's a thin coordination layer that tells the agent which platform skills to
invoke (transmon, atoms, bosonic, etc.) and what stages to follow.
This replaces the old approach of compiling the full pulse-designer SCORE body
into every session's system prompt. Now it loads on-demand when the user asks
to design a pulse, keeping general sessions lean.
Also updated the onset router to reference the skill by name:
'invoke the design-a-pulse skill for the guided interview.'
Two issues fixed:
1. The amicode_profile plugin tool wasn't loading (the local-built opencode
binary silently failed to import it), so the onboarding agent had no way
to persist answers. Fix: the SCORE now instructs the agent to write
~/.amico/profile.json directly using standard file tools. The plugin tool
is nice-to-have for analytics but no longer the critical path.
2. The link questions (Scholar, GitHub, custom) didn't pre-fill with 'skip',
forcing users to type it. Fix: added `default` field support to the
question schema overlay + UI initialization from it, and the SCORE now
passes `default: "skip"` on each link question.
Changes:
- Grant ~/.amico/** in external_directory permissions (subsumes library,
problems, onboarding — all already under ~/.amico)
- SCORE rewritten: reads/writes ~/.amico/profile.json directly; completion
marker is now a file (~/.amico/amicode/onboarding/completed)
- hasOnboardingCompleted() checks for both the new file marker and the
legacy events.jsonl marker
- QuestionV2 schema overlay + SDK types: added optional `default` field
- session-question-dock.tsx: initializes text input from question.default
- Tests updated to match new SCORE content
@jeonghun-jj-lee
jeonghun-jj-lee marked this pull request as ready for review August 23, 2026 13:50
@jeonghun-jj-lee
jeonghun-jj-lee merged commit 85925d8 into mainAug 23, 2026
7 of 8 checks passed
aarontrowbridge added a commit that referenced this pull request Aug 23, 2026
…#513 drift break) (#531)
* fix(app-bundle): re-extract overlay at fork v1.18.10-amicode.16
Repairs the #513 drift-gate break on main: the overlay hand-edit is
superseded by the fork's canonical question-default implementation
(opencode#232, included in the .16 tag). 80 files added, 63 changed —
the full UI wave (workspace engine, retheme, status-dot semantics,
theme fixes). Round-trip verified: all 502 files byte-identical to the
tag; drift gate PASS.
Closes#530. Fork tag tracked by harmoniqs/opencode#238.
* fix(vendor): pin opencode binary to v1.18.10-amicode.16
Aligns the vendored binary with the app-bundle overlay pin and the
frozen server binary (same fork revision, 77bb1c8b7). Asset hashes
recorded from the release.
* test(goldens): re-record amicode service fixtures at the .16 pin
The contract suite's self-tracking check caught the pin bump — goldens
re-recorded via scripts/record_amicode_fixtures.mjs (71 entries).
* fix(widgets): sync builtin widget sources to the fork's .16 re-theme
The parity suite caught the pin bump's second-order effect: the fork's
re-theme wave (opencode#235) restyled all seven builtin widgets; the
extension's copies lagged. Synced verbatim from the fork's
widgets-src — the fork binary is the parity source of truth.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hitlNeeds human decision or review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@jeonghun-jj-lee
, '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

feat(onboarding): add links stage + bridge onboarding to profile.json - #513

Merged
jeonghun-jj-lee merged 15 commits into
mainfrom
profile-onboarding-bridge
Aug 23, 2026
Merged

feat(onboarding): add links stage + bridge onboarding to profile.json#513
jeonghun-jj-lee merged 15 commits into
mainfrom
profile-onboarding-bridge

Conversation

@jeonghun-jj-lee

@jeonghun-jj-leejeonghun-jj-lee commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Part of harmoniqs/opencode#231

Bridges onboarding data into ~/.amico/profile.json so the new profile dropdown popover (opencode PR #234) is populated immediately after onboarding completes.

Changes

  • ENTITY_FIELDS expandeddescription, research_area, experiment_kind, scholar, github, custom_link_url, custom_link_label no longer silently dropped by sanitizePayload
  • Links stage — new optional stage in the overture asking for Scholar, GitHub, and custom link URLs
  • materializeProfileJson() — on onboarding_completed, replays events stream and writes identity fields to profile.json (additive merge, never clobbers inline edits)
  • Tool description updated — documents all accepted profile fields

Summary by CodeRabbit

  • New Features

    • Added guided pulse-design workflow covering platform selection, modeling, targets, solving, and result review.
    • Onboarding now collects research and profile details, including affiliations and links.
    • Completed onboarding information is saved to the local profile for future sessions.
    • Added editable pre-filled values for text questions.
  • Improvements

    • Improved onboarding resume and completion detection.
    • Updated routing so pulse design and user-provided problems start the appropriate workflow directly.
    • Expanded profile documentation and supported fields.

@jeonghun-jj-leejeonghun-jj-lee added the hitl Needs human decision or review label Aug 23, 2026
@coderabbitai

coderabbitaiBot commented Aug 23, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d7d3fe9e-c9f9-4c1d-a305-5676a5a07fab

📥 Commits

Reviewing files that changed from the base of the PR and between 5011b9b and 16a8afe.

⛔ Files ignored due to path filters (1)
  • packages/app-bundle/overlay/packages/sdk/js/src/v2/gen/types.gen.ts is excluded by !**/gen/**
📒 Files selected for processing (18)
  • packages/app-bundle/overlay/packages/app/src/pages/session/composer/session-question-dock.tsx
  • packages/app-bundle/overlay/packages/schema/src/question.ts
  • packages/app-bundle/overlay/packages/schema/src/v1/question.ts
  • packages/extension/opencode-plugin/amicode_tools.ts
  • packages/extension/opencode-plugin/onboarding.ts
  • packages/extension/scores/overture/SCORE.md
  • packages/extension/skills/design-a-pulse/SKILL.md
  • packages/extension/src/opencode_config.ts
  • packages/extension/src/scores/compiler.ts
  • packages/extension/src/scores/router.ts
  • packages/extension/src/substrate/vault_store.ts
  • packages/extension/test/scores/compiler.test.ts
  • packages/extension/test/scores/golden/compile-chained.md
  • packages/extension/test/scores/golden/compile-score.md
  • packages/extension/test/scores/golden/router-section.md
  • packages/extension/test/scores/overture_rewrite.test.ts
  • packages/extension/test/scores/overture_routing.test.ts
  • packages/extension/test/scores/prep_integration.test.ts

📝 Walkthrough

Walkthrough

The PR adds text-question defaults, rewrites overture onboarding around profile.json and filesystem completion markers, introduces the public design-a-pulse skill, and changes score compilation, routing, session preparation, and completion detection.

Changes

Onboarding and profile persistence

Layer / File(s)Summary
Question defaults
packages/app-bundle/overlay/packages/schema/src/question.ts, packages/app-bundle/overlay/packages/schema/src/v1/question.ts, packages/app-bundle/overlay/packages/app/src/pages/session/composer/session-question-dock.tsx
Question schemas now support optional text defaults. The question dock uses defaults when cached state is absent.
Profile-backed onboarding
packages/extension/scores/overture/SCORE.md, packages/extension/opencode-plugin/onboarding.ts, packages/extension/opencode-plugin/amicode_tools.ts, packages/extension/substrate/vault_store.ts, packages/extension/test/scores/golden/compile-chained.md, packages/extension/test/scores/overture_*
Overture now collects profile data through fixed stages, persists it to profile.json, supports resume and redo behavior, and records completion with a filesystem marker. Completion materializes merged profile data.
Pulse design skill
packages/extension/skills/design-a-pulse/SKILL.md
A public skill now defines platform selection, system modeling, target selection, formulation, solve execution, and run inspection.

Session routing and score compilation

Layer / File(s)Summary
Session orchestration
packages/extension/src/opencode_config.ts, packages/extension/src/substrate/vault_store.ts, packages/extension/test/scores/prep_integration.test.ts
Onboarding runs as a standalone overture. Later sessions inject routing and copilot content instead of a compiled primary score. State access covers the full Amico directory.
Score compilation and routing
packages/extension/src/scores/compiler.ts, packages/extension/src/scores/router.ts, packages/extension/test/scores/compiler.test.ts, packages/extension/test/scores/golden/compile-score.md, packages/extension/test/scores/golden/router-section.md
Compiled scores use a splice marker and dynamic headings. The router sends pulse requests to design-a-pulse, joins supplied problems to matching workflows, and excludes onboarding cards.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
participant Session
participant Router
participant DesignAPulse
participant AmicoTools
Session->>Router: provide live state and opening request
Router->>DesignAPulse: invoke pulse-design workflow
DesignAPulse->>AmicoTools: record staged choices
DesignAPulse-->>Session: report solve or inspection status
Loading

Suggested reviewers:aarontrowbridge

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch profile-onboarding-bridge

Comment @coderabbitai help to get the list of available commands.

- Expand ENTITY_FIELDS.profile to accept description, research_area,
experiment_kind, scholar, github, custom_link_url, custom_link_label
(previously silently dropped by sanitizePayload)
- Add 'links' stage to overture SCORE: asks for Scholar, GitHub, and
custom link URLs (all optional/skippable)
- Add materializeProfileJson(): on onboarding_completed, replay the
events stream and write identity fields to ~/.amico/profile.json
(additive merge — never clobbers fields already set by inline editor)
- Update amicode_profile tool description to document new fields
- Regenerate golden snapshot
Field mapping (onboarding → profile.json):
name → name, role → role, org → affiliation, research_area → focus,
description → description, scholar → scholar, github → github,
custom_link_url + custom_link_label → custom_link: {url, label}
Part of harmoniqs/opencode#231
The overture (generic researcher onboarding) was chained directly into
the pulse-designer interview, forcing quantum-specific questions on all
users immediately after onboarding. This made no sense for a
domain-neutral product.
Now the overture runs standalone. The pulse-designer (or any domain
interview) starts in a subsequent session via the onset router, only
when the user actively chooses it.
- Remove compileChainedScore/chainManifest usage from routing
- shouldOnboard no longer requires score0 (pulse-designer) to be present
- Update routing test to expect standalone overture behavior
… exists
When onboarding runs on a user who already has a complete profile (all of
name, intent, goals present), the overture now asks 'keep my current
profile' or 'start fresh' before proceeding. Prevents the interview from
skipping all stages and doing nothing useful on a redo.
Partial profiles (resumed sessions) still skip answered stages as before.
The question tool requires an options array with label+description for
choice questions. Clarify the SCORE instruction to explicitly specify
the options format so the agent generates valid tool calls.
When events.jsonl is empty/missing (e.g. the agent wrote the profile via
a different path), the bridge now accepts an optional inline profile
payload so profile.json is still written. This closes the edge case where
redo-onboarding clears events.jsonl but the distiller writes the vault
note from session context.
…ol call
The agent was generating invalid question tool calls (missing options
array) because the instruction format was ambiguous. Now includes the
exact JSON payload so the agent produces a valid choice question.
…e intent
Reorder stages so the identity card fields are collected first:
1. orientation: name → role → affiliation (was just name)
2. links: Scholar, GitHub, custom link (was stage 8, now stage 2)
3. context_seed (unchanged)
4. intent (unchanged)
5-9. goals, research_area, environment, devices, handoff (unchanged)
This ensures the profile dropdown is populated with the core identity
fields early in the interview, and link pills are filled before the
more domain-specific questions.
…g path
The agent was bypassing the events pipeline and writing profile data
directly to vault markdown files. This left events.jsonl empty and
profile.json never got written (the dropdown was blank).
Add an explicit HARD RULE in the SCORE body forbidding any path other
than amicode_profile for recording onboarding answers.
…uestions
The question tool schema requires the 'options' key even for kind:'text'
questions (it can be an empty array but must be present). The agent was
omitting it, causing SchemaError. Updated the protocol instruction to
make this explicit.
…ystem writes
Three issues addressed:
1. Jargon leakage: agent was saying 'vault', 'distiller', 'materialize',
'events pipeline' etc. to users during onboarding. Added strict language
rules that ban all internal/infrastructure terms from user-facing dialogue.
2. Filesystem writes: agent was bypassing amicode_profile and writing directly
to ~/.amico/ files (events.jsonl, vault notes, etc.). Added an absolute
filesystem prohibition — the agent must NEVER write/edit/create any file
under ~/.amico/ during onboarding. The only persistence path is
amicode_profile; if unavailable, nothing is saved (transcript is backup).
3. Tone: rewrote the persona and greeting to be warmer and more conversational.
'Ciao — I'm Amico. Let me get to know you a little so I can be actually
useful from the start.' instead of the transactional 'I'll remember your
setup so we can move fast.'
Also: added tool-unavailability fallback (proceed fresh if amicode_profile
isn't in tool list, never tell user about tool issues).
@jeonghun-jj-lee
jeonghun-jj-leeforce-pushed the profile-onboarding-bridge branch from e4edfc5 to cf607fbCompareAugust 23, 2026 12:22
The overture was drifting off-script — asking about transmon parameters,
generating invalid question calls, and conflating onboarding with the
pulse-designer interview. Root causes:
1. Too many conditional stages (environment, devices, context_seed) gave the
agent room to improvise and branch incorrectly.
2. No explicit scope fence — the agent could see the pulse-designer interview
in the same compiled prompt and sometimes started running it.
3. Free-form guidance ('weave naturally') invited freestyle.
Fix: rewrite to exactly 6 stages with mechanical instructions:
1. orientation (name, role, affiliation)
2. links (scholar, github, custom — all skippable)
3. intent (multi-select)
4. goals (free text)
5. research_area (only if experiments intent — 2 questions)
6. handoff (auto-description + completion marker)
Removed: context_seed (move to a post-onboarding flow), environment, devices
(these are pulse-designer concerns, not profile concerns).
Added a SCOPE FENCE at the top: explicit prohibition on asking about quantum
hardware, Hamiltonians, pulse parameters, etc. Those belong to a different
interview in a different session.
Added a hard STOP fence at the end: after Stage 6, the interview is OVER —
no more questions, no pulse-designer, no suggested next steps beyond 'start
a new session.'
…, not pulse-designer
The compiler was hardcoding '## Pulse-designer interview' as the heading for
ALL compiled scores — including the overture. The agent would see that heading
during onboarding and naturally think it should run a pulse-designer interview.
Fix: compileScore now uses a dynamic heading based on the score id:
- 'overture' → '## Onboarding interview'
- anything else → '## Pulse-designer interview'
Also: added a hidden HTML comment marker (SPLICE_MARKER) so spliceIntoAgentsMd
can locate the section reliably regardless of heading text. Falls back to the
legacy heading for backward compat.
…demand only
The full pulse-designer interview (270 lines of quantum-specific protocol)
was being compiled into EVERY post-onboarding session's AGENTS.md. This
polluted the context for general users and caused the agent to proactively
start pulse-design interviews even when users just wanted to code.
Now: post-onboarding sessions get only the onset router + a minimal stub
that says 'you are a general-purpose autoresearch copilot, do NOT start
domain interviews unless explicitly asked.' The pulse-design workflow is
still available on-demand via the skill system (transmon, atoms, bosonic,
etc.) when the user asks for it.
Also updated the onset router to remove pulse-designer-centric framing:
- Removed the SYSTEM_FIRST_SCORE constant
- 'Design a new pulse' is now described generically (invoke platform skill)
- Router language no longer references 'the interview below'
…mand content
Created skills/design-a-pulse/SKILL.md: the orchestration guide for walking
a user through pulse design (platform → model → formulation → solve → inspect).
It's a thin coordination layer that tells the agent which platform skills to
invoke (transmon, atoms, bosonic, etc.) and what stages to follow.
This replaces the old approach of compiling the full pulse-designer SCORE body
into every session's system prompt. Now it loads on-demand when the user asks
to design a pulse, keeping general sessions lean.
Also updated the onset router to reference the skill by name:
'invoke the design-a-pulse skill for the guided interview.'
Two issues fixed:
1. The amicode_profile plugin tool wasn't loading (the local-built opencode
binary silently failed to import it), so the onboarding agent had no way
to persist answers. Fix: the SCORE now instructs the agent to write
~/.amico/profile.json directly using standard file tools. The plugin tool
is nice-to-have for analytics but no longer the critical path.
2. The link questions (Scholar, GitHub, custom) didn't pre-fill with 'skip',
forcing users to type it. Fix: added `default` field support to the
question schema overlay + UI initialization from it, and the SCORE now
passes `default: "skip"` on each link question.
Changes:
- Grant ~/.amico/** in external_directory permissions (subsumes library,
problems, onboarding — all already under ~/.amico)
- SCORE rewritten: reads/writes ~/.amico/profile.json directly; completion
marker is now a file (~/.amico/amicode/onboarding/completed)
- hasOnboardingCompleted() checks for both the new file marker and the
legacy events.jsonl marker
- QuestionV2 schema overlay + SDK types: added optional `default` field
- session-question-dock.tsx: initializes text input from question.default
- Tests updated to match new SCORE content
@jeonghun-jj-lee
jeonghun-jj-lee marked this pull request as ready for review August 23, 2026 13:50
@jeonghun-jj-lee
jeonghun-jj-lee merged commit 85925d8 into mainAug 23, 2026
7 of 8 checks passed
aarontrowbridge added a commit that referenced this pull request Aug 23, 2026
…#513 drift break) (#531)
* fix(app-bundle): re-extract overlay at fork v1.18.10-amicode.16
Repairs the #513 drift-gate break on main: the overlay hand-edit is
superseded by the fork's canonical question-default implementation
(opencode#232, included in the .16 tag). 80 files added, 63 changed —
the full UI wave (workspace engine, retheme, status-dot semantics,
theme fixes). Round-trip verified: all 502 files byte-identical to the
tag; drift gate PASS.
Closes#530. Fork tag tracked by harmoniqs/opencode#238.
* fix(vendor): pin opencode binary to v1.18.10-amicode.16
Aligns the vendored binary with the app-bundle overlay pin and the
frozen server binary (same fork revision, 77bb1c8b7). Asset hashes
recorded from the release.
* test(goldens): re-record amicode service fixtures at the .16 pin
The contract suite's self-tracking check caught the pin bump — goldens
re-recorded via scripts/record_amicode_fixtures.mjs (71 entries).
* fix(widgets): sync builtin widget sources to the fork's .16 re-theme
The parity suite caught the pin bump's second-order effect: the fork's
re-theme wave (opencode#235) restyled all seven builtin widgets; the
extension's copies lagged. Synced verbatim from the fork's
widgets-src — the fork binary is the parity source of truth.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hitlNeeds human decision or review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@jeonghun-jj-lee
, '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

feat(onboarding): add links stage + bridge onboarding to profile.json - #513

Merged
jeonghun-jj-lee merged 15 commits into
mainfrom
profile-onboarding-bridge
Aug 23, 2026
Merged

feat(onboarding): add links stage + bridge onboarding to profile.json#513
jeonghun-jj-lee merged 15 commits into
mainfrom
profile-onboarding-bridge

Conversation

@jeonghun-jj-lee

@jeonghun-jj-leejeonghun-jj-lee commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Part of harmoniqs/opencode#231

Bridges onboarding data into ~/.amico/profile.json so the new profile dropdown popover (opencode PR #234) is populated immediately after onboarding completes.

Changes

  • ENTITY_FIELDS expandeddescription, research_area, experiment_kind, scholar, github, custom_link_url, custom_link_label no longer silently dropped by sanitizePayload
  • Links stage — new optional stage in the overture asking for Scholar, GitHub, and custom link URLs
  • materializeProfileJson() — on onboarding_completed, replays events stream and writes identity fields to profile.json (additive merge, never clobbers inline edits)
  • Tool description updated — documents all accepted profile fields

Summary by CodeRabbit

  • New Features

    • Added guided pulse-design workflow covering platform selection, modeling, targets, solving, and result review.
    • Onboarding now collects research and profile details, including affiliations and links.
    • Completed onboarding information is saved to the local profile for future sessions.
    • Added editable pre-filled values for text questions.
  • Improvements

    • Improved onboarding resume and completion detection.
    • Updated routing so pulse design and user-provided problems start the appropriate workflow directly.
    • Expanded profile documentation and supported fields.

@jeonghun-jj-leejeonghun-jj-lee added the hitl Needs human decision or review label Aug 23, 2026
@coderabbitai

coderabbitaiBot commented Aug 23, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d7d3fe9e-c9f9-4c1d-a305-5676a5a07fab

📥 Commits

Reviewing files that changed from the base of the PR and between 5011b9b and 16a8afe.

⛔ Files ignored due to path filters (1)
  • packages/app-bundle/overlay/packages/sdk/js/src/v2/gen/types.gen.ts is excluded by !**/gen/**
📒 Files selected for processing (18)
  • packages/app-bundle/overlay/packages/app/src/pages/session/composer/session-question-dock.tsx
  • packages/app-bundle/overlay/packages/schema/src/question.ts
  • packages/app-bundle/overlay/packages/schema/src/v1/question.ts
  • packages/extension/opencode-plugin/amicode_tools.ts
  • packages/extension/opencode-plugin/onboarding.ts
  • packages/extension/scores/overture/SCORE.md
  • packages/extension/skills/design-a-pulse/SKILL.md
  • packages/extension/src/opencode_config.ts
  • packages/extension/src/scores/compiler.ts
  • packages/extension/src/scores/router.ts
  • packages/extension/src/substrate/vault_store.ts
  • packages/extension/test/scores/compiler.test.ts
  • packages/extension/test/scores/golden/compile-chained.md
  • packages/extension/test/scores/golden/compile-score.md
  • packages/extension/test/scores/golden/router-section.md
  • packages/extension/test/scores/overture_rewrite.test.ts
  • packages/extension/test/scores/overture_routing.test.ts
  • packages/extension/test/scores/prep_integration.test.ts

📝 Walkthrough

Walkthrough

The PR adds text-question defaults, rewrites overture onboarding around profile.json and filesystem completion markers, introduces the public design-a-pulse skill, and changes score compilation, routing, session preparation, and completion detection.

Changes

Onboarding and profile persistence

Layer / File(s)Summary
Question defaults
packages/app-bundle/overlay/packages/schema/src/question.ts, packages/app-bundle/overlay/packages/schema/src/v1/question.ts, packages/app-bundle/overlay/packages/app/src/pages/session/composer/session-question-dock.tsx
Question schemas now support optional text defaults. The question dock uses defaults when cached state is absent.
Profile-backed onboarding
packages/extension/scores/overture/SCORE.md, packages/extension/opencode-plugin/onboarding.ts, packages/extension/opencode-plugin/amicode_tools.ts, packages/extension/substrate/vault_store.ts, packages/extension/test/scores/golden/compile-chained.md, packages/extension/test/scores/overture_*
Overture now collects profile data through fixed stages, persists it to profile.json, supports resume and redo behavior, and records completion with a filesystem marker. Completion materializes merged profile data.
Pulse design skill
packages/extension/skills/design-a-pulse/SKILL.md
A public skill now defines platform selection, system modeling, target selection, formulation, solve execution, and run inspection.

Session routing and score compilation

Layer / File(s)Summary
Session orchestration
packages/extension/src/opencode_config.ts, packages/extension/src/substrate/vault_store.ts, packages/extension/test/scores/prep_integration.test.ts
Onboarding runs as a standalone overture. Later sessions inject routing and copilot content instead of a compiled primary score. State access covers the full Amico directory.
Score compilation and routing
packages/extension/src/scores/compiler.ts, packages/extension/src/scores/router.ts, packages/extension/test/scores/compiler.test.ts, packages/extension/test/scores/golden/compile-score.md, packages/extension/test/scores/golden/router-section.md
Compiled scores use a splice marker and dynamic headings. The router sends pulse requests to design-a-pulse, joins supplied problems to matching workflows, and excludes onboarding cards.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
participant Session
participant Router
participant DesignAPulse
participant AmicoTools
Session->>Router: provide live state and opening request
Router->>DesignAPulse: invoke pulse-design workflow
DesignAPulse->>AmicoTools: record staged choices
DesignAPulse-->>Session: report solve or inspection status
Loading

Suggested reviewers:aarontrowbridge

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch profile-onboarding-bridge

Comment @coderabbitai help to get the list of available commands.

- Expand ENTITY_FIELDS.profile to accept description, research_area,
experiment_kind, scholar, github, custom_link_url, custom_link_label
(previously silently dropped by sanitizePayload)
- Add 'links' stage to overture SCORE: asks for Scholar, GitHub, and
custom link URLs (all optional/skippable)
- Add materializeProfileJson(): on onboarding_completed, replay the
events stream and write identity fields to ~/.amico/profile.json
(additive merge — never clobbers fields already set by inline editor)
- Update amicode_profile tool description to document new fields
- Regenerate golden snapshot
Field mapping (onboarding → profile.json):
name → name, role → role, org → affiliation, research_area → focus,
description → description, scholar → scholar, github → github,
custom_link_url + custom_link_label → custom_link: {url, label}
Part of harmoniqs/opencode#231
The overture (generic researcher onboarding) was chained directly into
the pulse-designer interview, forcing quantum-specific questions on all
users immediately after onboarding. This made no sense for a
domain-neutral product.
Now the overture runs standalone. The pulse-designer (or any domain
interview) starts in a subsequent session via the onset router, only
when the user actively chooses it.
- Remove compileChainedScore/chainManifest usage from routing
- shouldOnboard no longer requires score0 (pulse-designer) to be present
- Update routing test to expect standalone overture behavior
… exists
When onboarding runs on a user who already has a complete profile (all of
name, intent, goals present), the overture now asks 'keep my current
profile' or 'start fresh' before proceeding. Prevents the interview from
skipping all stages and doing nothing useful on a redo.
Partial profiles (resumed sessions) still skip answered stages as before.
The question tool requires an options array with label+description for
choice questions. Clarify the SCORE instruction to explicitly specify
the options format so the agent generates valid tool calls.
When events.jsonl is empty/missing (e.g. the agent wrote the profile via
a different path), the bridge now accepts an optional inline profile
payload so profile.json is still written. This closes the edge case where
redo-onboarding clears events.jsonl but the distiller writes the vault
note from session context.
…ol call
The agent was generating invalid question tool calls (missing options
array) because the instruction format was ambiguous. Now includes the
exact JSON payload so the agent produces a valid choice question.
…e intent
Reorder stages so the identity card fields are collected first:
1. orientation: name → role → affiliation (was just name)
2. links: Scholar, GitHub, custom link (was stage 8, now stage 2)
3. context_seed (unchanged)
4. intent (unchanged)
5-9. goals, research_area, environment, devices, handoff (unchanged)
This ensures the profile dropdown is populated with the core identity
fields early in the interview, and link pills are filled before the
more domain-specific questions.
…g path
The agent was bypassing the events pipeline and writing profile data
directly to vault markdown files. This left events.jsonl empty and
profile.json never got written (the dropdown was blank).
Add an explicit HARD RULE in the SCORE body forbidding any path other
than amicode_profile for recording onboarding answers.
…uestions
The question tool schema requires the 'options' key even for kind:'text'
questions (it can be an empty array but must be present). The agent was
omitting it, causing SchemaError. Updated the protocol instruction to
make this explicit.
…ystem writes
Three issues addressed:
1. Jargon leakage: agent was saying 'vault', 'distiller', 'materialize',
'events pipeline' etc. to users during onboarding. Added strict language
rules that ban all internal/infrastructure terms from user-facing dialogue.
2. Filesystem writes: agent was bypassing amicode_profile and writing directly
to ~/.amico/ files (events.jsonl, vault notes, etc.). Added an absolute
filesystem prohibition — the agent must NEVER write/edit/create any file
under ~/.amico/ during onboarding. The only persistence path is
amicode_profile; if unavailable, nothing is saved (transcript is backup).
3. Tone: rewrote the persona and greeting to be warmer and more conversational.
'Ciao — I'm Amico. Let me get to know you a little so I can be actually
useful from the start.' instead of the transactional 'I'll remember your
setup so we can move fast.'
Also: added tool-unavailability fallback (proceed fresh if amicode_profile
isn't in tool list, never tell user about tool issues).
@jeonghun-jj-lee
jeonghun-jj-leeforce-pushed the profile-onboarding-bridge branch from e4edfc5 to cf607fbCompareAugust 23, 2026 12:22
The overture was drifting off-script — asking about transmon parameters,
generating invalid question calls, and conflating onboarding with the
pulse-designer interview. Root causes:
1. Too many conditional stages (environment, devices, context_seed) gave the
agent room to improvise and branch incorrectly.
2. No explicit scope fence — the agent could see the pulse-designer interview
in the same compiled prompt and sometimes started running it.
3. Free-form guidance ('weave naturally') invited freestyle.
Fix: rewrite to exactly 6 stages with mechanical instructions:
1. orientation (name, role, affiliation)
2. links (scholar, github, custom — all skippable)
3. intent (multi-select)
4. goals (free text)
5. research_area (only if experiments intent — 2 questions)
6. handoff (auto-description + completion marker)
Removed: context_seed (move to a post-onboarding flow), environment, devices
(these are pulse-designer concerns, not profile concerns).
Added a SCOPE FENCE at the top: explicit prohibition on asking about quantum
hardware, Hamiltonians, pulse parameters, etc. Those belong to a different
interview in a different session.
Added a hard STOP fence at the end: after Stage 6, the interview is OVER —
no more questions, no pulse-designer, no suggested next steps beyond 'start
a new session.'
…, not pulse-designer
The compiler was hardcoding '## Pulse-designer interview' as the heading for
ALL compiled scores — including the overture. The agent would see that heading
during onboarding and naturally think it should run a pulse-designer interview.
Fix: compileScore now uses a dynamic heading based on the score id:
- 'overture' → '## Onboarding interview'
- anything else → '## Pulse-designer interview'
Also: added a hidden HTML comment marker (SPLICE_MARKER) so spliceIntoAgentsMd
can locate the section reliably regardless of heading text. Falls back to the
legacy heading for backward compat.
…demand only
The full pulse-designer interview (270 lines of quantum-specific protocol)
was being compiled into EVERY post-onboarding session's AGENTS.md. This
polluted the context for general users and caused the agent to proactively
start pulse-design interviews even when users just wanted to code.
Now: post-onboarding sessions get only the onset router + a minimal stub
that says 'you are a general-purpose autoresearch copilot, do NOT start
domain interviews unless explicitly asked.' The pulse-design workflow is
still available on-demand via the skill system (transmon, atoms, bosonic,
etc.) when the user asks for it.
Also updated the onset router to remove pulse-designer-centric framing:
- Removed the SYSTEM_FIRST_SCORE constant
- 'Design a new pulse' is now described generically (invoke platform skill)
- Router language no longer references 'the interview below'
…mand content
Created skills/design-a-pulse/SKILL.md: the orchestration guide for walking
a user through pulse design (platform → model → formulation → solve → inspect).
It's a thin coordination layer that tells the agent which platform skills to
invoke (transmon, atoms, bosonic, etc.) and what stages to follow.
This replaces the old approach of compiling the full pulse-designer SCORE body
into every session's system prompt. Now it loads on-demand when the user asks
to design a pulse, keeping general sessions lean.
Also updated the onset router to reference the skill by name:
'invoke the design-a-pulse skill for the guided interview.'
Two issues fixed:
1. The amicode_profile plugin tool wasn't loading (the local-built opencode
binary silently failed to import it), so the onboarding agent had no way
to persist answers. Fix: the SCORE now instructs the agent to write
~/.amico/profile.json directly using standard file tools. The plugin tool
is nice-to-have for analytics but no longer the critical path.
2. The link questions (Scholar, GitHub, custom) didn't pre-fill with 'skip',
forcing users to type it. Fix: added `default` field support to the
question schema overlay + UI initialization from it, and the SCORE now
passes `default: "skip"` on each link question.
Changes:
- Grant ~/.amico/** in external_directory permissions (subsumes library,
problems, onboarding — all already under ~/.amico)
- SCORE rewritten: reads/writes ~/.amico/profile.json directly; completion
marker is now a file (~/.amico/amicode/onboarding/completed)
- hasOnboardingCompleted() checks for both the new file marker and the
legacy events.jsonl marker
- QuestionV2 schema overlay + SDK types: added optional `default` field
- session-question-dock.tsx: initializes text input from question.default
- Tests updated to match new SCORE content
@jeonghun-jj-lee
jeonghun-jj-lee marked this pull request as ready for review August 23, 2026 13:50
@jeonghun-jj-lee
jeonghun-jj-lee merged commit 85925d8 into mainAug 23, 2026
7 of 8 checks passed
aarontrowbridge added a commit that referenced this pull request Aug 23, 2026
…#513 drift break) (#531)
* fix(app-bundle): re-extract overlay at fork v1.18.10-amicode.16
Repairs the #513 drift-gate break on main: the overlay hand-edit is
superseded by the fork's canonical question-default implementation
(opencode#232, included in the .16 tag). 80 files added, 63 changed —
the full UI wave (workspace engine, retheme, status-dot semantics,
theme fixes). Round-trip verified: all 502 files byte-identical to the
tag; drift gate PASS.
Closes#530. Fork tag tracked by harmoniqs/opencode#238.
* fix(vendor): pin opencode binary to v1.18.10-amicode.16
Aligns the vendored binary with the app-bundle overlay pin and the
frozen server binary (same fork revision, 77bb1c8b7). Asset hashes
recorded from the release.
* test(goldens): re-record amicode service fixtures at the .16 pin
The contract suite's self-tracking check caught the pin bump — goldens
re-recorded via scripts/record_amicode_fixtures.mjs (71 entries).
* fix(widgets): sync builtin widget sources to the fork's .16 re-theme
The parity suite caught the pin bump's second-order effect: the fork's
re-theme wave (opencode#235) restyled all seven builtin widgets; the
extension's copies lagged. Synced verbatim from the fork's
widgets-src — the fork binary is the parity source of truth.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hitlNeeds human decision or review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@jeonghun-jj-lee