[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M759WBYZXZRFSAN859ZKRQMT":3,"skill-same:01M759WBYZXZRFSAN859ZKRQMT":61},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":41,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":44,"ownerDescription":45,"updatedAt":46,"install":47,"resources":60},"01M759WBYZXZRFSAN859ZKRQMT","research",null,"The research mode's director loop protocol — session-ledger discipline, the hypothesizer\u002Fexperimenter\u002Fanalyzer trio, deliberate spec gates, checkout registry, and compaction-any-time safety. Use when starting, running, or resuming a research loop. (The mode and this skill renamed from `autoresearch` per the three-mode surface; old ids read-resolve to `research`.)","harmoniqs\u002Famicode","harmoniqs","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F199011497?v=4","01M759PQCJ9Y093EC5HC3344DW","Harmoniqs","01M759PQD5S85W68FZKV3XD1X0",7,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fharmoniqs\u002Famicode\u002Fblob\u002Fmain\u002Fpackages\u002Fextension\u002Fskills\u002Fresearch\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: research\ndescription: The research mode's director loop protocol — session-ledger discipline, the hypothesizer\u002Fexperimenter\u002Fanalyzer trio, deliberate spec gates, checkout registry, and compaction-any-time safety. Use when starting, running, or resuming a research loop. (The mode and this skill renamed from `autoresearch` per the three-mode surface; old ids read-resolve to `research`.)\nagents: [hypothesizer, experimenter, analyzer]\nsurface: public\nproject_contract:\n  folders: [ledger\u002Fhypotheses, ledger\u002Fobservations, ledger\u002Fcampaigns, scripts, data, reports, config]\n---\n\n# Research — the director's protocol\n\n> **Install conventions** — this skill operates on a **Research Project** (detected by\n> `research-project.toml` in the workspace). All load-bearing state — campaign ledgers,\n> hypotheses, observations, specs, scripts, data, and reports — lives in the project\n> directory. The protocol is engine- and install-neutral; bindings for a given engine stay\n> engine-side (the opencode binding of the director role is the `research` primary\n> agent card).\n\n**Entry points:** the `research` primary agent (Tab-switch into research mode —\nits prompt embeds this spine), direct invocation of this skill, or the standing line in\nthe user's research kickoff prompts. All three lead here; this file is the protocol.\n\nThe operating principle: **the context window is a cache; the project is the database.**\nEvery piece of load-bearing state lives in project files — campaign ledgers, hypotheses,\nobservations, scripts. The context window holds only the working set. Compaction (manual\nor auto) then costs nothing but a cache refill.\n\n## Project paths\n\nAll artifacts live inside the Research Project directory. The `## Active Research Project`\nblock in the system prompt (injected by `stack_state.ts` when a workspace folder has\n`research-project.toml`) confirms the project root.\n\n| Artifact | Path |\n|----------|------|\n| Campaign ledger | `\u003Cproject>\u002Fledger\u002Fcampaigns\u002Fcampaign-\u003CYYYYMMDD>-\u003Cslug>.md` |\n| Hypotheses | `\u003Cproject>\u002Fledger\u002Fhypotheses\u002F` |\n| Observations | `\u003Cproject>\u002Fledger\u002Fobservations\u002F` |\n| Spec cards | `\u003Cproject>\u002Fconfig\u002Fspecs\u002F` |\n| Experiment scripts | `\u003Cproject>\u002Fscripts\u002Fexperiment\u002F` — optimization solves, gate synthesis |\n| Analysis scripts | `\u003Cproject>\u002Fscripts\u002Fanalysis\u002F` — post-processing, plotting, comparison |\n| Testbed | `\u003Cproject>\u002Fscripts\u002Ftestbed\u002F` — simulated gym environments, hardware interfaces |\n| Data | `\u003Cproject>\u002Fdata\u002F` |\n| Config | `\u003Cproject>\u002Fconfig\u002F` |\n| Reports | `\u003Cproject>\u002Freports\u002F` |\n| Campaign dashboard | `\u003Cproject>\u002Freports\u002Fdashboards\u002F\u003Cledger-stem>\u002Findex.html` (see below) |\n| Checkout registry | `\u003Cproject>\u002Fledger\u002Fcampaigns\u002FCHECKOUTS.md` |\n| Environment proposals | `\u003Cproject>\u002Fledger\u002Fenvironment-proposals\u002F` (created on demand) |\n| Environment digest | `\u003Cproject>\u002Fledger\u002Fcampaigns\u002Fenv-digest-\u003Ccampaign-slug>.md` |\n\n## Research Environment integration (#890)\n\nWhen the project is bound to a Research Environment (the `## Active Research\nEnvironment` block appears in the system prompt), the environment provides\nshared knowledge, code, and configuration across sibling projects.\n\n### Environment digest assembly\n\nAt campaign **kickoff**, assemble an environment digest:\n\n1. Read the environment manifest (`research-environment.toml`) — note `[domain]` fields\n   and the `[paths]` section (directory names may be overridden).\n2. Scan environment directories — `insights\u002F`, `methods\u002F`, `context\u002F`, `literature\u002F`,\n   `results\u002F`, `templates\u002F`, `config\u002F`, `lib\u002F`, `experiments\u002F` — using names from `[paths]`\n   when overridden.\n3. Filter by relevance: match the manifest `[domain]` + project `tags` + campaign objective.\n   This filtering is judgment-based, not programmatic.\n4. Write the digest to `\u003Cproject>\u002Fledger\u002Fcampaigns\u002Fenv-digest-\u003Ccampaign-slug>.md`.\n5. Include: relevant insights, methods, sibling project summaries, results candidates,\n   context notes. Add an excluded appendix listing what was omitted and why.\n6. If the campaign ledger §1 contains a `digest_include` list, force those notes into the\n   digest regardless of filtering.\n\n**Update the digest at each loop boundary** — new environment content may have arrived.\n\n### Subagent briefs with environment paths\n\nWhen briefing subagents and the project is bound to an environment, include these fields:\n\n| Role | Fields in brief |\n|------|----------------|\n| **Hypothesizer** | `env_digest_path` — read the digest for cross-project context and provenance |\n| **Experimenter** | `env_digest_path`, `env_lib_path`, `env_lib_importable` (false until deferred), `env_templates_path`, `env_config_path`, `env_context_path` |\n| **Analyzer** | `env_digest_path` — read the digest; may propose environment insight proposals |\n\nAll paths respect `[paths]` overrides from the environment manifest.\n\nWhen the project has **no environment binding**, omit these fields entirely (do not pass\nempty strings or null values).\n\n### Per-iteration staging\n\nAt each loop boundary (after the analyzer returns):\n\n1. **Stage project card update** — if the project's `research-project.toml` status changed\n   or best results improved, update the card.\n2. **Stage insight proposals** — the analyzer may produce structured insight proposals\n   (YAML frontmatter with `type: insight`, `visibility: environment`). Write them to\n   `\u003Cproject>\u002Fledger\u002Fenvironment-proposals\u002F`. They are candidates for `amico env promote`.\n\n### Promotion suggestion\n\nAt campaign boundaries (when the campaign objective is met or the loop closes), suggest\nrunning `amico env promote` on any staged proposals in `ledger\u002Fenvironment-proposals\u002F`.\n\n## The campaign ledger (create at kickoff, before any work)\n\nPath: `\u003Cproject>\u002Fledger\u002Fcampaigns\u002Fcampaign-\u003CYYYYMMDD>-\u003Cslug>.md` — this project-local ledger serves Research-Project-scoped work and reconciles to the **session ledger** in the personal vault (`sessions\u002Fsession-\u003CYYYYMMDD>-\u003Cslug>.md`, per `director-core`'s discovery rule) at each loop boundary. Nine sections, in order:\n\n1. Objective & standing directives\n2. Hypothesis ledger (H# → verdict → evidence → wiki-links)\n3. Active work — every in-flight item, INCLUDING uncommitted per-file diff state AND every\n   in-flight subagent cast (role, session id, spec id, assigned env, expected artifacts)\n4. Blocked & reasons\n5. Next queue\n6. Checkout topology (mirror of this session's rows in `ledger\u002Fcampaigns\u002FCHECKOUTS.md`)\n7. Gotchas & methodology\n8. Loop log (append-only, one row per loop: date, H#, spec_id, review verdict, plan hash,\n   experimenter session id, gate verdicts, advisory closures)\n9. Compaction log (append-only: timestamp, auto\u002Fmanual, messages dropped, summary audit)\n\n**Update triggers — all of them:** kickoff; every loop boundary; **immediately BEFORE\ncasting any experimenter** (record the cast — a compaction mid-flight must be able to learn\nfrom the ledger what is in the air and where its artifacts will land); immediately before\nany manual `\u002Fcompact`; at pause\u002Fhandoff.\n\n**First action after ANY compaction: re-read the ledger from disk, then audit the summary\nagainst it** — does the summary name the ledger path, carry the current H-verdict table,\nreference the in-flight casts? Append the audit row to §9.\n\n## The loop (one iteration)\n\n1. **Re-read the ledger** — from disk, never from memory.\n2. **Hypothesis queue thin?** Cast the **hypothesizer** (read-only subagent): ranked\n   hypotheses + a spec-card draft. Parent picks the winner. The hypothesizer reads\n   the findings ledger (`amicode\u002Fskills-integrity\u002F`, personal vault) as a prior —\n   known-bad recipes don't become proposed approaches.\n3. **Spec gate (deliberate):** file the spec card to `\u003Cproject>\u002Fconfig\u002Fspecs\u002F`, run\n   `amico spec review \u003Cpath>` — resolve blocking findings, re-run (round budget 3).\n   `--allow-unreviewed` is FORBIDDEN for launch-shaped work (spends compute); if compile\n   refuses for want of review, the fix is to review, never the flag.\n4. **Ledger the cast, THEN cast the experimenter** (one experiment per spec, assigned env\n   per `ledger\u002Fcampaigns\u002FCHECKOUTS.md`; claim the checkout row first). Parallel experimenters only\n   where the registry says files are disjoint.\n5. **Run the gates yourself (parent, via bash):** test suites, `amico plan status` where a\n   compiled plan exists. Verdicts are DERIVED, never self-reported. No LLM — including\n   you — judges a fidelity claim; LLM judgment is confined to drafting criteria and\n   interpreting results, adversarially reviewed, human-owned at promotion.\n6. **Cast the analyzer** (read-only): raw-artifact-grounded insights, a proposed ledger\n   delta, next-hypothesis seeds. The analyzer's duties include the skill-friction\n   check: scan raw artifacts for instructions-vs-reality mismatches (→ finding) and\n   repeated un-skilled idioms (→ `proposal`-type finding, a new-skill candidate,\n   provenance-tagged with sessions\u002Fartifacts).\n7. **Commit the ledger update** (sole writer): H-table row, loop-log row, §3 state, next\n   queue. Close every advisory (fixed \u002F waived-with-reason \u002F obsolete) and record closures.\n   The update also carries the campaign's **skill delta** row — findings filed, skills\n   touched, proposals pending — so the loop's own improvement is part of its record.\n   Rewrite the session todo list to mirror §3 and §5 — the derived-view rule in\n   `director-core`: current loop only; a stale todo list is a lying §3.\n   Rewrite the campaign dashboard from the ledger you just committed (below).\n8. **Repeat.** Compact only at a boundary, and only when the user is present to choose it —\n   the protocol does not otherwise try to time compaction (see below).\n\n## The campaign dashboard (live status page)\n\nOne static HTML page per campaign that the researcher watches instead of the chat. It is\na **derived view of the ledger** — rewrite it whole at kickoff and at every record step\n(and when a cast starts or blocks), never hand-edit it, never let it say more than the\nledger does.\n\n**Where:** inside a Research Project, `\u003Cproject>\u002Freports\u002Fdashboards\u002F\u003Cledger-stem>\u002Findex.html`;\notherwise `~\u002F.amico\u002Fdashboards\u002F\u003Cledger-stem>\u002Findex.html` (local, never the vault — plot\nchurn does not belong in a synced repo). `\u003Cledger-stem>` is the ledger's file name without\n`.md`. Plots go in `plots\u002F` beside the page and are referenced relatively\n(`\u003Cimg src=\"plots\u002Fh3-convergence.png\">`).\n\n**Sections, top to bottom:**\n\n1. **Status line** — the objective in one line; phase, loop number, last-updated time\n   (ISO, with timezone), and one state word: running, waiting, blocked, or done.\n2. **Needs you** — §4 blocked items, pending approvals and open human gates, each with\n   what is needed. When empty, say \"Nothing — running unattended\".\n3. **Loop table** — one row per H#: spec, cast in flight, verdict copied from the ledger\n   (derived, never upgraded), and a link to the evidence.\n4. **Key findings** — short bullets with the numbers in the researcher's notation; an\n   unverified result says UNTRUSTED.\n5. **Plots** — the current loop's figures, newest first, each with a one-line caption.\n6. Log — newest first, one line per event, trimmed to the last ~30.\n\n**Static only.** Preview renders the page in a sandbox with no scripts: no scripts, no CDN\nlibraries (Plotly, MathJax), no meta refresh, no external stylesheets. Use inline CSS,\ntables, inline SVG, and PNG\u002FSVG files in `plots\u002F`. Keep the page under 1 MB. Preview reloads\nit when the file changes, so a rewrite is the refresh.\n\n**Link it once.** After the first write, post the page as a `file:\u002F\u002F` link in chat\n(`[campaign dashboard](file:\u002F\u002F\u002Fabs\u002Fpath\u002Findex.html)`); one click opens it in Preview, where\nit stays live, and its \"Open in browser\" control pops it out for a second monitor. Do not\nre-post the link every loop.\n\n## Roles at a glance\n\n| Role | Subagent | Briefed with | Returns | Never |\n|---|---|---|---|---|\n| hypothesizer | read-only (edit+bash denied) | objective, ledger path | ranked hypotheses + spec card | executes anything |\n| experimenter | full access, one spec | reviewed spec, env assignment, note path | numbers-only debrief + own experiment note | touches ledger; grades itself |\n| analyzer | read-only (edit+bash denied) | note + RAW artifact paths, gate verdicts | ledger-delta proposal + next seeds | writes; decides |\n\nEnforcement honesty: the two read-only roles are permission-isolated; the experimenter's\nledger-abstinence is discipline + git history. The parent is the SOLE ledger writer.\n\n## Deliberate integration — current tooling state (honest)\n\n- `amico spec review` WORKS on this box: tier-1 mechanical lenses always; judgment critics\n  when a critic binary is available — when the verdict is `approved-mechanical`, say so,\n  and weigh a manual critic round (independent read-only subagents, one lens each:\n  consistency \u002F ops failure modes \u002F trust & anti-gaming) for anything load-bearing.\n- `amico plan compile` currently FAILS on this box (no `$AMICO_CRITIC_BIN` \u002F agent CLI).\n  Degraded path until it lands: the reviewed spec + parent-tracked steps in the ledger's\n  loop log stand in for the compiled plan; gate verdicts still come from real commands\n  (test suites, verification scripts), never from the experimenter's say-so.\n- **Probe\u002Fexperiment boundary (mechanical):** read-only ops and bounded side-effect-free\n  one-liners (\u003C ~1 min, writes nothing durable, no solve, no test suite) are probes — no\n  spec. Writes a durable file, launches a solve, or runs a test suite → experiment → spec.\n  Audit rule: a probe whose result is cited in the loop log as experiment evidence was\n  misclassified — record the misclassification when caught.\n\n## Handoffs (cross-mode seeds)\n\nThe research pack closes by handing an **issue seed** to `develop` (its pack's\nclosing handoff); this mode RECEIVES a **hypothesis seed** from `develop`.\nThe procedure, both directions:\n\n- **Receiving (develop → research):** the seed is a typed note\n  (`kind: hypothesis`, the hypothesis-seed schema — the question, the\n  evidence, the suggested experiment shape). On the seed: re-read the ledger,\n  register the hypothesis in the H-queue (§2), and run the loop above on it.\n- **Emitting (research → develop):** when a campaign closes with a\n  finding that needs code (a validated method, a tool gap, a result that\n  wants an implementation), write the issue-seed note — title, motivation,\n  evidence pointers, suggested repo + tier — name the target posture\n  (develop), and hand it over; the receiving mode's protocol (the `develop`\n  skill) renders it through `write-an-issue` and runs the dev walk on it.\n- **Switching modes mid-session is not yet specified; the mode cards'\n  posture-honesty sections govern until it is.** Until the fork's posture\n  surfaces ship, the safe path is to spawn or open the target posture's\n  session on the seed rather than switching in place; the ledger discovery\n  rule holds either way. Seed-write failures are reported in-chat — never\n  silently dropped.\n\n## Compaction honesty\n\nThe agent cannot observe its own context usage, and auto-compact fires on a token threshold\nwith no phase awareness — it WILL fire mid-experiment, unattended. The protocol does not\npretend to time it; it makes any compaction safe at any moment: ledger current at every\nboundary including before every cast; in-flight casts recorded with artifact destinations;\nexperimenter work products are files (a parent compaction cannot destroy an in-flight\nexperiment, only the parent's own working notes); re-read + audit after every compaction.\n\n## Parallel sessions & shared checkouts\n\n`ledger\u002Fcampaigns\u002FCHECKOUTS.md` is the project-wide claim registry. Re-read it before\ncasting any experimenter; claim your row; release it when work lands. First-writer-wins;\nraces are possible and visible — a visible conflict beats a silent double-ownership every\ntime.\n\nPinned scratch harnesses rot between loops: \u002Ftmp trees get cleaned, and shared depots garbage-collect pinned package trees. Before re-using one, verify the worktree SHAs and clean status, check every Manifest tree hash is present, instantiate if not, and assert the Manifest is byte-unchanged afterwards (never resolve). Record this in the run's env log.\n\n## Standing anti-gaming contract\n\nProduction `step` paths only for A\u002FB loop experiments; CRN pairing with f=0-style\ninvariants; impossibility checks on noise denominators; FD sanity gates on derived\nquantities; raw artifacts are the evidence, prose is not. Promotion of any result to\ncatalog\u002Fstatus is human-only, always.\n\n**Every measured axis carries its own wiring gate** (2026-10, three measured instances:\nloop-3 playback-unwired, loop-6 detuning-axis-unwired, loop-10's S2-objective probe) — an\nunwired axis returns 0s (or a unit-slip returns ~0.5) and banks a wrong verdict with every\nother gate green. A spec whose axis lacks a positive wiring check (loader reproduction,\nmonotonicity, a closed-form anchor cell) is an incomplete spec; critics reject on this\nclass. Bonus idiom: a symmetric ±σ telegraph arm's MEAN equals the closed-form single-node\ncost exactly — a free wiring validator for detuning axes. Analyzer findings are verified by\nthe director before being applied (2026-10, a factually-wrong receipts finding was caught);\na critic's arithmetic is never trusted over the test file's machine-pinned literals.\n\n- **Score corrections out of sample.** Under drift drawn fresh each round, a correction fitted at round k and scored at round k is in-sample. Report the one-step-ahead score F(k+1) − F_do-nothing(k+1) beside it. One campaign's entire arm ordering turned out to rank least harm: every arm was worse than doing nothing on 8\u002F8 seeds. Always carry a do-nothing reference, and pair by seed, because pooled medians can reverse paired orderings.\n- **Keep every STOP artifact** (rename it `*_STOP`; never delete it). An extra check an experimenter adds is a record, never a pass condition. An unregistered gate is a spec deviation even when it is caught.\n- **Run-mode tokens live only in filenames.** Determinism twins must not carry `_det` (or any pass marker) in their content. After the det pass, `grep -F _det` over twinned content must come back empty. This defect broke byte-identity four times in one campaign.\n- **Interpretation waits for the analyzer.** The director records a mechanical label at the gate. Its meaning (recommendations, mechanism claims) lands only after the read-only analysis of the raw artifacts.\n\n## Failure modes to watch\n\n- **The thin brief** — a subagent with a fresh context and a vague brief rediscovers\n  everything the hard way. Briefs point at files (ledger, notes, specs), never paste prose.\n- **The stale ledger** — if §3's uncommitted state is older than the last edit on disk, the\n  ledger is lying; refresh it before acting on it.\n- **EXHAUSTED debriefs** — an experimenter that hit its step cap reports `EXHAUSTED:`;\n  that's an open loop in §5, never an outcome in §2.\n- **Summary drift** — after each compaction, the audit in §9 is the check that the summary\n  still points HERE rather than becoming a competing source of truth.\n- **The silent no-op edit** — programmatic edits that report success but never matched\n  (six measured instances, 2026-10): every edit asserts its pattern and grep-verifies the\n  critical line; before `git add -A`, inspect status and account for every path (silent\n  subagent failures leave partial state that a blind add commits); after multi-edit\n  confusion, rewrite clean and let git arbitrate.\n- **Unattended runs** — plain `nohup` backgrounds die at tool-call exit in sandboxed\n  harnesses; `setsid` survives (measured both ways). Chain unattended cells through a\n  driver script; commit the state to the ledger BEFORE the night starts so any compaction\n  is safe.\n","# Research — the director's protocol\n\n> **Install conventions** — this skill operates on a **Research Project** (detected by\n> `research-project.toml` in the workspace). All load-bearing state — campaign ledgers,\n> hypotheses, observations, specs, scripts, data, and reports — lives in the project\n> directory. The protocol is engine- and install-neutral; bindings for a given engine stay\n> engine-side (the opencode binding of the director role is the `research` primary\n> agent card).\n\n**Entry points:** the `research` primary agent (Tab-switch into research mode —\nits prompt embeds this spine), direct invocation of this skill, or the standing line in\nthe user's research kickoff prompts. All three lead here; this file is the protocol.\n\nThe operating principle: **the context window is a cache; the project is the database.**\nEvery piece of load-bearing state lives in project files — campaign ledgers, hypotheses,\nobservations, scripts. The context window holds only the working set. Compaction (manual\nor auto) then costs nothing but a cache refill.\n\n## Project paths\n\nAll artifacts live inside the Research Project directory. The `## Active Research Project`\nblock in the system prompt (injected by `stack_state.ts` when a workspace folder has\n`research-project.toml`) confirms the project root.\n\n| Artifact | Path |\n|----------|------|\n| Campaign ledger | `\u003Cproject>\u002Fledger\u002Fcampaigns\u002Fcampaign-\u003CYYYYMMDD>-\u003Cslug>.md` |\n| Hypotheses | `\u003Cproject>\u002Fledger\u002Fhypotheses\u002F` |\n| Observations | `\u003Cproject>\u002Fledger\u002Fobservations\u002F` |\n| Spec cards | `\u003Cproject>\u002Fconfig\u002Fspecs\u002F` |\n| Experiment scripts | `\u003Cproject>\u002Fscripts\u002Fexperiment\u002F` — optimization solves, gate synthesis |\n| Analysis scripts | `\u003Cproject>\u002Fscripts\u002Fanalysis\u002F` — post-processing, plotting, comparison |\n| Testbed | `\u003Cproject>\u002Fscripts\u002Ftestbed\u002F` — simulated gym environments, hardware interfaces |\n| Data | `\u003Cproject>\u002Fdata\u002F` |\n| Config | `\u003Cproject>\u002Fconfig\u002F` |\n| Reports | `\u003Cproject>\u002Freports\u002F` |\n| Campaign dashboard | `\u003Cproject>\u002Freports\u002Fdashboards\u002F\u003Cledger-stem>\u002Findex.html` (see below) |\n| Checkout registry | `\u003Cproject>\u002Fledger\u002Fcampaigns\u002FCHECKOUTS.md` |\n| Environment proposals | `\u003Cproject>\u002Fledger\u002Fenvironment-proposals\u002F` (created on demand) |\n| Environment digest | `\u003Cproject>\u002Fledger\u002Fcampaigns\u002Fenv-digest-\u003Ccampaign-slug>.md` |\n\n## Research Environment integration (#890)\n\nWhen the project is bound to a Research Environment (the `## Active Research\nEnvironment` block appears in the system prompt), the environment provides\nshared knowledge, code, and configuration across sibling projects.\n\n### Environment digest assembly\n\nAt campaign **kickoff**, assemble an environment digest:\n\n1. Read the environment manifest (`research-environment.toml`) — note `[domain]` fields\n   and the `[paths]` section (directory names may be overridden).\n2. Scan environment directories — `insights\u002F`, `methods\u002F`, `context\u002F`, `literature\u002F`,\n   `results\u002F`, `templates\u002F`, `config\u002F`, `lib\u002F`, `experiments\u002F` — using names from `[paths]`\n   when overridden.\n3. Filter by relevance: match the manifest `[domain]` + project `tags` + campaign objective.\n   This filtering is judgment-based, not programmatic.\n4. Write the digest to `\u003Cproject>\u002Fledger\u002Fcampaigns\u002Fenv-digest-\u003Ccampaign-slug>.md`.\n5. Include: relevant insights, methods, sibling project summaries, results candidates,\n   context notes. Add an excluded appendix listing what was omitted and why.\n6. If the campaign ledger §1 contains a `digest_include` list, force those notes into the\n   digest regardless of filtering.\n\n**Update the digest at each loop boundary** — new environment content may have arrived.\n\n### Subagent briefs with environment paths\n\nWhen briefing subagents and the project is bound to an environment, include these fields:\n\n| Role | Fields in brief |\n|------|----------------|\n| **Hypothesizer** | `env_digest_path` — read the digest for cross-project context and provenance |\n| **Experimenter** | `env_digest_path`, `env_lib_path`, `env_lib_importable` (false until deferred), `env_templates_path`, `env_config_path`, `env_context_path` |\n| **Analyzer** | `env_digest_path` — read the digest; may propose environment insight proposals |\n\nAll paths respect `[paths]` overrides from the environment manifest.\n\nWhen the project has **no environment binding**, omit these fields entirely (do not pass\nempty strings or null values).\n\n### Per-iteration staging\n\nAt each loop boundary (after the analyzer returns):\n\n1. **Stage project card update** — if the project's `research-project.toml` status changed\n   or best results improved, update the card.\n2. **Stage insight proposals** — the analyzer may produce structured insight proposals\n   (YAML frontmatter with `type: insight`, `visibility: environment`). Write them to\n   `\u003Cproject>\u002Fledger\u002Fenvironment-proposals\u002F`. They are candidates for `amico env promote`.\n\n### Promotion suggestion\n\nAt campaign boundaries (when the campaign objective is met or the loop closes), suggest\nrunning `amico env promote` on any staged proposals in `ledger\u002Fenvironment-proposals\u002F`.\n\n## The campaign ledger (create at kickoff, before any work)\n\nPath: `\u003Cproject>\u002Fledger\u002Fcampaigns\u002Fcampaign-\u003CYYYYMMDD>-\u003Cslug>.md` — this project-local ledger serves Research-Project-scoped work and reconciles to the **session ledger** in the personal vault (`sessions\u002Fsession-\u003CYYYYMMDD>-\u003Cslug>.md`, per `director-core`'s discovery rule) at each loop boundary. Nine sections, in order:\n\n1. Objective & standing directives\n2. Hypothesis ledger (H# → verdict → evidence → wiki-links)\n3. Active work — every in-flight item, INCLUDING uncommitted per-file diff state AND every\n   in-flight subagent cast (role, session id, spec id, assigned env, expected artifacts)\n4. Blocked & reasons\n5. Next queue\n6. Checkout topology (mirror of this session's rows in `ledger\u002Fcampaigns\u002FCHECKOUTS.md`)\n7. Gotchas & methodology\n8. Loop log (append-only, one row per loop: date, H#, spec_id, review verdict, plan hash,\n   experimenter session id, gate verdicts, advisory closures)\n9. Compaction log (append-only: timestamp, auto\u002Fmanual, messages dropped, summary audit)\n\n**Update triggers — all of them:** kickoff; every loop boundary; **immediately BEFORE\ncasting any experimenter** (record the cast — a compaction mid-flight must be able to learn\nfrom the ledger what is in the air and where its artifacts will land); immediately before\nany manual `\u002Fcompact`; at pause\u002Fhandoff.\n\n**First action after ANY compaction: re-read the ledger from disk, then audit the summary\nagainst it** — does the summary name the ledger path, carry the current H-verdict table,\nreference the in-flight casts? Append the audit row to §9.\n\n## The loop (one iteration)\n\n1. **Re-read the ledger** — from disk, never from memory.\n2. **Hypothesis queue thin?** Cast the **hypothesizer** (read-only subagent): ranked\n   hypotheses + a spec-card draft. Parent picks the winner. The hypothesizer reads\n   the findings ledger (`amicode\u002Fskills-integrity\u002F`, personal vault) as a prior —\n   known-bad recipes don't become proposed approaches.\n3. **Spec gate (deliberate):** file the spec card to `\u003Cproject>\u002Fconfig\u002Fspecs\u002F`, run\n   `amico spec review \u003Cpath>` — resolve blocking findings, re-run (round budget 3).\n   `--allow-unreviewed` is FORBIDDEN for launch-shaped work (spends compute); if compile\n   refuses for want of review, the fix is to review, never the flag.\n4. **Ledger the cast, THEN cast the experimenter** (one experiment per spec, assigned env\n   per `ledger\u002Fcampaigns\u002FCHECKOUTS.md`; claim the checkout row first). Parallel experimenters only\n   where the registry says files are disjoint.\n5. **Run the gates yourself (parent, via bash):** test suites, `amico plan status` where a\n   compiled plan exists. Verdicts are DERIVED, never self-reported. No LLM — including\n   you — judges a fidelity claim; LLM judgment is confined to drafting criteria and\n   interpreting results, adversarially reviewed, human-owned at promotion.\n6. **Cast the analyzer** (read-only): raw-artifact-grounded insights, a proposed ledger\n   delta, next-hypothesis seeds. The analyzer's duties include the skill-friction\n   check: scan raw artifacts for instructions-vs-reality mismatches (→ finding) and\n   repeated un-skilled idioms (→ `proposal`-type finding, a new-skill candidate,\n   provenance-tagged with sessions\u002Fartifacts).\n7. **Commit the ledger update** (sole writer): H-table row, loop-log row, §3 state, next\n   queue. Close every advisory (fixed \u002F waived-with-reason \u002F obsolete) and record closures.\n   The update also carries the campaign's **skill delta** row — findings filed, skills\n   touched, proposals pending — so the loop's own improvement is part of its record.\n   Rewrite the session todo list to mirror §3 and §5 — the derived-view rule in\n   `director-core`: current loop only; a stale todo list is a lying §3.\n   Rewrite the campaign dashboard from the ledger you just committed (below).\n8. **Repeat.** Compact only at a boundary, and only when the user is present to choose it —\n   the protocol does not otherwise try to time compaction (see below).\n\n## The campaign dashboard (live status page)\n\nOne static HTML page per campaign that the researcher watches instead of the chat. It is\na **derived view of the ledger** — rewrite it whole at kickoff and at every record step\n(and when a cast starts or blocks), never hand-edit it, never let it say more than the\nledger does.\n\n**Where:** inside a Research Project, `\u003Cproject>\u002Freports\u002Fdashboards\u002F\u003Cledger-stem>\u002Findex.html`;\notherwise `~\u002F.amico\u002Fdashboards\u002F\u003Cledger-stem>\u002Findex.html` (local, never the vault — plot\nchurn does not belong in a synced repo). `\u003Cledger-stem>` is the ledger's file name without\n`.md`. Plots go in `plots\u002F` beside the page and are referenced relatively\n(`\u003Cimg src=\"plots\u002Fh3-convergence.png\">`).\n\n**Sections, top to bottom:**\n\n1. **Status line** — the objective in one line; phase, loop number, last-updated time\n   (ISO, with timezone), and one state word: running, waiting, blocked, or done.\n2. **Needs you** — §4 blocked items, pending approvals and open human gates, each with\n   what is needed. When empty, say \"Nothing — running unattended\".\n3. **Loop table** — one row per H#: spec, cast in flight, verdict copied from the ledger\n   (derived, never upgraded), and a link to the evidence.\n4. **Key findings** — short bullets with the numbers in the researcher's notation; an\n   unverified result says UNTRUSTED.\n5. **Plots** — the current loop's figures, newest first, each with a one-line caption.\n6. Log — newest first, one line per event, trimmed to the last ~30.\n\n**Static only.** Preview renders the page in a sandbox with no scripts: no scripts, no CDN\nlibraries (Plotly, MathJax), no meta refresh, no external stylesheets. Use inline CSS,\ntables, inline SVG, and PNG\u002FSVG files in `plots\u002F`. Keep the page under 1 MB. Preview reloads\nit when the file changes, so a rewrite is the refresh.\n\n**Link it once.** After the first write, post the page as a `file:\u002F\u002F` link in chat\n(`[campaign dashboard](file:\u002F\u002F\u002Fabs\u002Fpath\u002Findex.html)`); one click opens it in Preview, where\nit stays live, and its \"Open in browser\" control pops it out for a second monitor. Do not\nre-post the link every loop.\n\n## Roles at a glance\n\n| Role | Subagent | Briefed with | Returns | Never |\n|---|---|---|---|---|\n| hypothesizer | read-only (edit+bash denied) | objective, ledger path | ranked hypotheses + spec card | executes anything |\n| experimenter | full access, one spec | reviewed spec, env assignment, note path | numbers-only debrief + own experiment note | touches ledger; grades itself |\n| analyzer | read-only (edit+bash denied) | note + RAW artifact paths, gate verdicts | ledger-delta proposal + next seeds | writes; decides |\n\nEnforcement honesty: the two read-only roles are permission-isolated; the experimenter's\nledger-abstinence is discipline + git history. The parent is the SOLE ledger writer.\n\n## Deliberate integration — current tooling state (honest)\n\n- `amico spec review` WORKS on this box: tier-1 mechanical lenses always; judgment critics\n  when a critic binary is available — when the verdict is `approved-mechanical`, say so,\n  and weigh a manual critic round (independent read-only subagents, one lens each:\n  consistency \u002F ops failure modes \u002F trust & anti-gaming) for anything load-bearing.\n- `amico plan compile` currently FAILS on this box (no `$AMICO_CRITIC_BIN` \u002F agent CLI).\n  Degraded path until it lands: the reviewed spec + parent-tracked steps in the ledger's\n  loop log stand in for the compiled plan; gate verdicts still come from real commands\n  (test suites, verification scripts), never from the experimenter's say-so.\n- **Probe\u002Fexperiment boundary (mechanical):** read-only ops and bounded side-effect-free\n  one-liners (\u003C ~1 min, writes nothing durable, no solve, no test suite) are probes — no\n  spec. Writes a durable file, launches a solve, or runs a test suite → experiment → spec.\n  Audit rule: a probe whose result is cited in the loop log as experiment evidence was\n  misclassified — record the misclassification when caught.\n\n## Handoffs (cross-mode seeds)\n\nThe research pack closes by handing an **issue seed** to `develop` (its pack's\nclosing handoff); this mode RECEIVES a **hypothesis seed** from `develop`.\nThe procedure, both directions:\n\n- **Receiving (develop → research):** the seed is a typed note\n  (`kind: hypothesis`, the hypothesis-seed schema — the question, the\n  evidence, the suggested experiment shape). On the seed: re-read the ledger,\n  register the hypothesis in the H-queue (§2), and run the loop above on it.\n- **Emitting (research → develop):** when a campaign closes with a\n  finding that needs code (a validated method, a tool gap, a result that\n  wants an implementation), write the issue-seed note — title, motivation,\n  evidence pointers, suggested repo + tier — name the target posture\n  (develop), and hand it over; the receiving mode's protocol (the `develop`\n  skill) renders it through `write-an-issue` and runs the dev walk on it.\n- **Switching modes mid-session is not yet specified; the mode cards'\n  posture-honesty sections govern until it is.** Until the fork's posture\n  surfaces ship, the safe path is to spawn or open the target posture's\n  session on the seed rather than switching in place; the ledger discovery\n  rule holds either way. Seed-write failures are reported in-chat — never\n  silently dropped.\n\n## Compaction honesty\n\nThe agent cannot observe its own context usage, and auto-compact fires on a token threshold\nwith no phase awareness — it WILL fire mid-experiment, unattended. The protocol does not\npretend to time it; it makes any compaction safe at any moment: ledger current at every\nboundary including before every cast; in-flight casts recorded with artifact destinations;\nexperimenter work products are files (a parent compaction cannot destroy an in-flight\nexperiment, only the parent's own working notes); re-read + audit after every compaction.\n\n## Parallel sessions & shared checkouts\n\n`ledger\u002Fcampaigns\u002FCHECKOUTS.md` is the project-wide claim registry. Re-read it before\ncasting any experimenter; claim your row; release it when work lands. First-writer-wins;\nraces are possible and visible — a visible conflict beats a silent double-ownership every\ntime.\n\nPinned scratch harnesses rot between loops: \u002Ftmp trees get cleaned, and shared depots garbage-collect pinned package trees. Before re-using one, verify the worktree SHAs and clean status, check every Manifest tree hash is present, instantiate if not, and assert the Manifest is byte-unchanged afterwards (never resolve). Record this in the run's env log.\n\n## Standing anti-gaming contract\n\nProduction `step` paths only for A\u002FB loop experiments; CRN pairing with f=0-style\ninvariants; impossibility checks on noise denominators; FD sanity gates on derived\nquantities; raw artifacts are the evidence, prose is not. Promotion of any result to\ncatalog\u002Fstatus is human-only, always.\n\n**Every measured axis carries its own wiring gate** (2026-10, three measured instances:\nloop-3 playback-unwired, loop-6 detuning-axis-unwired, loop-10's S2-objective probe) — an\nunwired axis returns 0s (or a unit-slip returns ~0.5) and banks a wrong verdict with every\nother gate green. A spec whose axis lacks a positive wiring check (loader reproduction,\nmonotonicity, a closed-form anchor cell) is an incomplete spec; critics reject on this\nclass. Bonus idiom: a symmetric ±σ telegraph arm's MEAN equals the closed-form single-node\ncost exactly — a free wiring validator for detuning axes. Analyzer findings are verified by\nthe director before being applied (2026-10, a factually-wrong receipts finding was caught);\na critic's arithmetic is never trusted over the test file's machine-pinned literals.\n\n- **Score corrections out of sample.** Under drift drawn fresh each round, a correction fitted at round k and scored at round k is in-sample. Report the one-step-ahead score F(k+1) − F_do-nothing(k+1) beside it. One campaign's entire arm ordering turned out to rank least harm: every arm was worse than doing nothing on 8\u002F8 seeds. Always carry a do-nothing reference, and pair by seed, because pooled medians can reverse paired orderings.\n- **Keep every STOP artifact** (rename it `*_STOP`; never delete it). An extra check an experimenter adds is a record, never a pass condition. An unregistered gate is a spec deviation even when it is caught.\n- **Run-mode tokens live only in filenames.** Determinism twins must not carry `_det` (or any pass marker) in their content. After the det pass, `grep -F _det` over twinned content must come back empty. This defect broke byte-identity four times in one campaign.\n- **Interpretation waits for the analyzer.** The director records a mechanical label at the gate. Its meaning (recommendations, mechanism claims) lands only after the read-only analysis of the raw artifacts.\n\n## Failure modes to watch\n\n- **The thin brief** — a subagent with a fresh context and a vague brief rediscovers\n  everything the hard way. Briefs point at files (ledger, notes, specs), never paste prose.\n- **The stale ledger** — if §3's uncommitted state is older than the last edit on disk, the\n  ledger is lying; refresh it before acting on it.\n- **EXHAUSTED debriefs** — an experimenter that hit its step cap reports `EXHAUSTED:`;\n  that's an open loop in §5, never an outcome in §2.\n- **Summary drift** — after each compaction, the audit in §9 is the check that the summary\n  still points HERE rather than becoming a competing source of truth.\n- **The silent no-op edit** — programmatic edits that report success but never matched\n  (six measured instances, 2026-10): every edit asserts its pattern and grep-verifies the\n  critical line; before `git add -A`, inspect status and account for every path (silent\n  subagent failures leave partial state that a blind add commits); after multi-edit\n  confusion, rewrite clean and let git arbitrate.\n- **Unattended runs** — plain `nohup` backgrounds die at tool-call exit in sandboxed\n  harnesses; `setsid` survives (measured both ways). Chain unattended cells through a\n  driver script; commit the state to the ledger BEFORE the night starts so any compaction\n  is safe.\n",{"name":5,"agents":24,"surface":28,"description":7,"project_contract":29},[25,26,27],"hypothesizer","experimenter","analyzer","public",{"folders":30},[31,32,33,34,35,36,37],"ledger\u002Fhypotheses","ledger\u002Fobservations","ledger\u002Fcampaigns","scripts","data","reports","config","main","bf84fdd4c1494800695bd5881702b3118dbf98be","packages\u002Fextension\u002Fskills\u002Fresearch",2,"https:\u002F\u002Fgithub.com\u002Fharmoniqs\u002Famicode","https:\u002F\u002Fgithub.com\u002Fharmoniqs","harmoniqs.ai","research tools, for researchers, by reseachers","2026-11-12 14:46:24",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add harmoniqs\u002Famicode --skill research",{"tool":53,"command":54},"bunx","bunx skills add harmoniqs\u002Famicode --skill research",{"tool":56,"command":57},"pnpm","pnpm dlx skills add harmoniqs\u002Famicode --skill research","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fharmoniqs\u002Famicode\u002Fblob\u002Fmain\u002Fpackages\u002Fextension\u002Fskills\u002Fresearch\u002FSKILL.md",true,[],[62,69,76,82,89,96],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M759XGHEQRJ1GWZTPRFF9Z1W","malformed","Frontmatter that parses as YAML but is missing the required name field.","https:\u002F\u002Fgithub.com\u002Fharmoniqs\u002Famicode\u002Fblob\u002Fmain\u002Fpackages\u002Fextension\u002Ftest\u002Ffixtures\u002Fskill-drift\u002Fskills\u002Fmalformed\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M759XDVQ1PYPMT876X8J21TQ","duplicated","Second skill carrying the duplicated frontmatter name.","https:\u002F\u002Fgithub.com\u002Fharmoniqs\u002Famicode\u002Fblob\u002Fmain\u002Fpackages\u002Fextension\u002Ftest\u002Ffixtures\u002Fskill-drift\u002Fskills\u002Fdup-two\u002FSKILL.md",[],[],{"skillNo":77,"name":71,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M759XBZYBHF38JDWSRHAC6E1","First skill carrying the duplicated frontmatter name.","https:\u002F\u002Fgithub.com\u002Fharmoniqs\u002Famicode\u002Fblob\u002Fmain\u002Fpackages\u002Fextension\u002Ftest\u002Ffixtures\u002Fskill-drift\u002Fskills\u002Fdup-one\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M759XAQBSP29BKTTXR1WF2D7","drifted","A skill whose API claims have drifted from the fixture packages.","https:\u002F\u002Fgithub.com\u002Fharmoniqs\u002Famicode\u002Fblob\u002Fmain\u002Fpackages\u002Fextension\u002Ftest\u002Ffixtures\u002Fskill-drift\u002Fskills\u002Fdrifted\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M759X8CNBPVK98C6M45D0QMB","clean","A clean skill whose every extracted claim resolves against the fixture packages.","https:\u002F\u002Fgithub.com\u002Fharmoniqs\u002Famicode\u002Fblob\u002Fmain\u002Fpackages\u002Fextension\u002Ftest\u002Ffixtures\u002Fskill-drift\u002Fskills\u002Fclean\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M759X73H6N2G0VDH8CJ5TF11","broken-paths","A skill with a broken relative link and a broken cited package path.","https:\u002F\u002Fgithub.com\u002Fharmoniqs\u002Famicode\u002Fblob\u002Fmain\u002Fpackages\u002Fextension\u002Ftest\u002Ffixtures\u002Fskill-drift\u002Fskills\u002Fbroken-paths\u002FSKILL.md",[],[]]