The plugin core predates v3.17.1: with two named plans and no PLAN_ID it
picked the shared pointer or the newest directory, which is exactly the
silent switch #240 removed from the shell, PowerShell and Python paths. The
core now counts selectable plans the way inject-plan.sh does (a root plan
under an armed sessions directory counts as one, plus every valid slug
directory holding task_plan.md) and refuses with the canonical notice at
prompt time; every other point stays quiet, pwf_status and pwf_check say
which selector is missing, and a PWF_PLAN_ROOT pin does not lift the rule
because it chooses the project, not the plan.
opencode-planning-with-files moves to 1.1.0 for the behaviour change; the DSH
plugin ships the rule from its first release.
OpenCode plugin: a failed session lookup is no longer cached (it pinned
the session to the server directory for the rest of the process, and
could record a subagent as a parent); unknown sessions are never gated.
The pwf_init, pwf_status and pwf_check tools resolve the same root as
the hooks, so PWF_PLAN_ROOT and PLANNING_DISABLED apply to them too
(a broken pin or the opt-out is an explicit error). chat.message injects
at most once per message. A rootless Windows pin ("\foo") is refused
like the shell does. Ledger lines are counted like grep -c "" so the
gate counters stay interchangeable with the shell. The attestation temp
file is process-unique. The link-escape path is now tested.
Both the OpenCode and the Hermes resolver now fall through when PLAN_ID
names a slug that does not resolve, like resolve-plan-dir.sh; before,
a stale exported PLAN_ID blacked out injection for the whole session.
New npm package opencode-planning-with-files under
.opencode/packages/opencode-planning-with-files/ (TypeScript, Vitest):
- chat.message appends the framed active plan (plan head, normalized
progress tail, findings pointer) to every user message, or a
once-per-turn ambiguity notice when a direct child project carries its
own live plan
- tool.execute.after appends the progress reminder to write, edit,
patch, multiedit and apply_patch output
- experimental.session.compacting keeps the plan pointer and attestation
hash in the compaction context
- event session.idle runs the completion gate in gated mode and
re-prompts the session with the gate reason through the SDK (Tier 2);
child sessions are never re-prompted, the shared .stop_blocks and
.gate_last_ledger counters and PWF_GATE_CAP bound it
- tools pwf_init (root or .planning/<date>-<slug>/, mode autonomous or
gated with the v3 markers and attestation), pwf_status, pwf_check
The resolver, ambiguity rule, gate decision table, init markers,
attestation check and frame format mirror resolve-plan-dir.sh,
inject-plan.sh, check-complete.sh --gate, init-session.sh and the Hermes
plugin. Each session resolves its plan from its own OpenCode directory.
PWF_PLAN_ROOT fails closed, PLANNING_DISABLED silences every hook.
Also: .opencode/commands/pwf.md and pwf-status.md in OpenCode's command
format, a dogfood entry .opencode/plugins/planning-with-files.ts that
loads the plugin from source when this repository is opened in OpenCode,
.opencode/package.json tracked with the @opencode-ai/plugin dependency,
and a vitest (OpenCode plugin) CI job.
Verified live in OpenCode 1.18.21: plugin loaded, pwf_init/pwf_status/
pwf_check listed, /pwf and /pwf-status listed, a real session message
received the framed plan as a synthetic part.