apply
Implement tasks from an OpenSpec change (Experimental)
Display to the user:
> /plugin marketplace add heurema/signum > /plugin install signum@signum
How it fires
How this command gets triggered: by you, by Claude, or both.
/110-final-outputContext preview
What this command does when you run it.
Display to the user:
Display to the user:
Use the Bash tool to list all produced artifacts:
source lib/contract-dir.sh 2>/dev/null || true
ARTIFACT_ROOT="$(active_artifact_root 2>/dev/null || echo .signum/)"
PROOFPACK_PATH="${ARTIFACT_ROOT}proofpack.json"
AUDIT_SUMMARY_PATH="${ARTIFACT_ROOT}audit_summary.json"
DIFF_PATH="${ARTIFACT_ROOT}combined.patch"
ANTI_ENTROPY_PATH="${ARTIFACT_ROOT}anti_entropy_report.json"
echo "=== Canonical artifact root ==="
echo "$ARTIFACT_ROOT"
echo ""
echo "=== Artifacts ==="
if [ -d "$ARTIFACT_ROOT" ]; then
(
cd "$ARTIFACT_ROOT" &&
find . -maxdepth 2 -mindepth 1 | sed 's#^\./##' | LC_ALL=C sort
)
else
echo "WARNING: artifact root not found"
fi
echo ""
echo "Decision: $(jq -r .decision "$PROOFPACK_PATH")"
echo "Confidence: $(jq -r '.confidence.overall' "$PROOFPACK_PATH")%"
echo "Run ID: $(jq -r .runId "$PROOFPACK_PATH")"
if [ -f "$ANTI_ENTROPY_PATH" ]; then
echo "Anti-entropy: $(jq -r '.status + \" — \" + .summary' "$ANTI_ENTROPY_PATH" 2>/dev/null || echo 'unknown')"
fiThen display the appropriate next steps based on the decision:
After displaying results, finalize the current run to prevent stale artifacts from confusing subsequent invocations.
**Decision-based behavior:**
**Finalize flow (archive + purge):**
Use the Bash tool:
source lib/contract-dir.sh 2>/dev/null || true
ARTIFACT_ROOT="$(active_artifact_root 2>/dev/null || echo .signum/)"
CONTRACT_PATH="${ARTIFACT_ROOT}contract.json"
AUDIT_SUMMARY_PATH="${ARTIFACT_ROOT}audit_summary.json"
DECISION=$(jq -r '.decision' "$AUDIT_SUMMARY_PATH")
CONTRACT_ID=$(jq -r '.contractId // empty' "$CONTRACT_PATH")
finalize_run() {
ARCHIVE_TMP=$(mktemp -d .signum/archive-tmp.XXXXXX)
archive_contract_artifacts "$CONTRACT_ID" "$ARCHIVE_TMP"
if [ ! -f "$ARCHIVE_TMP/contract.json" ] || [ ! -f "$ARCHIVE_TMP/proofpack.json" ]; then
echo "ERROR: archive incomplete — keeping working set intact"
rm -rf "$ARCHIVE_TMP"
return 1
fi
if [ -n "$CONTRACT_ID" ]; then
ARCHIVE_FINAL=".signum/archive/${CONTRACT_ID}"
mkdir -p "$ARCHIVE_FINAL"
cp -R "$ARCHIVE_TMP"/. "$ARCHIVE_FINAL"/
fi
rm -rf "$ARCHIVE_TMP"
source lib/session-manager.sh 2>/dev/null || true
if type session_append &>/dev/null; then
GOAL=$(jq -r '.goal // "unknown"' "$CONTRACT_PATH" 2>/dev/null | head -c 120)
if [ "$DECISION" = "AUTO_OK" ]; then
session_append "success" "AUTO_OK: $GOAL"
elif [ "$DECISION" = "AUTO_BLOCK" ]; then
REASON=$(jq -r '.reasoning // "unknown"' "$AUDIT_SUMMARY_PATH" 2>/dev/null | head -c 120)
session_append "failure" "AUTO_BLOCK ($REASON): $GOAL"
elif [ "$DECISION" = "HUMAN_REVIEW" ]; then
session_append "model_disagreement" "HUMAN_REVIEW: $GOAL"
fi
if jq -e '.reviews | to_entries[] | select(.value.findings[]? | .category == "scope")' "$AUDIT_SUMMARY_PATH" &>/dev/null; then
session_append "scope_violation" "Scope issue detected in: $GOAL" 8
fi
fi
clear_active_contract >/dev/null 2>&1 || true
purge_root_working_set_views >/dev/null 2>&1 || true
echo "Run finalized: archived to .signum/archive/$CONTRACT_ID/, working set cleaned"
}
if [ "$DECISION" = "AUTO_OK" ]; then
finalize_run
fiIf `DECISION` is `AUTO_OK`, finalize runs automatically. For `HUMAN_REVIEW` or `AUTO_BLOCK`, wait for the user's choice (prompted above), then run one of the following bash blocks (each is self-contained — variables must be re-resolved since each Bash tool call gets a fresh shell):
**If user chooses "archive":**
source lib/contract-dir.sh 2>/dev/null || true
ARTIFACT_ROOT="$(active_artifact_root 2>/dev/null || echo .signum/)"
CONTRACT_PATH="${ARTIFACT_ROOT}contract.json"
CONTRACT_ID=$(jq -r '.contractId // empty' "$CONTRACT_PATH")
ARCHIVE_TMP=$(mktemp -d .signum/archive-tmp.XXXXXX)
archive_contract_artifacts "$CONTRACT_ID" "$ARCHIVE_TMP"
if [ ! -f "$ARCHIVE_TMP/contract.json" ] || [ ! -f "$ARCHIVE_TMP/proofpack.json" ]; then
echo "ERROR: archive incomplete — keeping working set intact"
rm -rf "$ARCHIVE_TMP"; exit 1
fi
if [ -n "$CONTRACT_ID" ]; then
mkdir -p ".signum/archive/${CONTRACT_ID}"
cp -R "$ARCHIVE_TMP"/. ".signum/archive/${CONTRACT_ID}/"
fi
rm -rf "$ARCHIVE_TMP"
clear_active_contract >/dev/null 2>&1 || true
purge_root_working_set_views >/dev/null 2>&1 || true
echo "Run finalized: archived to .signum/archive/$CONTRACT_ID/, working set cleaned"**If user chooses "delete":**
source lib/contract-dir.sh 2>/dev/null || true clear_active_contract >/dev/null 2>&1 || true purge_root_working_set_views >/dev/null 2>&1 || true echo "Working set deleted (no archive)"
**If user chooses "keep" or does not respond:** do nothing.
---
Signum is a contract-first proof gate for agentic software changes: it turns a task into a reviewed contract, executes against that contract, audits the result, and packages evidence that humans and CI can inspect.
Repo: heurema/signum
Implement tasks from an OpenSpec change (Experimental)
Archive a completed change in the experimental workflow
Enter explore mode - think through ideas, investigate problems, clarify requirements
Propose a new change - create it and generate all artifacts in one step