From 3e96c53e4c02e4d2ec3eb2367c0bbe9e854d1b95 Mon Sep 17 00:00:00 2001 From: GodSpeed313 Date: Fri, 24 Jul 2026 13:58:24 -0400 Subject: [PATCH] M7 go-decision packet: First-Post Rider envelope, two-stage GO checklist, scaffold-hooks note + TODO debt sync MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds the three-document deployment packet (drafted in the operator's outside agent session, verified in-session against moltbook/transport.py and the locked transport spec before placement): - docs/m7_first_live_post_governed_envelope.md — first-instance-only First-Post Rider on top of the standard ActionEnvelope (8 required fields, explicit terminal-state discharge condition; ambiguous outcomes are never terminal). Amends nothing in the locked spec. - docs/m7_operator_go_checklist.md — auditable two-stage go decision: GO-1 (preparation authorization at preparation_baseline_commit) and single-use GO-2 (transmission authorization bound to action_id + payload_hash + execution_candidate_commit + config_version, with expiry and consumed_at). C3 binding wording forbids synthetic /verify probes; C5 requires a Published-Outcome Correction and Withdrawal Procedure before GO-2 (transport has no delete path). - docs/scaffold_hooks_reconstruction_note.md — finding that PR #30 hooks were never committed, plus the 2026-07-24 resolution update (originals recovered from the scaffold zip, reworked to the current stdin-JSON interface, installed local-only, tested green). The user-local vs tracked-infrastructure decision is resolved: tracked, as a separate follow-up PR. - TODO.md — infrastructure-debt section synced: scaffold-hooks item closed (installed 2026-07-24), stale PAT entry corrected to the 2026-07-23 closure (rotated, expires 2026-10-21, auto-warning live). Suite green at commit: 589 passed + 7 xfail. git diff --check warnings on TODO.md are a pre-existing storage artifact (CRLF blob since PR #44, also CLAUDE.md/README.md) — renormalization deferred to the follow-up infrastructure PR. Co-Authored-By: Claude Fable 5 --- TODO.md | 18 +- docs/m7_first_live_post_governed_envelope.md | 117 ++++++++++ docs/m7_operator_go_checklist.md | 223 +++++++++++++++++++ docs/scaffold_hooks_reconstruction_note.md | 73 ++++++ 4 files changed, 425 insertions(+), 6 deletions(-) create mode 100644 docs/m7_first_live_post_governed_envelope.md create mode 100644 docs/m7_operator_go_checklist.md create mode 100644 docs/scaffold_hooks_reconstruction_note.md diff --git a/TODO.md b/TODO.md index 56bd734..adccf07 100644 --- a/TODO.md +++ b/TODO.md @@ -18,12 +18,18 @@ Live milestone + debt tracker. Suite: **589 passing + 7 xfail** (known-gap pins) ### Infrastructure / process debt -- [ ] Claude Code scaffold hooks (PR #30) never installed — bash/`CLAUDE_*`-env-var shaped, - need Windows + current-JSON-interface rework before enabling. -- [ ] `PISCRIPTGOVERNANCE` PAT (Melody-Maestro governance watcher) expires again ~early - September 2026 (60-day fine-grained default, regenerated ~2026-07-08). No expiry - warning exists — if #pi-logs Discord goes quiet, check the PAT first - (`gh run list -R GodSpeed313/Melody-Maestro`). +- [x] Claude Code scaffold hooks (PR #30) installed 2026-07-24 — reworked from the scaffold's + bash/`CLAUDE_*`-env-var shape to the current stdin-JSON hook interface as three Python + scripts in `.claude/hooks/` (pre-Bash destructive-command guard, post-Write/Edit targeted + pytest for `pi_script/`/`rift/`/`moltbook/`, Stop-time full suite + Discord notify) wired + via `.claude/settings.json`. Local-only by design (`.gitignore` keeps `.claude/*` private + except skills). `DISCORD_WEBHOOK_URL` env var enables the notify path; unset = suite still + runs, result printed only. +- [x] `PISCRIPTGOVERNANCE` PAT expiry debt CLOSED 2026-07-23: pre-flight expiry-warning step + + run-failure Discord net shipped to Melody-Maestro `governance.yml` (PR #1 `c3f5822`), + token rotated (90-day fine-grained, Contents R/W both repos, expires 2026-10-21 — + auto-warns #pi-logs at ≤14d ~10/07 and ≤3d ~10/18), renewal doc corrected (PR #2 + `ed17351`). If #pi-logs goes quiet anyway: `gh run list -R GodSpeed313/Melody-Maestro`. ### xfail census (7 — deliberate known-gap pins, not failures) diff --git a/docs/m7_first_live_post_governed_envelope.md b/docs/m7_first_live_post_governed_envelope.md new file mode 100644 index 0000000..6401895 --- /dev/null +++ b/docs/m7_first_live_post_governed_envelope.md @@ -0,0 +1,117 @@ +# M7 — First Live Post: Governed Action Envelope + +**Status: DRAFT — pending operator review and sign-off.** This is not a transport specification +and does not amend `docs/m7_moltbook_transport_boundary_and_deployment_spec.md` (LOCKED +2026-07-20) or any of its Implementation Notes (A–F). It does not redefine `ActionEnvelope` (§4 +of that spec, implemented as `moltbook.transport.ActionEnvelope`). It adds a first-instance-only +governance layer on top of the existing envelope for exactly one action: the first live governed +post or reply Continuum's deployed agent transmits to Moltbook. Once that action has resolved +(published, not published, or definitively failed), this document's obligations are discharged — +routine subsequent actions are governed by the transport spec alone, not by this document. + +This distinction matters for the same reason `docs/m7_moltbook_transport_boundary_and_deployment_spec.md` +§11 (Dry Run) and Note E's stop conditions exist: the first live action is the one point where +every seam that has only ever been tested is touched by something real for the first time. The +extra requirements below exist to make that crossing observable and reversible, not to make the +action itself more "permitted" than any later one — permission is still decided by the resolver +alone (§2 of the transport spec; this document changes nothing about who authorizes an action). + +--- + +## 1. Relationship to the standard Approved Action Envelope + +Every outbound write, first or five-thousandth, still requires a standard `ActionEnvelope` per +§4: `action_id`, `action_type`, `payload`, `approval_trace_id`, `approval_timestamp`, +`approval_expiry`, `governance_config_version`, `payload_hash`. Nothing here changes that +dataclass, its `approve()` constructor, or `moltbook.transport.validate_envelope`'s three +rejection checks (expired, config drift, payload drift). + +What this document adds is a **first-post rider**: a second artifact, produced alongside the +standard envelope and referencing it by `action_id`, that must exist and be reviewed before the +standard envelope for this one action is allowed to reach the transport. The rider is a governance +artifact, not a code change — it does not touch `moltbook/transport.py`. + +## 2. First-Post Rider — required fields + +| Field | Meaning | Source | +|---|---|---| +| `action_id` | Binds the rider to the exact standard envelope it covers. | `ActionEnvelope.action_id` | +| `t3_grounding_reference` | Pointer to the T3 cohort re-sample result that grounded the IdentityIntegrity cross-session change-rate threshold (TODO.md open item) and the second A1.6 falsification check on CadenceIntegrity's ±5s grounding. | T3 session artifact / trace | +| `dry_run_rehearsal_reference` | Pointer to a completed `DryRunTransport` run (§11) executed against this exact payload — same `payload_hash`, same `action_type` — producing detector results, Arbiter decision, approval trace, and simulated transport outcome with no external write. | `moltbook.transport.DryRunTransport` output (reserved-namespace IDs per `moltbook/dryrun.py`) | +| `captcha_configuration_state` | Confirms the transport's captcha configuration invariant (Note E, item 7: `captcha_verifier` and `submit_captcha_fn` both configured, or neither) and records which state it will be in for this send. | Constructor state at send time | +| `kill_switch_precheck` | Confirms `KillSwitch.engaged` is `False` immediately before this send, and that the operator has a tested, reachable path to call `KillSwitch.activate_manual(operator=...)` during the send if needed. | Runtime check, operator attestation | +| `operator_go_reference` | Pointer to the signed Operator GO Checklist (`docs/m7_operator_go_checklist.md`) instance covering this action — specifically the GO-2 (transmission) record, not GO-1 (preparation) alone. | Checklist artifact | +| `correction_procedure_reference` | Pointer to the finalized **Published-Outcome Correction and Withdrawal Procedure** covering what happens if `publication_status` resolves to `PUBLISHED` but the content needs to come down or be corrected, or if `AMBIGUOUS_WRITE`/`OUTCOME_UNKNOWN` freezes execution (§9). Per the checklist's GO-2 gating (`docs/m7_operator_go_checklist.md` §D), this procedure must be **finalized before GO-2 is granted** — it is no longer a deferred, non-gating item. Named deliberately as *correction and withdrawal*, not "rollback": a freeze under §9 stops further writes but cannot itself delete, edit, or otherwise reverse a post already visible on the platform, and most external APIs don't offer an atomic rollback of a public effect — the procedure must distinguish delete-when-supported, edit/correction-when-supported, corrective follow-up when neither is available, freeze-and-escalation, and audit preservation. | Published-Outcome Correction and Withdrawal Procedure (finalized under GO-1 preparation, required for GO-2) | +| `execution_commit_reference` | Pointer to the `execution_candidate_commit` (`docs/m7_operator_go_checklist.md` §D) — the exact, clean-tree commit whose code is what actually executes this send. Distinct from the `preparation_baseline_commit` reviewed at GO-1: live captcha wiring (C2) happens after GO-1, so the code reviewed at preparation time is not the code that transmits. | GO-2 record, §D | + +The rider is satisfied only when every field above is filled with a real reference, not a +placeholder. An empty or "N/A" field is a stop, not a waiver — every field above is now a hard +requirement gated by GO-2 (§D of the checklist), so there is no longer an "interim fallback" case +to fall back to; if any field cannot be populated, GO-2 has not been reached. + +## 3. Sequencing constraint (binding on this document only) + +This document assumes and requires the two-stage authorization structure in +`docs/m7_operator_go_checklist.md`: + +``` +Preliminary readiness review (preparation_baseline_commit reviewed) + → GO-1 (deployment preparation authorization) + — permits: live submit_captcha_fn wiring, connectivity validation + (no transmission, no synthetic /verify calls), runbook drafting, + Published-Outcome Correction and Withdrawal Procedure drafting + → wiring plan → live wiring → connectivity validation → runbook + finalized → correction/withdrawal procedure finalized + (execution_candidate_commit fixed, full suite re-run against it, + clean tree confirmed) + → GO-2 (first governed transmission authorization — single-use, bound + to one action_id / payload_hash / execution_candidate_commit / + governance_config_version, with an explicit expiry) + → first governed post +``` + +GO-1 authorizes *preparation* — including starting live `submit_captcha_fn` wiring — but never +authorizes transmission. Concretely: the first-post rider's `t3_grounding_reference` field must be +populated before GO-1; `captcha_configuration_state`, `correction_procedure_reference`, +`execution_commit_reference`, and `operator_go_reference` (the GO-2 record specifically) must all +be populated before this rider is complete and the standard envelope may reach the transport. +GO-2 itself is single-use: bound to one `action_id`, one `payload_hash`, one +`execution_candidate_commit`, and one `governance_config_version`, with an explicit expiry — any +change to payload, code, configuration, or credentials invalidates it and requires a fresh GO-2 +record (§D of the checklist). If live wiring or transmission happens out of this order — wiring +before GO-1, transmission before a valid, unexpired, unconsumed GO-2 — that is a process violation +of this document, independent of whether the resolver would have approved the underlying action on +its own. + +## 4. What this document does not do + +- It does not create a new `ActionType`, a new Pi Script constraint, or a new 9.x grammar ruling. +- It does not change §9 reconciliation authority, §10 kill-switch triggers, or §14's dormant + automated triggers — none of those become active by virtue of this being the first post. +- It does not authorize live captcha wiring by itself (consistent with Note E's closing stop + condition: "First live observation requires a real write; that write is itself a governed + action needing its own approved envelope and operator go-ahead — this note does not authorize + it.") — that authorization is the Operator GO Checklist's job, not this rider's. +- It does not replace or weaken any Note A–F requirement; it is additive and first-instance-scoped + only. + +## 5. Discharge condition + +This document's obligations end **only** when all of the following are true: + +1. The first live action has reached a **non-ambiguous terminal state** — `publication_status` + is `PUBLISHED` or `NOT_PUBLISHED`, and `verification_status` is one of `PASSED`, `FAILED`, + `EXPIRED`, or `NOT_REQUIRED` (never left at a bare `REQUIRED` with no further resolution). + `OUTCOME_UNKNOWN` / `AMBIGUOUS_WRITE` (§9) is explicitly **not** a terminal state for this + purpose — the rider stays active for as long as either status is open, with no default timeout + that closes it out on its own. +2. Every required trace and verification record is persisted: the RESOLUTION TRACE for the + action, and — if verification was required — the corresponding `CaptchaAttemptRecord`. +3. The operator has recorded, in writing, either (a) acceptance of a `PUBLISHED` outcome, or + (b) completion of the applicable reconciliation procedure (§9) for an `OUTCOME_UNKNOWN` that + was subsequently resolved, or (c) completion of the Published-Outcome Correction and Withdrawal + Procedure (`docs/m7_operator_go_checklist.md` §C5) for a `PUBLISHED` outcome that required + correction or takedown. + +Only once all three are true does action #2 onward proceed under the standard transport spec +alone, with this rider closed. diff --git a/docs/m7_operator_go_checklist.md b/docs/m7_operator_go_checklist.md new file mode 100644 index 0000000..6bfbc92 --- /dev/null +++ b/docs/m7_operator_go_checklist.md @@ -0,0 +1,223 @@ +# M7 — Operator GO Checklist (First Live Post) + +**Status: DRAFT — pending operator review and sign-off.** Non-binding on +`docs/m7_moltbook_transport_boundary_and_deployment_spec.md`; amends no numbered section there. +This checklist exists to make the go decision itself auditable — a discrete, dated, signed +artifact — rather than an informal judgment call. It governs only the decision to (a) begin live +`submit_captcha_fn` wiring against the real `POST /api/v1/verify` endpoint and (b) transmit the +first live governed post or reply. It does not re-decide anything the transport spec, its Notes, +or the Pi Script constraint rulings already settled. + +**No item on this checklist may be marked complete from memory or general confidence.** Each item +carries four fields — `Status` / `Evidence` / `Verified by` / `Verified at` — and all four must be +filled before the item counts as satisfied. + +**Who may fill `Verified by`.** In Continuum's current single-operator deployment model, the +operator may serve as `Verified by`. This checklist does not invent a second reviewer that doesn't +exist. But `Verified by` must always name the accountable human, never an automated agent or tool +— test output, trace artifacts, and Claude-assisted analysis may all serve as `Evidence`, but none +of them may be recorded as the verifier. A human reviews and signs; automation only produces +material for that review. + +**Two-stage authorization, with four immutable identity layers.** A single broad GO would +authorize preparation and transmission under one signature, leaving execution-critical documents +unwritten at the moment "GO" is said, and would let an approval outlive the exact code/payload it +was granted for. This checklist splits authorization into GO-1 (permits preparation) and GO-2 +(permits one specific transmission, single-use): + +``` +GO-1 + preparation_baseline_commit + +Preparation (§C) + wiring implementation and operational documents + +GO-2 + execution_candidate_commit + action_id + payload_hash + config_version + authorization expiry + +Execution (§E) + clean-tree confirmation + immediate kill-switch precheck + transmission and terminal evidence +``` + +--- + +## A. Preliminary Readiness Review — gates GO-1 + +### A1. Longitudinal grounding + +| Item | Status | Evidence | Verified by | Verified at | +|---|---|---|---|---| +| T3 cohort re-sample complete (~2026-07-30 target) | | | | | +| IdentityIntegrity cross-session change-rate threshold grounded from real T1/T2/T3 data (no invented number — mirrors §14.1/§14.2's discipline) | | | | | +| CadenceIntegrity's second A1.6 falsification check (±5s grounding, Amendment 1) run against T3 and passed | | | | | +| Grounding result committed to `docs/` (addendum to `m7_identity_integrity_ruling.md` / `m7_cadence_integrity_ruling_amendment_1.md`, or a new dated note) — not left only in session memory | | | | | + +### A2. Engineering completeness (per CLAUDE.md test expectations) + +Do not gate on a fixed pass count — the number will legitimately change as scaffold work, T3 +documentation, or captcha-wiring tests are added. Gate on a named commit and its own recorded +result instead. This is the **preparation baseline** only — a separate, later commit is what +actually executes under GO-2 (see §D): + +``` +preparation_baseline_commit: +test_result: + passed: + xfailed: + xfail_census_reference: +``` + +| Item | Status | Evidence | Verified by | Verified at | +|---|---|---|---|---| +| Full suite green at `preparation_baseline_commit` — no failures | | | | | +| Every xfail present in the committed xfail census; none added, removed, or changed without a reviewed explanation | | | | | +| Implementation Note E's required test coverage (full/empty/partial captcha config, write-with-verification flow, confirmed-failure flow, ambiguous-outcome flow, trusted-agent no-verification flow, `verification_code` binding, expiry-from-`expires_at`, no-pacing assertion) implemented and passing | | | | | +| Dry Run mode (§11) exercised; structural isolation confirmed (production ingestion rejects the reserved Dry Run identifier namespace) | | | | | +| Kill switch (§10) manual activation (`KillSwitch.activate_manual(operator=...)`) and re-enablement (`KillSwitch.clear(operator=...)`) both exercised outside Dry Run isolation testing, with a `KillSwitchActivation` audit record produced and reviewed | | | | | + +**Scaffold hooks remain explicitly non-gating for M7 deployment.** (Full finding relocated to +`docs/scaffold_hooks_reconstruction_note.md` — this checklist stays narrowly executable and does +not carry unrelated infrastructure-debt design discussion.) + +### A3. Deployment packet reviewed + +| Item | Status | Evidence | Verified by | Verified at | +|---|---|---|---|---| +| `docs/m7_first_live_post_governed_envelope.md` read in full, including its explicit terminal-state discharge condition (§5) | | | | | +| This checklist read in full, including the two-stage GO-1/GO-2 split, before any item below is marked | | | | | +| §9 reconciliation-and-freeze path and manual kill switch understood as distinct from — and insufficient for — correcting or withdrawing an already-visible published post (this gap is exactly why §C requires a dedicated Published-Outcome Correction and Withdrawal Procedure before GO-2) | | | | | + +### A4. Rehearsal + +| Item | Status | Evidence | Verified by | Verified at | +|---|---|---|---|---| +| At least one Dry Run (§11) executed against a payload representative of the intended first post/reply — same shape, same `action_type` — producing detector results, Arbiter decision, approval trace, Approved Action Envelope, and simulated transport outcome, reviewed and free of surprises | | | | | + +--- + +## B. GO-1 — Deployment Preparation Authorization + +Requires all of §A complete (every item's four fields filled). Authorizes the *start* of +preparation work in §C — it does **not** authorize transmitting the first live post. + +``` +Status: +Evidence (pointer to completed §A record): +Authorized by (operator): +Authorized at: +Statement: "I have reviewed §A in full, at preparation_baseline_commit, and + authorize deployment preparation — live submit_captcha_fn wiring, + connectivity validation without transmission, and drafting of the + runbook and correction/withdrawal procedure — to begin. This + authorization does not permit the first live post." +``` + +This record is saved as its own dated artifact (e.g. `docs/m7_go1_decision_.md`), not left +as an unrecorded verbal/mental decision. + +--- + +## C. Preparation Work — performed under GO-1, gates GO-2 + +| Item | Status | Evidence | Verified by | Verified at | +|---|---|---|---|---| +| **C1.** Live CAPTCHA wiring plan completed — not required for §A's preliminary review, but required before wiring begins | | | | | +| **C2.** `submit_captcha_fn` wired live against real `POST /api/v1/verify`; `captcha_verifier`/`submit_captcha_fn` both-or-neither invariant confirmed at construction (Note E item 7); reviewed | | | | | +| **C3.** Endpoint connectivity validated — see wording below; **no governed post/reply and no synthetic CAPTCHA submission** issued solely as a connectivity probe | | | | | +| **C4.** First-post runbook finalized (step-by-step execution script for §E below) | | | | | +| **C5.** Published-Outcome Correction and Withdrawal Procedure finalized — must explicitly distinguish: delete (when supported), edit/correction (when supported), corrective follow-up (when neither is available), freeze-and-escalation (§9), and audit preservation. This is not a "rollback" in the atomic-reversal sense — most external APIs offer no such thing, and the procedure must not imply otherwise | | | | | + +C1 must be satisfied before C2 begins. C2–C5 may proceed in parallel once C1 is done, but all five +must be complete before §D can be sought. + +**C3 wording (binding):** Live API authentication and required endpoint reachability are validated +using **documented non-publishing operations only** (e.g. auth handshake, health check, feed +read). No synthetic CAPTCHA submission, governed post, reply, or other write is issued solely as a +connectivity probe — `POST /api/v1/verify` is not assumed to be safely callable outside a real +challenge, since a verification endpoint may require a genuine challenge and may mutate +server-side state. The real `/verify` path is exercised for the first time only when an actual +governed post legitimately produces a challenge during §E, unless the platform documents an +explicit sandbox or validation mechanism (none is currently known). + +--- + +## D. GO-2 — First Governed Transmission Authorization + +**GO-2 is single-use.** It authorizes exactly one transmission, bound to one exact combination of +code, payload, and configuration — not a standing permission that stays open across later changes. + +``` +execution_candidate_commit: +test_result: + passed: + xfailed: + xfail_census_reference: +tree_state: clean / — must be clean to proceed + +authorized_action_id: +authorized_payload_hash: +authorized_execution_commit: +authorized_config_version: +authorization_expires_at: +consumed_at: +``` + +Requires: + +| Item | Status | Evidence | Verified by | Verified at | +|---|---|---|---|---| +| §C1–C5 all complete, each with recorded evidence | | | | | +| Full suite green at `execution_candidate_commit`; no uncommitted changes in governed execution paths (a SHA does not prove the running workspace matches it unless the tree is clean) | | | | | +| First-Post Rider (`docs/m7_first_live_post_governed_envelope.md` §2) fully populated — `action_id`, `t3_grounding_reference`, `dry_run_rehearsal_reference`, `captcha_configuration_state`, `kill_switch_precheck`, `operator_go_reference` (this GO-2 record), `correction_procedure_reference` (pointing to the now-finalized C5 procedure), `execution_commit_reference` (pointing to `execution_candidate_commit`) | | | | | +| Exact payload and its `payload_hash` reviewed and approved by the operator | | | | | +| `KillSwitch.engaged` confirmed `False` at review time | | | | | + +``` +Status: +Evidence (pointer to completed §C + rider record): +Authorized by (operator): +Authorized at: +Statement: "I have reviewed the completed wiring, runbook, and + correction/withdrawal procedure, the exact payload, envelope, + and execution_candidate_commit for this action, and authorize + exactly one live governed transmission bound to the identifiers + above. Any payload, configuration, envelope, governed-code, + credential, or target-action change invalidates this + authorization and requires a new GO-2 record." +``` + +Saved as its own dated artifact (e.g. `docs/m7_go2_decision_.md`). This section is +intentionally manual — mirrors §10's kill-switch re-enablement rule (only the operator restarts +execution) applied in reverse: only the operator starts it. No automated check or CI green state +may substitute for this record. + +--- + +## E. Execution — under GO-2 + +| Item | Status | Evidence | Verified by | Verified at | +|---|---|---|---|---| +| Clean-tree confirmation re-checked immediately before send (workspace still matches `execution_candidate_commit`) | | | | | +| `KillSwitch.engaged` reconfirmed `False` immediately before send; operator has a tested, reachable `activate_manual(operator=...)` path open during the send | | | | | +| First live send executed under the standard `ActionEnvelope` referenced by the First-Post Rider; `authorized_action_id` and `authorized_payload_hash` match exactly | | | | | +| Resulting `transmission_status` / `publication_status` / `verification_status` recorded; RESOLUTION TRACE and, if verification ran, `CaptchaAttemptRecord` captured; `consumed_at` recorded on GO-2 | | | | | +| If outcome is `OUTCOME_UNKNOWN` / `AMBIGUOUS_WRITE`: no retry, freeze, escalate to operator per §9 — silence/ambiguity is never treated as success or failure. Per the envelope doc §5, the rider stays **active** (not discharged) until this resolves to a non-ambiguous terminal state | | | | | +| If `PUBLISHED` but incorrect: Published-Outcome Correction and Withdrawal Procedure (§C5) executed; rider discharged per envelope doc §5(3)(c) only once that procedure completes | | | | | + +--- + +## Scaffold-hooks debt — one line, non-gating + +Scaffold hooks remain explicitly non-gating for M7 deployment. The fuller finding (PR #30 hooks +were never committed — `.gitignore` excludes `.claude/*` except `.claude/skills/`, so any hook +files were always local-only; recovery vs. reconstruction is an open architectural question about +whether hooks are user-local tooling or tracked project infrastructure) lives in +`docs/scaffold_hooks_reconstruction_note.md`, kept separate from this operational checklist. diff --git a/docs/scaffold_hooks_reconstruction_note.md b/docs/scaffold_hooks_reconstruction_note.md new file mode 100644 index 0000000..693c5ff --- /dev/null +++ b/docs/scaffold_hooks_reconstruction_note.md @@ -0,0 +1,73 @@ +# Scaffold Hooks — Reconstruction Note + +**Status:** informational finding, not gating on M7 deployment (see +`docs/m7_operator_go_checklist.md` §A2 for the one-line non-gating statement). This note carries +the fuller finding and the architectural question it raises, kept out of the operational GO +checklist so that document stays narrowly executable. + +## What was actually found + +TODO.md's "Infrastructure / process debt" entry describes the item as: "Claude Code scaffold +hooks (PR #30) never installed — bash/`CLAUDE_*`-env-var shaped, need Windows + current-JSON- +interface rework before enabling." That phrasing implies the hook source files exist in the repo, +waiting for a rework pass. + +They don't. PR #30 (`3172e5a`, "chore: add Claude Code scaffold (CLAUDE.md + skills)") added +`CLAUDE.md` and the three `.claude/skills/*/SKILL.md` files, and its own commit message states +"Un-ignore `.claude/skills/` so the skills are tracked while local settings/hooks stay private." +The repo's `.gitignore` confirms this: `.claude/*` is ignored except `!.claude/skills/`. Hooks +were therefore always local-only and were never committed at any point in this repo's history. + +The debt is consequently not "repo code waiting for a Windows rework." It is: + +> Unrecoverable local scaffold-hook examples from PR #30 must either be located from an existing +> workstation copy or reconstructed from the intended behavior and interface. + +## The architectural question this raises + +Before doing either recovery or reconstruction, one decision needs to be made explicitly, because +it changes what "done" looks like: + +- **Are hooks intentionally user-local tooling** — personal workflow conveniences that + legitimately differ per contributor/workstation and have no business being tracked? If so, the + existing `.gitignore` boundary is correct as-is, and "closing this debt" just means Kevin + personally reconstructing or re-authoring his own local hooks, with no repo change required. + +- **Or are hooks project infrastructure** that every contributor should be able to install + reproducibly? If so, committing live `.claude` runtime state directly would be the wrong fix — + it would blur the local/tracked boundary PR #30 deliberately drew. The better shape is a tracked + canonical source that *generates* the local files, e.g.: + + ``` + tools/claude-hooks/ (or examples/claude-hooks/) + scripts/install-claude-hooks.ps1 + ``` + + An installer script creates the actual `.claude/...` runtime files from the tracked template — + preserving the local-config boundary while making the hook design itself version-controlled, + reviewable, and testable. + +This is Kevin's call, not something to resolve by default in either direction. It has no bearing +on M7 go-decision readiness and is out of scope for the deployment packet regardless of which way +it's resolved. + +## Update 2026-07-24 — recovery half resolved (workstation session) + +The "locate from an existing workstation copy" branch succeeded: the original scaffold hook +source was found in `Downloads/continuum-scaffold-v2.zip` +(`.claude/hooks/settings.example.json`, three hooks: post-edit targeted pytest, Stop-time full +suite + Discord notify, pre-Bash destructive-command guard). All three were reworked from the +dead bash/`CLAUDE_*`-env-var shape to the current stdin-JSON hook interface as Python scripts +(`.claude/hooks/pre_bash_guard.py`, `post_edit_tests.py`, `stop_suite_notify.py`) wired via +`.claude/settings.json`, and verified live: guard blocks `git push --force` (exit 2) and passes +benign commands; post-edit hook ran `pytest -k cadence` to green on an in-scope file and skipped +an out-of-scope one; Stop hook ran the full suite green (589 passed + 7 xfail, 6.6s) with the +original's PASS-webhook-failure-sends-FAIL bug fixed. `DISCORD_WEBHOOK_URL` unset = suite still +runs, result printed only. TODO.md's debt entry is updated accordingly. + +The architectural question above (user-local tooling vs. tracked canonical source + installer) +remains open and is still Kevin's call. One new data point for it: the 2026-07-23 laptop crash is +exactly the failure mode that destroys local-only files — the current install exists only in +this workstation's `.claude/`, so the tracked-canonical-source option now has a concrete +survivability argument, with this note's file list serving as the reconstruction reference in +the meantime.