diff --git a/bin/wrap b/bin/wrap index 7e2b36a5..9eda58c9 100755 --- a/bin/wrap +++ b/bin/wrap @@ -6,7 +6,7 @@ # # Usage: # wrap scan [...] report only -# wrap session --json [--follow-mode lanes|all] [...] one read-only session gather +# wrap session --json|--summary [--transcript ] [--prs ,...] [--mark-dir [--since ] [--self ]...] [--follow-mode lanes|all] [...] one read-only session gather # wrap session --writers [--since ] [--check-mark ] [--mark ] [--self ]... [--text] foreign-writer facts # wrap apply [--apply] [--worktrees] [--archive-unmerged] [--archive-worktrees] [--pull-only|--no-pull] [--own ]... [...] gated writes, dry-run by default # wrap sweep [--apply] [--worktrees] [--json] [--no-fetch] [...] sweep repos under roots (or wrap.sweep_roots), dry-run default diff --git a/commands/wrap.md b/commands/wrap.md index a9c7ce13..3c4edc23 100644 --- a/commands/wrap.md +++ b/commands/wrap.md @@ -27,7 +27,7 @@ bin/wrap session --summary [--transcript ] --mark-dir "$scratch" [-- - `--mark-dir` is step 0's check for activity before the wrap, taken per repo before the repo is read. It records each writer mark as `writers_mark="$scratch/writers-.json"`, the repo's absolute path without its leading slash and with `/` as `-`; the `writers` line prints the path. Its `foreign_activity` (an `index.lock`, or a reflog row newer than the session start in any worktree except the session's own, the main checkout included) stops the repo exactly as the landing pass describes. The `--transcript` start epoch is the target session's real start; without a transcript, pass `--since` with the time this wrap started. - `--summary` prints every field this command reads, one fact per line. Read it once. `--json` prints the same gather as one `wrap-session/1` document for a tool; never re-read either with `jq`. -The gather holds config knobs, activity-log state, the named PRs, and per repo the checkout, dirty files, worktrees, writer facts, active board rows, handoffs, own open PRs with check totals and gates, recent merge deploy state, and the sweep report. Treat it as facts, not as proof of intent. Rows this session did not touch stay untouched. +The gather holds config knobs, activity-log state, the named PRs, and per repo the checkout, dirty files, worktrees, writer facts, active board rows, handoffs, own open PRs with check totals and gates, recent merge deploy state, the sweep report, and `plan` lines (what wrap would merge, flip, carry, or clean). Treat it as facts, not as proof of intent. Rows this session did not touch stay untouched. **What the gather replaces.** Run none of these when the gather covers the fact: `git status`, `git log`, `git for-each-ref` or any other git read; `wrap scan` or a `wrap apply` dry run (the summary's `sweep` lines carry its verdicts); a grep, `rg`, `jq`, Glob or Read over the transcript or to find a repo; a re-read of the gather; `gh pr view` or `gh run list` one PR at a time (put the PR in `--prs`); a `--help` call. The target is 10 lead calls per wrap: this file, the digest, the gather with the miner beside it, the one step 7b lookup, one `flick-7b`, and only the writes a decision needs. @@ -84,7 +84,7 @@ When any write step ran, run one final read-only gather over the same repos befo **Where each detail comes from.** Every count, PR number, PR purpose, and actor in the report comes from the gather (a live PR row: `title`, `author`, `merged_by`, state) or a verbatim line of the recall digest. The miner's claims are leads: check each against the gather or the digest before it enters the report. A detail you cannot check stays out; never guess it. A PR's purpose is its live title, not a summary of the transcript. An actor is the gather's `author` or `merged_by`, or the digest line that names who acted: the operator, the session, a bot, or a worker are different actors. -Draft the skim-first report, write it to scratch. Run the lint before printing: `bash lib/wrap/report-lint.sh `. Fix or do what the lint names, then re-run. Never read the lint's source; when it cannot run, say so in one `SKIPPED` FYI row. The shape is: +Draft the skim-first report, write it to scratch. Run the lint before printing: `bash lib/wrap/report-lint.sh [--gather ] `. Fix or do what the lint names, then re-run. Never read the lint's source; when it cannot run, say so in one `SKIPPED` FYI row. The shape is: ```markdown ## Wrap: @@ -129,6 +129,7 @@ Rules that the lint and operator rely on: - Status words stay uppercase: `NOTHING`, `DEPLOYED`, `MERGED, NOT DEPLOYED`, `OPEN`, `PULL BLOCKED`. - Prose is STE-lite: sentences of 20 words or fewer, active voice, one topic per bullet, no filler. - `What happened` quotes real proof output, never only "tests pass". Use `## How I verified it` output where a follow-through commit carries it. +- **Planned writes.** Account for every `plan` line in the gather (merge, flip, carry, clean): state what wrap merged, flipped, carried, or cleaned, or in a dry run / when skipped, what it would do. Never invent a planned write the gather lacks (for example, holding a board flip when `board none`). - `Shipped`, `Left alone`, and `FYI` are tables; `- NOTHING` replaces the whole table. - `Left alone` comes from the final gather, never memory. This pass's residue gets rows; foreign residue collapses to one count row unless `wide`. - Every `FYI` row OPENS WITH ITS TAG in caps: `SKIPPED`, `STATE`, or `INCIDENT`. **`FYI` carries no ask.** A follow-up lives in the report, and the report is its home; it never mints a board row or a staging block. Name a home only when one already exists. diff --git a/docs/reference/FEATURES.md b/docs/reference/FEATURES.md index d16b9707..6fe76198 100644 --- a/docs/reference/FEATURES.md +++ b/docs/reference/FEATURES.md @@ -20,7 +20,7 @@ GENERATED , do not hand-edit. Regenerate: `bash lib/registry/feature-registry.sh | `/kit:design` | `[H/I]` | Opt-in interactive solution-design beat between /think and /spec. Use when the operator wants to shape HOW to build after the idea passed /… | SPEC-003, SPEC-004, SPEC-005 +162 | test-anomalies-advisor.sh, test-board-mirror-cleanup.sh, test-ceremony-fits-diff.sh +40 | | `/kit:devs-team` | `[H/I]` | Parallel multi-lens critique of a solution design (the active spec if present, else the decision brief). Dispatches 5 engineering lenses, m… | SPEC-016, SPEC-018, SPEC-019 +14 | test-gate-vocab-recording.sh, test-meta-review-verifiers.sh, test-meta-spec-depth.sh +1 | | `/kit:dispatch` | `[H/I]` | Fire several disjoint VALIDATED specs concurrently, each in its own worktree, then converge. Cross-goal fan-out behind a disjointness gate … | SPEC-002, SPEC-016, SPEC-017 +114 | test-advisor.sh, test-agent-effectiveness.sh, test-attempt-state-race.sh +52 | -| `/kit:docs` | `[H/I]` | Update all project documentation to match the current codebase. Cross-references the diff against every doc file and fixes drift. | SPEC-001, SPEC-002, SPEC-003 +292 | conform.sh, test-active-spec-pick.sh, test-adapters.sh +164 | +| `/kit:docs` | `[H/I]` | Update all project documentation to match the current codebase. Cross-references the diff against every doc file and fixes drift. | SPEC-001, SPEC-002, SPEC-003 +292 | conform.sh, test-active-spec-pick.sh, test-adapters.sh +166 | | `/kit:draft-agent` | `[H/I]` | Meta-agent agent-builder. From a one-line description, generates a new subagent definition OR a mega-goal sub-goal file and (by default) in… | SPEC-089, SPEC-108, SPEC-139 +1 | test-agent-effectiveness.sh, test-command-emit-sweep.sh, test-meta-agent.sh +1 | | `/kit:execute` | `[H/I]` | Whole-spec execution with verification. Dispatches one builder for the whole spec, verifies every task's criteria once at the end, retries … | SPEC-001, SPEC-003, SPEC-004 +82 | test-board-work.sh, test-break-it.sh, test-config-registry.sh +29 | | `/kit:explain` | `[H/I]` | Turn a merged change into a literate-diff explainer a human READS to understand: background -> goal + intuition -> a prose-ordered diff -> … | SPEC-050, SPEC-060, SPEC-094 +25 | test-boundary-lint.sh, test-clean-room.sh, test-command-emit-sweep.sh +13 | @@ -30,14 +30,14 @@ GENERATED , do not hand-edit. Regenerate: `bash lib/registry/feature-registry.sh | `/kit:grill` | `[H/I]` | Universal intake interview: one type-shaped question at a time, each with a recommended answer, until the task is actually understood. Answ… | SPEC-058, SPEC-059, SPEC-063 +27 | test-anomalies-advisor.sh, test-ceremony-lens.sh, test-config-stamp.sh +17 | | `/kit:kit-health` | `[H/I]` | Run a self-assessment of the kit against its own philosophy. Checks file count, hook performance, source citations, and structural health. | SPEC-001, SPEC-002, SPEC-004 +18 | test-command-emit-sweep.sh, test-meta-docs-registry.sh, test-meta-goal-ledger.sh +4 | | `/kit:mega` | `[H/I]` | Turn a multi-objective destination into a sequenced roadmap of dependent sub-goals: decompose, front-load every clarification once, set the… | SPEC-034, SPEC-036, SPEC-088 +53 | test-adapters.sh, test-advisor.sh, test-bin-forwarders.sh +45 | -| `/kit:next` | `[H/I]` | Pick up the next undone task from the spec. Loads context, shows acceptance criteria, lets you drive the implementation. | SPEC-001, SPEC-002, SPEC-003 +146 | smoke.sh, test-active-spec-pick.sh, test-adapters.sh +96 | +| `/kit:next` | `[H/I]` | Pick up the next undone task from the spec. Loads context, shows acceptance criteria, lets you drive the implementation. | SPEC-001, SPEC-002, SPEC-003 +146 | smoke.sh, test-active-spec-pick.sh, test-adapters.sh +97 | | `/kit:onboard` | `[H/I]` | Guided first-run: detect the install mode, offer /kit:adopt for this repo, pick modules, capture the consumer knobs that make them work, di… | SPEC-199, SPEC-213, SPEC-232 +3 | test-clean-room.sh, test-command-emit-sweep.sh, test-onboard-detect.sh | | `/kit:pitch` | `[H/I]` | Assemble an outward buy-in doc from what a gated run already produced: the spec, the proof-of-done, the implementation-notes, and the gate … | SPEC-140, SPEC-141, SPEC-193 +7 | test-gate-validate-round.sh, test-outcome-emit-sweep.sh, test-pitch.sh +2 | | `/kit:prototype` | `[H/I]` | Opt-in throwaway-spike beat beside /kit:design. Builds throwaway code that answers ONE design question: a logic/state model driven by hand … | SPEC-075, SPEC-206, SPEC-207 +3 | test-picture-section.sh | | `/kit:quiz-gate` | `[H/I]` | The ★-tap NUDGE before merging a significant+worthy gate PR: a 5-question quiz built from the ACTUAL diff+tests, handed to the operator's… | SPEC-125, SPEC-127, SPEC-136 +3 | test-boundary-lint.sh, test-install-modules.sh, test-kit-contract.sh +3 | | `/kit:retro` | `[H/I]` | Run a retrospective after shipping. Captures what worked, what didn't, and action items for the next cycle. Outputs to docs/retro/RETRO.md. | SPEC-002, SPEC-003, SPEC-006 +48 | smoke.sh, test-command-emit-sweep.sh, test-gate-vocab-recording.sh +10 | | `/kit:review-team` | `[H/I]` | Parallel code review with 3 specialist lenses plus the kit-default kit:advisor extra lens. Dispatches the security, architecture, and test-… | SPEC-002, SPEC-003, SPEC-007 +50 | test-advisor.sh, test-config-registry.sh, test-every-step-review.sh +10 | -| `/kit:review` | `[H/I]` | Paranoid code review. Security, architecture, regressions, missing tests, edge cases. Produces actionable TODOS. | SPEC-001, SPEC-002, SPEC-003 +155 | smoke.sh, test-adopt.sh, test-advisor.sh +90 | +| `/kit:review` | `[H/I]` | Paranoid code review. Security, architecture, regressions, missing tests, edge cases. Produces actionable TODOS. | SPEC-001, SPEC-002, SPEC-003 +155 | smoke.sh, test-adopt.sh, test-advisor.sh +91 | | `/kit:ship` | `[H/I]` | Ship: review gate, tests, version bump, changelog, conventional commit, docs update, PR. Complete pipeline from done to merged. | SPEC-001, SPEC-002, SPEC-003 +111 | test-active-spec-pick.sh, test-adopt.sh, test-board-mirror.sh +65 | | `/kit:spec-validate` | `[H/I]` | Adversarial review of a spec before implementation. 7 specialist lenses attack the spec from different angles (6 advisory, 1 blocking on th… | SPEC-002, SPEC-003, SPEC-004 +70 | test-command-emit-sweep.sh, test-design-record.sh, test-every-step-review.sh +10 | | `/kit:spec` | `[H/I]` | Generate a development spec from a feature idea or decision brief. Creates docs/specs/ with structured requirements. | SPEC-001, SPEC-002, SPEC-003 +241 | test-active-spec-pick.sh, test-audit-verdict-grammar.sh, test-bin-forwarders.sh +111 | @@ -50,7 +50,7 @@ GENERATED , do not hand-edit. Regenerate: `bash lib/registry/feature-registry.sh | `/kit:verify` | `[H/I]` | Re-run the test levels (kit:task-verifier + kit:integration-verifier + kit:acceptance-verifier, plus kit:system-verifier only with --full) … | SPEC-002, SPEC-003, SPEC-006 +57 | test-board-digest.sh, test-board-hermes.sh, test-board-lock-required.sh +35 | | `/kit:visual-team` | `[H/I]` | Parallel multi-lens critique of a visual/UI design. Dispatches 5 design lenses, merges findings, reports a verdict. Report-only, downstream… | SPEC-016, SPEC-018, SPEC-019 +12 | test-command-emit-sweep.sh, test-meta-review-verifiers.sh, test-meta-spec-depth.sh +1 | | `/kit:wayfind` | `[H]` | Plan a chunk of work too big for one agent session as a shared decision map: map.md + typed decision tickets in the mega-goal folder, resol… | SPEC-206, SPEC-207, SPEC-217 +2 | - | -| `/kit:wrap` | `[H/I]` | The session-scoped landing step after ship: flips board rows, merges green PRs, checks deploys, tidies worktrees, prints the skim-first rep… | SPEC-020, SPEC-060, SPEC-072 +75 | test-bash32-parse.sh, test-bin-forwarders.sh, test-board-lock-required.sh +59 | +| `/kit:wrap` | `[H/I]` | The session-scoped landing step after ship: flips board rows, merges green PRs, checks deploys, tidies worktrees, prints the skim-first rep… | SPEC-020, SPEC-060, SPEC-072 +75 | test-bash32-parse.sh, test-bin-forwarders.sh, test-board-lock-required.sh +61 | ## Agents diff --git a/docs/reference/wrap.md b/docs/reference/wrap.md index cc2891ca..7d53dc39 100644 --- a/docs/reference/wrap.md +++ b/docs/reference/wrap.md @@ -36,7 +36,7 @@ Each row below was read from the verb's source in `lib/wrap/`. | Merge one green PR of mine | `wrap merge --apply [--pr ] ` | Squash-merges exactly one PR per call, pinned to the head it gated. It takes exactly one `` path. Only PRs I authored count; `--pr` naming another author's PR is refused. With `--pr`, exit 0 means that PR merged; a SKIP or nothing eligible exits 4. After a merge it fast-forwards the checkout it was handed the way `land` does (`_land_ff_pull`, ff-only, never forced): `pulled : `. `--no-pull` skips it and prints `SKIP pull: --no-pull; not pulled, run: wrap apply --apply --pull-only `; a checkout off the default branch, or a pull that cannot fast-forward, prints `PULL BLOCKED: ...` with the same command. None of these changes the exit code. A dry run, `--repo /` (no checkout) and a call that merged nothing never pull. | | The PR is a draft | `wrap merge --apply --pr ` | Runs `gh pr ready` first. Without `--pr`, a draft is skipped. | | Report repo state | `wrap scan [...]` | Prints ahead and behind counts, dirty files, worktrees, local branches, and my open PRs. It refreshes with `git fetch --prune`, so it is report-only for the worktree, not a no-write gather. | -| Gather the session-close facts as JSON | `wrap session --json [--follow-mode lanes\|all] [...]` | Read-only. Prints one `wrap-session/1` document: config knobs, activity-log state, and per repo checkout state, active board rows, handoffs, the origin and GitHub slug, own open PRs with links, check totals and gates, recent merge deploy state, and the sweep report. It prefers `wrap sweep --json` and otherwise falls back to read-only local inventory text; neither path fetches. | +| Gather the session-close facts as JSON or summary | `wrap session --json\|--summary [--transcript ] [--prs ,...] [--mark-dir [--since ] [--self ]...] [--follow-mode lanes\|all] [...]` | Read-only (except `--mark-dir`, which writes writer marks into the scratch directory before reading each repo). `--json` prints one `wrap-session/1` document; `--summary` prints the same facts one per line. `--transcript` reads the target session and its subagent transcripts for repos, PR URLs, acted PRs, and the opening epoch; `--prs` adds named PRs read live in one batched GraphQL call. Per repo it gathers checkout state, active board rows, handoffs, origin and GitHub slug, own open PRs with check totals and gates, recent merge deploy state, sweep report, and planned writes. Neither sweep path fetches. | | Re-check whether another writer is active | `wrap session --writers --check-mark STATE [--self WT]... [--text] ` | Prints one `wrap-writers/1` document: one row per worktree other than the session's own, except the main checkout, which is never excluded. Each row carries that worktree's `index.lock` state and HEAD-reflog identity compared with the mark. `wrap session --writers --mark STATE [--self WT]... ` records the mark in scratch state. `--since EPOCH` remains the stateless fallback. `--text` prints the same facts as text. | | Tidy a repo, preview first | `wrap apply ` | Dry run by default. Prints `WOULD ...` lines. Add `--apply` to write. | | Remove merged worktrees, all sessions | `wrap apply --apply --worktrees ` | Removes every clean, non-detached worktree whose branch is proven merged, then deletes the branch. Other sessions' worktrees qualify too. A worktree holding uncommitted work (including untracked files when `status.showUntrackedFiles=no`), skip-worktree or assume-unchanged entries (including sparse checkouts), an initialized submodule, a gitlink with a `.git` on disk, or a non-empty git-dir `modules/` directory, a non-regenerable ignored path (anything outside the build-cache list or an identical `.claude/` copy under non-symlinked directories in the main checkout), an odd path, a status that fails or changes right before removal, or an unreadable check is kept with its branch. | @@ -317,64 +317,51 @@ Invoke the skill named by `wrap.after`, read back in step -1, through the Skill Print the skim-first block below. It is the single reply for this command's landing; there is no separate per-step report. Step 10 alone prints a second, `## Follow-through:` report after background work, and only when it runs. ``` -## Wrap: +## Wrap: session wrap follow-ups -✅ **Needs you:** NOTHING - -- or -- -🔴 **Needs you:** -a. DECIDE | RUN | REVIEW | UNBLOCK . . . -b. ... +**Result:** Landed the session PR, flipped DK-101, and kept foreign worktrees untouched. + +✅ **Needs you:** NOTHING (walked: digest 4 replies, miner 2 actions) **What happened** -- ****: . . . . +- **wrap-session**: Added one-call gather flags. Proof: `test-wrap-session: all 159 passed`. **Shipped** | Repo | PR | Merge | Deploy | |---|---|---|---| -| | # | | DEPLOYED | -| | # | | 🟡 MERGED, NOT DEPLOYED | -| | # | | OPEN | - -- or -- -- NOTHING +| devkit | #1257 | 74475fb1 | DEPLOYED push-main | +| devkit | #1261 | 64ca6ef7 | 🟡 MERGED, NOT DEPLOYED | +| devkit | #1262 | | OPEN | **Left alone:** | Repo | Item | Owner | Why | |---|---|---|---| -| | | this pass | , PULL BLOCKED | -| | foreign worktrees, foreign branches, dirty files | other sessions | untouched (`/kit:wrap wide` lists them) | - -- or -- -- NOTHING - -**Built:** BUILT