Skip to content

feat: harness agent, planning, gardener, brainstorm, researcher + lifecycle tools#10

Merged
azrod merged 31 commits intomainfrom
harness
May 4, 2026
Merged

feat: harness agent, planning, gardener, brainstorm, researcher + lifecycle tools#10
azrod merged 31 commits intomainfrom
harness

Conversation

@azrod
Copy link
Copy Markdown
Owner

@azrod azrod commented May 4, 2026

Summary

  • Five new agents: harness, planning, gardener, brainstorm, researcher
  • Five lifecycle tools directly available to Orion (project_state, check_artifacts, mark_block_done, complete_plan, register_spec)
  • New spec-writer skill bundled with the plugin
  • review-manager can now read files directly — no longer needs to spawn an explore sub-agent
  • bug-finder now includes a pattern assessment in every output, recommending harness when the root cause is mechanically encodable
  • memory.md concept removed — scratchpad only (rationale)

Agents added

Agent Role
harness Encodes recurring patterns as mechanical enforcement artifacts (lint rules, CI checks, AGENTS.md entries)
planning Transforms complex/ambiguous requests into structured exec-plans on disk
gardener Periodic maintenance — fixes stale docs, detects code drift, escalates to harness
brainstorm Helps articulate what to build before planning; produces a product brief in docs/briefs/
researcher External knowledge research (web, docs, RFCs) — leaf node, used before planning

Breaking changes

  • memory.md removed — the experimental.chat.system.transform hook and all memory.md injections are gone. Only the scratchpad survives compaction.

azrod and others added 30 commits April 1, 2026 21:51
- harness: full bash/read/write/edit permissions for enforcement artifact creation
- planning: exec-plan writing scoped to docs/exec-plans/
- gardener: maintenance agent with scoped git/gh bash access
- Remove memory.md concept — scratchpad-only persistence going forward
- bug-finder gains pattern detection and harness escalation recommendation
- Add docs/ with architecture, ADRs, specs, templates, and background research
* feat: add brainstorm agent for product brief discovery

Introduces a Phase 0 brainstorm agent that helps users discover and articulate what they want to build before planning starts. The agent runs a 3-phase conversational flow (Discovery → Deep dive → Draft + validation), produces a structured product brief at docs/briefs/{project-name}.md, and hands off cleanly to the Planning agent or Orion.

