From 9db036e4acebe4b8e08a073b1efd382f00d460f4 Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Thu, 29 Oct 2026 15:45:08 -0500 Subject: [PATCH] feat(verify-slice): add risk-scaled verification workflow - Add `skills/verify-slice/SKILL.md` (37 lines) defining proportional check sizing, falsifiable assertions, conditional blind runtime execution, white-box diff inspection, and 4-state dispositions (`PASS`, `FAIL`, `BLOCKED`, `INCONCLUSIVE`) separated from human release approval. - Add `skills/verify-slice/references/perspectives.md` specifying minimum checks per tier (`Lightweight`, `Standard`, `High-Assurance`), six review perspectives, and anti-rationalization rules. - Register `verify-slice` in `install.sh` and the active skill table in `README.md`. --- README.md | 1 + install.sh | 2 +- skills/verify-slice/SKILL.md | 37 +++++++++++++++++ .../verify-slice/references/perspectives.md | 40 +++++++++++++++++++ 4 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 skills/verify-slice/SKILL.md create mode 100644 skills/verify-slice/references/perspectives.md diff --git a/README.md b/README.md index 6bec537..dc60aa3 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ Every skill features an explicit **"Your call"** checkpoint where the agent paus | **[`build-skill`](skills/build-skill/SKILL.md)** | `/build-skill [topic]` | Interactive design, sizing, authoring, and empirical dogfooding of agent skills. Enforces design review gate before file creation. | 49 lines | | **[`inspect-flake-update`](skills/inspect-flake-update/SKILL.md)** | `/inspect-flake-update` | Inspects updated flake.lock inputs, reviews upstream revisions, runs nix flake check, and drafts commit messages. | 46 lines | | **[`nix-devshell`](skills/nix-devshell/SKILL.md)** | `/nix-devshell` | Authors, extends, validates, and troubleshoots project Nix development shells from repository evidence. | 75 lines | +| **[`verify-slice`](skills/verify-slice/SKILL.md)** | `/verify-slice` | Runs risk-proportional verification and PR review across behavioral, state, security, ergonomic, and regression perspectives using falsifiable assertions. | 37 lines | ### Vault Extensions (`extensions/`) diff --git a/install.sh b/install.sh index 409458d..b7ca725 100755 --- a/install.sh +++ b/install.sh @@ -33,7 +33,7 @@ while [[ $# -gt 0 ]]; do done # Active skills to install -ACTIVE_PORTABLE_SKILLS=(build-skill diagnose document git-commit inspect-flake-update journal-builder nix-devshell practice reconcile-docs) +ACTIVE_PORTABLE_SKILLS=(build-skill diagnose document git-commit inspect-flake-update journal-builder nix-devshell practice reconcile-docs verify-slice) ACTIVE_EXTENSION_SKILLS=(draft-curation commit-logger) # Legacy / deprecated skills to clean up or back up if found in target diff --git a/skills/verify-slice/SKILL.md b/skills/verify-slice/SKILL.md new file mode 100644 index 0000000..f96b949 --- /dev/null +++ b/skills/verify-slice/SKILL.md @@ -0,0 +1,37 @@ +--- +name: verify-slice +description: >- + Runs risk-proportional verification and pull request review across behavioral, + state, security, ergonomic, and regression perspectives using falsifiable + assertions. Use when verifying a vertical feature slice, reviewing a pull + request before merge, or planning QA checks. Not for root-cause debugging; + use diagnose. +--- + +# Verify Slice + +## Use when +- Verifying a vertical feature slice or pull request before human release review. +- Building or executing risk-proportional QA checks against acceptance criteria. +- Not for investigating an unknown failure from raw symptoms: use `diagnose`. + +## Steps +1. **Size checks to risk.** Inspect touched files, boundaries, and failure consequences, then apply the matching minimum check set in [perspectives](references/perspectives.md) (`Lightweight`, `Standard`, or `High-Assurance`) plus only the perspectives warranted by the diff. Proceed directly on routine checks within authorized scope; pause for confirmation only when verification would materially expand scope, incur substantial setup or subagent cost, or introduce a trade-off. +2. **Write falsifiable assertions.** Convert acceptance criteria and selected perspectives into concrete checks with explicit failure conditions (`FAIL if ...`) and required evidence. Never use open-ended observational prompts ("record what happens"). +3. **Verify runtime behavior.** Run required behavioral, state, and persistence checks against the live system when the tier requires it, confirming mutations via both UI state and authoritative backend reads. Execute directly by default; use a clean subagent (withholding the diff, PR narrative, and author self-audit) only when independent execution is likely to expose blind spots in stateful workflows or `High-Assurance` changes. +4. **Inspect the diff.** Audit the actual code diff and commit history against the selected code-level perspectives (untrusted data and URL sinks, authoritative state reconciliation, scope containment, and test coverage claims). +5. **Record dispositions honestly.** Score every check as `PASS`, `FAIL`, `BLOCKED`, or `INCONCLUSIVE` with evidence (see [perspectives](references/perspectives.md)). Never rationalize an unexpected result as a design trade-off, treat a missing check as passing, or convert an aggregate score into release approval. +6. **Present the evidence packet.** Group confirmed findings by source (runtime vs. diff), note discrepancies against the implementer's self-audit, surface blocked or unverified areas, and recommend a disposition without waiving failed criteria. + +## Your call +- **Expanded verification scope**: approve before spinning up costly test environments, isolated subagents, or checks outside previously authorized boundaries. +- **Handling non-passing checks**: decide whether a `FAIL`, `BLOCKED`, or `INCONCLUSIVE` check triggers a repair loop, an environment fix, a tracked follow-up issue, or an explicit waiver. +- **Release decision**: decide whether to accept residual risks and merge; verification evidence never authorizes release on its own. + +## Done when +- Every required check has an evidence-backed state (`PASS`, `FAIL`, `BLOCKED`, or `INCONCLUSIVE`) and the human owner has reviewed the evidence packet to decide release or rework. + +## Hands off to +- `diagnose`: when a failed or blocked check needs root-cause investigation. +- `git-commit`: when packaging approved verification or repair changes. +- `document`: when verification uncovers a durable architectural insight or decision. diff --git a/skills/verify-slice/references/perspectives.md b/skills/verify-slice/references/perspectives.md new file mode 100644 index 0000000..35581d2 --- /dev/null +++ b/skills/verify-slice/references/perspectives.md @@ -0,0 +1,40 @@ +# Verification Tiers, Perspectives, and Dispositions + +Reference for `verify-slice`. Keep effort proportional to failure consequences and change uncertainty rather than diff line count alone. + +## 1. Operational Rigor Tiers + +Each tier defines the minimum required checks. Escalate individual perspectives when a small diff touches a high-risk boundary (for example, a two-line auth or URL sanitizer change). + +| Tier | Typical Slice | Minimum Required Checks | Execution Mode | +| :--- | :--- | :--- | :--- | +| **Lightweight** | Copy updates, styling tweaks, isolated low-risk fixes with no new state or untrusted inputs | 1. Run relevant existing automated tests.
2. Targeted smoke/regression check on the touched view.
3. Concise diff check for scope containment. | Direct execution in current session. | +| **Standard** | New UI component, ordinary API integration, or modification to an established workflow | 1. Falsifiable assertions for every acceptance criterion.
2. Automated test suite, typecheck, and lint.
3. Runtime check of happy, empty, and error states plus persistence reload.
4. Targeted regression check on shared entrypoints.
5. White-box diff review of untrusted sinks and state updates. | Direct execution by default. Use an isolated black-box subagent only if multi-step workflow bias or author self-audit independence warrants the cost. | +| **High-Assurance** | Auth, permissions, payments, destructive actions, sensitive data, concurrent/conflict state, or cross-cutting architecture | All `Standard` checks, plus:
1. Explicit conflict, duplicate-submission, and aggregate-state reconciliation assertions.
2. Source-to-sink security audit with adversarial input tests.
3. Secondary backend/API reads confirming persisted truth after mutations. | Independent black-box subagent for behavioral scenarios paired with separate white-box diff review. | + +## 2. Selectable Review Perspectives + +Select only the perspectives relevant to the slice's risk profile. Give each selected perspective concrete assertions rather than vague instructions ("review security"). + +| Perspective | Core Question | Concrete Checks to Construct | +| :--- | :--- | :--- | +| **Behavioral & Workflow** | Can the user complete the intended end-to-end task across real states? | Verify each required user journey across loading, empty, error/retry, partial, and success states; confirm state survives reload and matches backend reads. | +| **State & Concurrency** | Do local UI elements, sibling rows, and aggregate counters stay aligned with authoritative state? | Check duplicate-click guards, timeout/retry recovery, and conflict responses (such as `409`); assert that aggregate counters and sibling items reconcile with authoritative server state rather than drifting via partial local heuristics. | +| **Security Boundaries** | Can untrusted data execute code, break attributes, or route to unsafe destinations? | Trace every dynamic value into DOM/template sinks: verify safe DOM APIs or HTML escaping for text and quoted attributes, context-appropriate URL validation for `href`/`src`/`action` (never relying on HTML escaping alone for URLs), and at least one adversarial payload check. | +| **Ergonomics & Accessibility** | Is the slice usable on narrow screens, with touch, and via keyboard/assistive tech? | Check narrow mobile viewport (`375px`) for overflow, `>= 44x44px` touch targets, sequential keyboard `Tab` focus, visible `:focus-visible` outlines, and `aria-live` announcements for dynamic feedback. | +| **Scope & Regression** | Did the slice disturb adjacent features or smuggle unrelated refactors? | Inspect shared files (`main`, routers, shared types/styles) for minimal additive footprint; run targeted smoke checks on neighboring views/endpoints. | +| **Commit & Evidence Hygiene** | Are commits localizable and does claimed test coverage match reality? | Check that commits separate coherent boundaries where practical and compare author self-audit claims against what unit/integration tests actually assert. | + +## 3. Four-State Disposition Contract + +Every required assertion ends in exactly one state: + +- `PASS`: Assertion satisfied with observable proof (command output, HTTP response, DOM measurement, or screenshot). +- `FAIL`: Assertion violated with reproducible steps and observed vs. expected output. +- `BLOCKED`: Check could not run due to an environmental, fixture, or dependency problem (distinct from a product bug; diagnose the blocker before judging the implementation). +- `INCONCLUSIVE`: Check ran, but collected evidence is insufficient to prove or falsify the assertion. + +### Anti-Rationalization Rules +1. **Expected values before observation**: State the exact pass/fail condition before running the check. If an assertion expects `2` and the system shows `1`, record `FAIL`, never `PASS` with a narrative excuse ("targeted reconciliation trade-off"). +2. **Separate seed/fixture health from product bugs**: Avoid fragile raw SQL test seeds when domain services or API helpers exist; if a fixture mismatches schema reality, mark `BLOCKED` and fix the fixture. +3. **Unique provenance**: When comparing author self-audit, black-box QA, and diff review, label whether each confirmed defect was caught by self-audit, black-box execution, or code inspection so process value stays measurable.