attest-plan: an explicit --target root|<plan-id> flag (re-attest a root roadmap while a slug plan is live)

Author: sortakoolCreated Sep 26, 2026Updated Sep 26, 2026

Problem

attest-plan.sh attests whatever the resolver returns. The legacy root ./task_plan.md is reached only as the last fallback: when no slug plan resolves, no explicit selector is set, and the cwd is not a slug directory (scripts/attest-plan.sh @ v3.20.8, resolve_plan_file, resolution steps 1–5 in the header).

A project that keeps a short root roadmap (./task_plan.md) alongside one live ticket plan (.planning/<slug>/) therefore cannot re-attest the roadmap while the ticket is live:

  • with no selector, the resolver returns the slug plan;
  • PLAN_ID / PWF_PLAN_ROOT are (correctly, since #237) bindings, so neither can be pointed at the root plan without the script refusing;
  • the only route is to clear selection (.active_plan) first, attest, then restore it. That is racy in a multi-agent session, and phase boundaries are exactly when a roadmap gets edited and needs re-attesting.

Ask

An explicit target flag:

bash
sh scripts/attest-plan.sh --target root        # attest ./task_plan.md -> ./.plan-attestation
sh scripts/attest-plan.sh --target <plan-id>   # same as PLAN_ID=<plan-id>, as a flag
sh scripts/attest-plan.sh                      # unchanged default behaviour

and in every write mode, print the resolved plan file and attestation path before writing. Today they are printed only by --show.

--target would be a binding in the same sense as PLAN_ID after #237: a target that doesn't resolve attests nothing and exits non-zero, with no fallback.

Context

  • Attestation is tamper detection, not approval (#150), so re-attesting a roadmap at a phase boundary is a routine operation that should not require mutating selection state.
  • docs/attestation-locking.md is the natural place for a doc line.

Offer

Happy to send a PR: the flag, a test for each arm (root, <plan-id>, an unresolvable target → non-zero with nothing written, and the default unchanged), plus the doc line. Tell me if you'd prefer a different shape.

Source: OthmanAdi/planning-with-files