- Temperature 0.5 for open-ended discovery, mode: all
- Write permission scoped to docs/briefs/** only
- Session resume logic: scans for status:draft files on open
- Quality gate with Tier 1 (auto-fix) and Tier 2 (user-blocking) split

* docs: update all documentation and website for brainstorm agent

Add brainstorm to docs/index.md agent table, docs/architecture.md (diagram, agent table, permissions, prompt loading), README.md (bullet + dedicated section), docs/specs/orion-delegation.md, and the team-lead-workflow website (EN + FR agents and config_agent_defaults arrays). Fix TypeScript compatibility in resizable.tsx (react-resizable-panels v4 API). Rebuild bundle.html.

* chore: remove example brief from brainstorm test

* fix: address Copilot review comments on brainstorm agent PR
… flag

- Rename `permissions` to `permission` (silent bug — key was ignored by registerSubagent)
- Replace `read: "allow"` with `read: { "*": "allow" }` for consistent merge behavior
- Remove `silent: true` — reserved for internal sub-agents, not user-facing agents
…nt specs

- AGENTS.md restructured as a navigation index with pointers to docs/
  rather than duplicating architecture content; removed memory.md and
  experimental.chat.system.transform references; updated file count
- docs/architecture.md: remove deprecated system.transform hook and
  memory.md references; add harness, planning, gardener to agent table
- README.md: full rewrite — all 10 agents documented, accurate
  permissions table, memory.md references removed
- Add docs/specs/bug-finder-agent.md, brainstorm-agent.md,
  review-cluster.md — closing the spec coverage gap
- Fix: all 5 lifecycle tool execute() now return JSON.stringify — the
  OpenCode plugin API requires Promise<string>, raw objects caused a
  silent crash at runtime
- Add tools/lifecycle.js: 5 deterministic bookkeeping functions
  (projectState, markBlockDone, completePlan, registerSpec, checkArtifacts)
- Add tests/lifecycle.test.js: 28 tests with node:test + node:assert/strict,
  zero deps, each test runs in an isolated tmpDir
- Add npm test script (node --test tests/*.test.js)
- Add docs/specs/lifecycle-tools.md and review-manager-mechanical-checks.md
- Update agents/prompt.md, docs/index.md with harness/planning/gardener
  additions from previous session
- README.md: add Lifecycle Tools section documenting the 5 bookkeeping tools
- AGENTS.md: update tests references, add lifecycle tools to enforcement table
- CHANGELOG.md: add Fixed entry for lifecycle tools execute return type
- orion-docs/: new technical documentation website (7 sections, React + Tailwind)
  with lifecycle tools, all 9 agents, 5-phase workflow detail
- team-lead-workflow/: update agents list and flowchart for consistency
* fix: create docs/briefs/ directory so brainstorm agent can write briefs

The brainstorm agent had correct write permissions for docs/briefs/** in
index.js but the directory did not exist on disk. OpenCode's write tool
requires the parent directory to exist — the missing directory caused a
permissions-like error at runtime.

- Add docs/briefs/.gitkeep so the directory persists after git clone
- Remove erroneous todowrite: allow that was added during the fix attempt
  (brainstorm agent never uses todowrite)

* feat: improve brainstorm agent with adversarial gate, Socratic pressure, and CI enforcement

- Add adversarial gate (mandatory before Phase 3): agent synthesizes the
  strongest case against building the project and asks what would cause
  it to fail in year one
- Add Socratic pressure in Phase 1 and Phase 2: agent challenges stated
  assumptions and constraints once before accepting them
- Hard-block on incomplete briefs: missing Problem, Success Criteria, or
  Scope In blocks the brief from being written
- Scope inflation detection: flagged once when in-scope list hits 5+ items
- Early name check in Phase 2: file conflict surfaced immediately, not at
  Phase 3 after a full session
- Convergence rule: cosmetic disagreements noted as open questions;
  substantive ones block output entirely
- Add brief-schema CI check: validates required frontmatter fields and
  section headings on all docs/briefs/*.md files
- Add no-permissions-in-agent-prompts CI check: forbids ## Permissions
  sections in agents/*.md (permissions live exclusively in index.js)
- Remove ## Permissions section from agents/brainstorm.md and
  docs/specs/brainstorm-agent.md (caught by new CI check)
- Update guiding-principles.md with two new principles
- Update website (App.tsx + bundle.html) to reflect new brainstorm workflow

* harness: enforce that agent write/edit target directories exist in repo

Encodes the pattern exposed by the brainstorm agent bug: a write/edit
permission path declared in index.js is useless if the target directory
doesn't exist on disk — the agent silently fails at runtime.

- Add agent-write-dirs-exist CI check: parses write/edit allow paths from
  index.js, extracts base directories, and verifies they exist in the repo
- Add docs/exec-plans/.gitkeep: planning agent had the same missing
  directory issue (docs/exec-plans/ declared but never created)
- Add guiding principle: declared write/edit target directories must exist
  and be tracked with .gitkeep or real content
- Update AGENTS.md enforcement table with the new check

* test: replace agent-write-dirs-exist CI check with unit test

The bash CI job that verified write/edit target directories exist is
replaced by a proper unit test in tests/permissions.test.js. The test
suite (node:test, zero deps) was already in place on the harness branch.

- Add tests/permissions.test.js: parses index.js, extracts all write/edit
  allow paths ending in /**, strips the glob suffix, and asserts each
  base directory exists on disk
- Remove agent-write-dirs-exist job from checks.yml

* docs: update orion-docs to document brainstorm agent (Phase 0)
- Add @opencode-ai/plugin as a real dependency (^1.3.17) instead of peer dep
  — peer dep was not resolvable from Node's ESM resolution chain on fresh installs
- Update zero-deps CI check: allow @opencode-ai/plugin specifically, assert its presence
- Add engines field (node >=16.0.0) to document minimum Node version
- Add permissions: {} to checks.yml workflow for least-privilege
- Translate all French error/warning strings in lifecycle.js to English
- Tighten test assertions for not-found errors (file vs block vs status)
…ection

- doc_dev_start/stop/status/logs — Vite dev server lifecycle management
- doc_screenshot/navigate/get_html — headless Playwright browser tools
- doc-inspector agent — orchestrates tools for visual doc inspection
…orm flowchart (#9)

* feat: replace flowchart with unified Mermaid diagram (Phase 0-5)

* docs: expand Phase 0 brainstorm flowchart with full entry logic

- Rename brainstorm internal phases to Step 1/2/3 in WORKFLOW_DRAFT to avoid
  confusion with global Orion phases (Phase 1=PLAN, Phase 2=DELEGATE, etc.)
- Replace simplistic Phase 0 (single Brief exist? node) with full entry logic:
  glob docs/briefs/, Briefs found? (0/1/N), Brief status? (draft/done),
  Continue or fresh start?, Revise or new project?, Load brief → Step 3,
  Step 1 direct/normal, Run brainstorm agent, Brief written → verbal suggestion
- Add fast path dashed arrow from glob node to Phase 2 Select agent (bypass
  when scope is already clear)
- Fix edge label visibility: inject CSS into SVG post-render to force dark
  background (#1e293b) and white text on all Mermaid edge labels
- Add optional dashed arrow Phase 4 → Phase 5 (maintenance is post-delivery)
- Rebuild bundle.html

* chore: remove orion-docs/ legacy directory

The orion-docs/ directory was an abandoned React app (Parcel + Tailwind +
shadcn) with no references anywhere in the codebase. It has been fully
replaced by team-lead-workflow/ which is the active documentation site.
- Fix SVG overflow: use width 100% instead of fixed minWidth 800px so
  the SVG adapts to its container without clipping or left-overflow
- Fix SVG centering: add display block + margin auto post-render, wrapper
  with justifyContent center, reduced padding from 24px to 16px 8px
- Fix overflow: left panel overflowX hidden -> auto to allow scroll
- Improve nav buttons: larger padding (8px 16px), higher contrast background
  (f1f5f9 / cbd5e1 border), fontWeight 500, visible hover state
- Center zoom controls: alignSelf flex-start -> center
- Make click-node hint more readable: remove italic, darker color
Replace the Mermaid-based team-lead-workflow with a fully interactive
React Flow app. Pan, zoom, click-to-detail, minimap, FR/EN toggle.
No more static SVG — proper canvas-based navigation.
- Hide React Flow handles (opacity 0) — no more white dots on nodes
- Style edge labels with dark background (#1e293b) and slate text
- Fix node positions: separate P0_COUNT and P0_ONE diamonds (50px gap)
- Remove fast-path dashed edge (P0_GLOB → P2_SELECT) — was cluttering the graph
- Use smoothstep edges with consistent stroke color #475569
…orkflow

Overview shows 6 compact phase cards. Clicking any card opens a full
React Flow canvas for that phase with real nodes, decisions, branches
and Dagre auto-layout. Breadcrumb + back button for navigation.
- Return edges (CHANGES_REQUESTED, major gap) route right of cards
  via named handles — no more long vertical lines through the page
- Main flow edges: strokeWidth 3, colored by destination phase
- Card width: 520 → 560px, more breathing room in steps
- fitView padding reduced to 0.08 for better initial view
- Card width 560→600px, header padding increased
- All text sizes bumped: step labels 13→15px, subtitles 12→14px, phase title 16→20px
- Remove left-side edges (skip planning, major gap) from overview — confusing
- Keep only main flow + CHANGES_REQUESTED return edge on the right
- Add arrowhead markers on all edges
Phases alternate left/right columns — brickwork pattern.
Return edges (CHANGES_REQUESTED) are now short horizontal arrows
between adjacent columns at the same Y level, not long vertical lines.
Snake routing: P0→P1 horizontal, P1→P2 diagonal, P2→P3 horizontal,
P3→P4 diagonal APPROVED, P4→P5 horizontal optional.
- New read-only agent for web research during comprehension phase
- Permissions: read, websearch, webfetch, grep (deny edit/write/bash/task)
- 5-phase workflow: Scope → Retrieval → Extraction → Synthesis → Delivery
- Structured output: Summary, Key Findings, Sources, Caveats, Gaps
- Security considerations: SSRF protection, prompt injection guards, data exfiltration risks documented
- Integrated into Orion's Agent Selection (used before planning for external context)
- 10 agents now implemented in the plugin
- New skill provides templates, examples, and checklists for writing agent specs
- 5-phase workflow: Load Template → Study Examples → Write → Validate → Save
- Bundled resources: SKILL.md, template.md, checklist.md, 3 real-world examples
- Fail-safe loading: tracks completeness, warns on missing files, throws if incomplete
- Registered via skill hook, accessible with skill(name="spec-writer")
- All files shipped with npm package (skills/ added to package.json)
@azrod azrod merged commit bca00a1 into main May 4, 2026
8 checks passed
@azrod azrod deleted the harness branch May 4, 2026 08:22
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.

2 participants