Skip to content

feat: Research Projects — self-contained, git-backed research entities (#663) - #671

Open
jeonghun-jj-lee wants to merge 22 commits into
mainfrom
amico/issue-663-research-projects
Open

feat: Research Projects — self-contained, git-backed research entities (#663)#671
jeonghun-jj-lee wants to merge 22 commits into
mainfrom
amico/issue-663-research-projects

Conversation

@jeonghun-jj-lee

@jeonghun-jj-lee jeonghun-jj-lee commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Research Projects

Implements #663 — self-contained, git-backed research entities with prescribed layout.

Sub-issues (all landed)

Frontier 0 (unblocked)

Frontier 1 (blocked by #665)

Frontier 2 (blocked by #665 + #666)

What's in this PR

Slice Files Tests
Glossary + ADR 0012 CONTEXT.md, docs/adr/0012 manual review
Entity schema + CLI project.ts, project_verb.ts, verbs.ts 38
Type detection detect.ts, project.ts, PromptProject 7
Paper-writer skill paper-writer/SKILL.md lint (62/62)
Skill auto-loading user_skill_providers.ts, package_skills.ts, opencode_config.ts 7 new + 4 updated
Autoresearch director stack_state.ts, autoresearch/SKILL.md, hypothesis-review/SKILL.md 3
Selector UI prompt-project-selector.tsx, new-session-view.tsx 1 structural

Total: 55+ new tests, all green.

Follow-up (not in this PR)

  • director-core/SKILL.md LEDGER DISCOVERY RULE v2 — lives in harmoniqs/armonissima (read-only mount), requires a separate PR to that repo
  • Workspace-change listener wiring in extension.ts — the workspaceFolders option is plumbed but not yet wired to onDidChangeWorkspaceFolders
  • E2E test for the project selector (requires browser test infrastructure)

Closes #663

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: e7529a78-3fe7-4c60-8e9e-2261415254ca


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

- Expand Project entry in CONTEXT.md with Research Project and Dev Project
  as flavor definitions (additive, no breaking change)
- Clarify Campaign entry: campaigns are distinct from Sessions; ledger
  location is project-aware
- Add 'Study' to the Project avoid-list (rejected alternative)
- Commit ADR 0012 (Research Projects as a structured flavor of Project)

Closes #664
…665)

- Define ProjectToml schema with validation (schema_version, name, slug,
  question, status, created, tags, authors, venue, domain_pack, links)
- Implement nameToSlug() for deterministic kebab-case slug generation
- Scaffold full Research Project layout: scripts/, data/{raw,processed,plots},
  analysis/, paper/{outline.md,main.tex,references.bib,latexmkrc,.gitignore,
  figures/,supplementary/}, ledger/{hypotheses,observations,literature,
  campaigns}, config/{system.toml,lab.toml}, skills/
- Venue-aware LaTeX templates: PRL/PRX → REVTeX, others → minimal article
- paper/outline.md scaffolded with YAML frontmatter (status: draft)
- Root .gitignore: jld2/hdf5/h5 + Python + .DS_Store
- amico project create <name>: scaffold + git init + initial commit
- amico project import [<dir>]: non-destructive scaffold over existing dir
- Both commands idempotent (safe to re-run)
- Register 'project' as spine verb in verbs.ts
- 38 tests: pure logic (schema, slug, scaffold, templates) + integration
  (create, import, idempotent, venue-aware)

Closes #665
- Add detectProjectType(dir) — checks for project.toml at directory root;
  presence → 'research', absence → 'dev'
- Extend ProjectDirEntry with type field, populated in listProjectDirs()
- Extend PromptProject interface in the overlay with optional type field
- Type is re-evaluated on each resolution (no caching) so directories
  that gain project.toml mid-session update their type
- 7 tests: detection, type change, listProjectDirs integration

Closes #666
- Ship paper-writer/SKILL.md in the public skill library
- Hard gates: outline-first (refuse without finalized outline), section-by-
  section approval (track in sections_approved[]), abstract prohibition
- Soft gates: content provenance (trace to outline bullets), forbidden
  actions (no novel conclusions, no interpretation, no abstract), data
  grounding (cite data/ files)
- Seven capabilities: sentence expansion, data citation, figure placement,
  bibliography management, gap detection, proofreading, equation formatting
- Four venue-aware outline templates: PRL compressed, PRX Quantum full,
  arXiv general, minimal
- surface: public, overridable per-project via skills/paper-writer/

Closes #669
- Add resolveProjectSkills() — scans workspace folders with project.toml
  for skills/ directory, labels entries with source 'project'
- Extend mergeSkillEntries() signature to project > custom > workspace >
  shipped (4 params); existing callers pass [] for project
- Extend SkillIndexEntry source union with 'project'
- buildSkillIndexSection annotates project skills with (project) label
- Shadow warning logged when a project skill overrides a shipped skill
- Add workspaceFolders option to OpencodeConfigOptions for passing
  VS Code workspace folders to the skill pipeline
- 7 new tests + 4 existing tests updated for new signature

Closes #668
- stack_state.ts: inject '## Active Research Project' block into system
  prompt when AMICODE_WORKSPACE_FOLDERS contains a folder with project.toml
  (project name, question, status, path, layout summary, project paths)
- autoresearch/SKILL.md: add project_contract frontmatter, project-aware
  path resolution table (campaign ledger, hypotheses, observations, scripts,
  data, config), vault fallback for non-project sessions
- hypothesis-review/SKILL.md: project-aware hypothesis reading (check
  <project>/ledger/hypotheses/ when project-bound, vault otherwise)
- 3 new stack_state tests: project-bound, non-project, dev-project
- director-core/SKILL.md update deferred: lives in harmoniqs/armonissima
  (read-only mount), requires a separate PR to that repo

Partial close — closes the amicode-side work for #670.
The armonissima PR (director-core LEDGER DISCOVERY RULE v2) is a follow-up.
- Un-gate the breadcrumb bar in new-session-view.tsx: remove !inAmicode()
  guard so the project selector renders inside the Amicode webview
- Remove amicode#203 project-name suppression: project name now always
  shown in the trigger button
- Add type grouping in the dropdown: Research section header over research
  projects, Development section header over dev projects
- Add status badge for research projects (proposing/designing/running/
  analyzing/writing/complete) in dropdown items
- Extend PromptProject type with optional status field
- Remove unused inAmicode import from both files
- Update structural test to verify gate is removed (not present)

Closes #667
@jeonghun-jj-lee
jeonghun-jj-lee marked this pull request as ready for review August 31, 2026 17:57
- Add reports/{weekly,presentations,milestones} to SCAFFOLD_DIRS
- Ship reports/weekly/template.md with YAML frontmatter (date, author,
  period, status) and section headings (Progress, Key Results, Blockers,
  Next Week, Notes)
- Update renderReadme() with reports/ line
- Update stack_state.ts project injection: layout string + Reports path
- Update CONTEXT.md Research Project definition with reports/
- Update ADR 0012 prescribed layout enumeration
- Update autoresearch/SKILL.md project_contract + path table
- 3 TDD cycles: scaffoldManifest (2 new tests), integration test (extended),
  stack_state injection (extended)
…n on macOS

Julia projects use Project.toml (capital P). On macOS's case-insensitive
filesystem, our project.toml collides with it — existsSync('project.toml')
finds 'Project.toml' and the import silently skips writing the manifest.
Every Julia-based research project hits this.

Rename to .amico: hidden dotfile, zero ecosystem collision, short.

Updated across 13 files:
- detect.ts: check for .amico instead of project.toml
- project.ts + project_verb.ts: scaffold .amico, idempotency checks
- stack_state.ts: project injection reads .amico
- user_skill_providers.ts + opencode_config.ts: skill discovery
- CONTEXT.md + ADR 0012: glossary and decision text
- autoresearch/SKILL.md: project_contract references
- All test files (detect, project_verb, stack_state, project_skills)

82 tests green across both packages.
…g manifest

.amico was too opaque for a manifest researchers should see and
understand. research-project.toml is explicit, visible in the tree,
self-documenting ('what is this file?'), and still zero collision
with Julia's Project.toml.

Updated across 13 files (same set as the previous rename).
Ship migrate-project/SKILL.md for converting existing research repos
into Research Projects. Four-phase procedure:

1. Scan — read the directory tree, classify existing artifacts
   (scripts, data, reports, papers, figures) and map to the
   prescribed layout
2. Infer + interview — infer name/question/status from README and
   existing artifacts; ask only about what can't be inferred; surface
   naming ambiguities (e.g. report/ vs reports/) with explicit options
3. Scaffold — run amico project import with collected info, then
   handle approved renames (never rename without consent)
4. Verify — show what changed, confirm nothing overwritten, suggest
   next steps (outline, weekly template, workspace add)

Handles edge cases: already a research project, monorepos, no git,
conflicting directory names.
docs/ is a catch-all researchers create when no structure exists.
The skill now classifies each file inside it:
- results summaries → ledger/observations/
- future directions → ledger/hypotheses/
- methodology guides → analysis/
- system model / hardware specs → config/ (or keep as docs/)

No new prescribed docs/ folder needed — the content already has
homes in the existing layout.
Replace the CLI-wrapper approach with an agent-native procedure:

Phase 1 — Scan and classify: agent reads first 20-30 lines of every
file and classifies using content heuristics (not filenames alone):
observations → ledger/observations/, hypotheses → ledger/hypotheses/,
methodology → analysis/, system reference → config/, etc. Detailed
heuristic table with specific signals for each category.

Phase 2 — Infer metadata: read README/PLAN for name, question, status.
Only ask about what cannot be inferred. Status inference from artifact
evidence (scripts only → designing, has data → running, etc.).

Phase 3 — Present migration plan: full table showing every file with
proposed destination, action (stays/move/rename/scaffold), and reason.
Researcher reviews and iterates until approved — no partial execution.

Phase 4 — Execute: mkdir scaffold dirs, git mv tracked files, mv
untracked, write research-project.toml directly, one commit.

Phase 5 — Verify: show what moved, what was created, flag empty dirs,
suggest next steps.

Handles: mixed-content dirs (per-file moves), name collisions, monorepos,
no-git repos, large data dirs (sampled). Never overwrites, never moves
without explicit approval.
analysis/ was a second home for runnable code (post-processing, plotting)
that split the researcher's scripts across two directories. Consolidate:

- All scripts (experiment + analysis) live in scripts/
- Methodology docs ('what worked' guides) go to ledger/observations/
  alongside results — they're durable records of what was learned
- analysis/ removed from SCAFFOLD_DIRS, README template, layout strings,
  CONTEXT.md, ADR 0012, and the migrate-research-project skill

136 tests green across both packages.
All code stays in scripts/, but analysis scripts (plotting, comparison,
post-processing) get their own sub-folder alongside testbed/. The migrate
skill classifies analysis scripts separately: files that load results
(JLD2, CairoMakie, DataFrame) go to scripts/analysis/, experiment scripts
(solve!, UnitarySmoothPulseProblem) stay in scripts/.
scripts/ now has three sub-folders:
  experiment/  — optimization solves, gate synthesis (bulk of scripts)
  analysis/    — post-processing, plotting, comparison
  testbed/     — scratch work, quick experiments

The migrate skill classifies into experiment/ (solve!, trajectory defs)
vs analysis/ (JLD2.load, CairoMakie, plot) vs testbed/ (scratch).
…rdware interfaces

testbed/ is not scratch work. It's where the simulated environment
(the gym) and hardware-interfacing code live — the foundation that
experiment scripts run against.
Every skill that references scripts/ now names the sub-folders and
their roles:

- autoresearch/SKILL.md: path table expanded from one Scripts row to
  three (experiment, analysis, testbed) with descriptions
- paper-writer/SKILL.md: methodology grounding references
  scripts/experiment/ and scripts/testbed/ specifically
- stack_state.ts: layout string and path list expanded to show all
  three sub-folders with testbed role description
- stack_state test: assertions updated to match

136 tests green.
Route all autoresearch state (campaign ledgers, hypotheses, observations,
specs, checkout registry) through the Research Project directory. Remove
vault_contract frontmatter and vault fallback paths from autoresearch,
hypothesis-review, analyze, and deliberate skills.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Research Projects — self-contained, git-backed research entities with prescribed layout

1 participant