2026-08-03 17:42:42 -05:00
2026-08-03 19:59:37 +00:00
2026-08-03 19:59:37 +00:00
2026-08-03 17:14:55 -05:00
2026-08-03 19:59:37 +00:00
2026-08-03 19:59:37 +00:00
2026-08-03 17:14:55 -05:00
2026-08-03 19:59:37 +00:00
2026-08-03 17:14:55 -05:00
2026-08-03 19:59:37 +00:00

sssf-opencode

an OpenCode-native port of the control-plane ideas in super simple software factory.

the factory owns phase order, JSON envelopes, session state, and run records. OpenCode performs bounded agent turns. this does not shell out to Pi or depend on a Claude Code skill.

current slice

  • opencode run --format json adapter with streamed text, token/cost capture, raw JSONL records, and real OpenCode session reuse
  • deterministic phase runner with durable per-role session state under .sssf/runs/<run-id>/
  • named OpenCode planner, builder, reviewer, and scout agents
  • explicit model routing in factory.json
  • a testable sssf-opencode phase command

this first cut deliberately leaves the upstream Pi extension and broad ADW catalog behind. the next porting work is a strict changed-path gate, installer, and the remaining workflow templates.

model policy

these are direct OpenCode provider/model references verified against current Models.dev metadata:

role model
planner zai-coding-plan/glm-5.2
builder openai/gpt-5.3-codex
reviewer and scout minimax/MiniMax-M3
disabled fallback deepseek/deepseek-v4-pro

DeepSeek is present but disabled in factory.json. enable it only after a provider smoke test. credentials are not stored in this repository.

setup

install OpenCode, then authenticate each provider with /connect, or provide its usual environment variable in an untracked environment file. A GLM Coding Plan subscription must use Z.AI Coding Plan in /connect, not the generic Z.AI provider: the plan uses its dedicated coding endpoint and plan quota.

OPENAI_API_KEY
ZHIPU_API_KEY
MINIMAX_API_KEY
DEEPSEEK_API_KEY

run the factory against another worktree by pointing OpenCode at this repository's checked-in config and agent directory:

export OPENCODE_CONFIG="$PWD/opencode.json"
export OPENCODE_CONFIG_DIR="$PWD/.opencode"

uv run sssf-opencode phase planner \
  "plan a narrow, tested change for the target project" \
  --worktree /path/to/target \
  --config "$PWD/factory.json" \
  --run-id example_001

the phase output is one JSON envelope. the factory also persists it as /path/to/target/.sssf/runs/example_001/<role>-envelope.json; do not pipe it through tee to that directory. the same run directory holds JSONL output and OpenCode session ids.

run the builder only after accepting the planner output. do not use OpenCode's auto-approval mode. the builder agent denies git push, git reset --hard, and rm -rf.

development

uv run python -m unittest discover -s tests -v
uv build

upstream

this is a new implementation, not a wrapper around upstream Pi code. upstream attribution and license information are in NOTICE.md.

S
Description
deterministic software factory workflows for opencode
Readme MIT 78 KiB
Languages
Python 100%