fix(code-review): formalize Step 6 executable runtime checks contract
- Pin base and head commit SHAs alongside staged, unstaged, and untracked state fingerprints - Require Step 6 checks to emit copy-pasteable fenced commands from repository root - Classify command scope into local vs. live-infra with explicit pass/fail conditions - Define Ready and Ready (Conditional) semantics for downstream handshake reuse
This commit is contained in:
1 parent
f43146bb18
commit
09911e8d9e
3 files changed
+33
-11
No files matched your search
@@ -16,7 +16,7 @@ description: >-
|
|||||||
- Not for debugging an unknown symptom: use `diagnose`.
|
- Not for debugging an unknown symptom: use `diagnose`.
|
||||||
|
|
||||||
## Steps
|
## Steps
|
||||||
1. **Pin the fixed point and scope.** Resolve the base ref and record its commit SHA via `git rev-parse <base>`. Inspect working-tree state (`git status --short`, unstaged `git diff`, staged `git diff --cached`) alongside committed history (`git diff <base>...HEAD` and `git log <base>..HEAD --oneline`). Report findings distinguished across committed, staged, and unstaged changes.
|
1. **Pin the fixed point and scope.** Resolve the base ref and record exact base and head commit SHAs (`git rev-parse <base> HEAD`). Inspect working-tree state (`git status --short`, unstaged `git diff`, staged `git diff --cached`, and relevant untracked files) alongside committed history (`git diff <base>...HEAD` and `git log <base>..HEAD --oneline`). Record the covered revisions and working-tree diff state (for example, clean tree or diff fingerprint) so downstream tools can verify whether the reviewed diff remained unchanged, and distinguish findings across committed, staged, and unstaged changes.
|
||||||
2. **Select execution tier.** Match the change to the risk tiers from [axes](references/axes.md) (`Lightweight`, `Standard`, or `High-Assurance`). Single-agent sequential pass for Lightweight; independent review passes for Standard; isolated subagents per axis for High-Assurance.
|
2. **Select execution tier.** Match the change to the risk tiers from [axes](references/axes.md) (`Lightweight`, `Standard`, or `High-Assurance`). Single-agent sequential pass for Lightweight; independent review passes for Standard; isolated subagents per axis for High-Assurance.
|
||||||
3. **Inspect the four axes.** Evaluate the diff against each axis independently using [axes](references/axes.md):
|
3. **Inspect the four axes.** Evaluate the diff against each axis independently using [axes](references/axes.md):
|
||||||
- **Spec & Scope**: originating requirements satisfied, minimal shared-file footprint, zero scope creep.
|
- **Spec & Scope**: originating requirements satisfied, minimal shared-file footprint, zero scope creep.
|
||||||
@@ -25,8 +25,8 @@ description: >-
|
|||||||
- **Defensive Invariants**: system properties from [defensive-invariants](references/defensive-invariants.md) (trust boundaries, authority, consistency, failure semantics, resource limits).
|
- **Defensive Invariants**: system properties from [defensive-invariants](references/defensive-invariants.md) (trust boundaries, authority, consistency, failure semantics, resource limits).
|
||||||
4. **Record structured findings.** Record every finding using the schema in [finding-schema](references/finding-schema.md) (`ID`, `Axis`, `Severity`, `Evidence`, `Invariant`, `Impact`, `Disposition`). A strong pass on one axis never compensates for a failure on another.
|
4. **Record structured findings.** Record every finding using the schema in [finding-schema](references/finding-schema.md) (`ID`, `Axis`, `Severity`, `Evidence`, `Invariant`, `Impact`, `Disposition`). A strong pass on one axis never compensates for a failure on another.
|
||||||
5. **Aggregate without silent resolution.** When multiple reviewers or passes disagree, keep the disagreement visible under `Unresolved` until evidence settles it.
|
5. **Aggregate without silent resolution.** When multiple reviewers or passes disagree, keep the disagreement visible under `Unresolved` until evidence settles it.
|
||||||
6. **Recommend runtime verification scenarios.** Identify stateful or high-risk paths that static inspection cannot prove and list them as suggested scenarios for `verify-slice`.
|
6. **Emit executable runtime checks.** For stateful or high-risk paths that static inspection cannot prove, emit runnable fenced shell commands for `verify-slice` following the Step 6 contract in [finding-schema](references/finding-schema.md) (stating purpose, `local` vs. `live-infra` scope classification, explicit pass condition, and explicit failure signal).
|
||||||
7. **Present the review summary.** Group findings by axis and apply the decision matrix from [axes](references/axes.md): `Needs Rework` (confirmed defects require changes), `Blocked` (unresolved Critical/High risks or unestablished scope), or `Ready` (no blocking defects; documented trade-offs accepted by owner). Never authorize release: the human owner decides release.
|
7. **Present the review summary.** Group findings by axis and apply the decision matrix from [axes](references/axes.md): `Needs Rework` (confirmed defects require changes), `Blocked` (unresolved Critical/High risks or unestablished scope), or `Ready` (all four axes completed, no confirmed or unresolved blocking findings remain, and exact covered revisions plus working-tree state are recorded). Static review establishes static provenance for that diff only; never authorize release.
|
||||||
|
|
||||||
## Your call
|
## Your call
|
||||||
- **Handling findings**: decide whether confirmed findings block merge, trigger a rework loop, or become tracked follow-up issues.
|
- **Handling findings**: decide whether confirmed findings block merge, trigger a rework loop, or become tracked follow-up issues.
|
||||||
@@ -34,7 +34,7 @@ description: >-
|
|||||||
- **Authorizing release**: verification and review evidence inform decisions, but the human owner remains the sole release authority.
|
- **Authorizing release**: verification and review evidence inform decisions, but the human owner remains the sole release authority.
|
||||||
|
|
||||||
## Done when
|
## Done when
|
||||||
- All four axes have been inspected across working-tree and committed changes, every finding is recorded with evidence and disposition, candidate runtime scenarios are passed to `verify-slice` if needed, and the human owner has reviewed the findings.
|
- All four axes have been inspected across working-tree and committed changes, every finding is recorded with evidence and disposition, executable Step 6 runtime checks are emitted for `verify-slice` if needed, and the human owner has reviewed the findings.
|
||||||
|
|
||||||
## Hands off to
|
## Hands off to
|
||||||
- `diagnose`: when a finding exposes a root cause that requires deeper troubleshooting.
|
- `diagnose`: when a finding exposes a root cause that requires deeper troubleshooting.
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ The distinction between recommendations is clear: `Needs Rework` means an establ
|
|||||||
| **Scope Inability or Missing Base Ref** | `Blocked` | Establish base commit and diff boundaries before reviewing. |
|
| **Scope Inability or Missing Base Ref** | `Blocked` | Establish base commit and diff boundaries before reviewing. |
|
||||||
| **No Blocking Findings** | `Ready` | Implementation is structurally sound; proceed to `verify-slice` or release. |
|
| **No Blocking Findings** | `Ready` | Implementation is structurally sound; proceed to `verify-slice` or release. |
|
||||||
|
|
||||||
|
### `Ready` Semantics and Downstream Reuse
|
||||||
|
`Ready` means the review completed across all four axes, no confirmed or unresolved blocking findings remain (`Needs Rework` or `Blocked`), and the report explicitly identifies the base revision, head revision, and relevant working-tree state it covered. `Ready (Conditional)` qualifies as `Ready` for downstream handshake reuse only after the human owner adjudicates the open Medium/Low items (`Accepted Trade-off` or `Rejected`). A `Ready` review establishes static provenance for that exact diff; it does not substitute for runtime verification or authorize release.
|
||||||
|
|
||||||
### Documented Trade-Off Acceptance
|
### Documented Trade-Off Acceptance
|
||||||
When a human owner accepts a documented trade-off for a Medium or Low finding, record the finding disposition as `Accepted Trade-off` (distinct from `Rejected`). This preserves audit traceability without misclassifying an intentional compromise as a disproven defect.
|
When a human owner accepts a documented trade-off for a Medium or Low finding, record the finding disposition as `Accepted Trade-off` (distinct from `Rejected`). This preserves audit traceability without misclassifying an intentional compromise as a disproven defect.
|
||||||
|
|
||||||
@@ -50,4 +53,4 @@ To keep review overhead proportional to risk, execution mode reuses the tiers es
|
|||||||
When multiple passes or subagents inspect a change:
|
When multiple passes or subagents inspect a change:
|
||||||
1. **Never silently resolve disagreements**: If Reviewer A flags a pattern as a defect and Reviewer B considers it acceptable, record the finding under `Unresolved` with both perspectives cited. The human owner adjudicates.
|
1. **Never silently resolve disagreements**: If Reviewer A flags a pattern as a defect and Reviewer B considers it acceptable, record the finding under `Unresolved` with both perspectives cited. The human owner adjudicates.
|
||||||
2. **Preserve exact evidence**: Every finding must include exact file paths, line numbers, and code snippets demonstrating the condition.
|
2. **Preserve exact evidence**: Every finding must include exact file paths, line numbers, and code snippets demonstrating the condition.
|
||||||
3. **Recommend runtime verification**: Where static analysis cannot verify dynamic timing, rendering, or network failure modes, formulate concrete candidate assertions and pass them to `verify-slice`.
|
3. **Emit executable runtime checks**: Where static analysis cannot verify dynamic timing, rendering, or network failure modes, formulate runnable Step 6 checks formatted per [finding-schema](finding-schema.md) and pass them to `verify-slice`.
|
||||||
@@ -37,7 +37,7 @@ The final review summary presented to the user must follow this structure:
|
|||||||
|
|
||||||
## Overview & Scope State
|
## Overview & Scope State
|
||||||
- **Base Commit**: `<base-ref>` (`<base-commit-sha>`) -> `<HEAD>` (`<head-commit-sha>`)
|
- **Base Commit**: `<base-ref>` (`<base-commit-sha>`) -> `<HEAD>` (`<head-commit-sha>`)
|
||||||
- **Working Tree State**: Clean / Staged Changes / Unstaged Changes (`git status --short`)
|
- **Covered Working-Tree State**: `Clean` | Staged, unstaged, and relevant untracked summary plus content fingerprint (covering staged changes, unstaged changes, and relevant untracked file contents so downstream tools can verify zero state drift)
|
||||||
- **Assigned Risk Tier**: `Lightweight` | `Standard` | `High-Assurance`
|
- **Assigned Risk Tier**: `Lightweight` | `Standard` | `High-Assurance`
|
||||||
- **Execution Mode**: `Sequential` | `Independent Passes` | `Subagent Reviewers`
|
- **Execution Mode**: `Sequential` | `Independent Passes` | `Subagent Reviewers`
|
||||||
|
|
||||||
@@ -65,12 +65,31 @@ The final review summary presented to the user must follow this structure:
|
|||||||
- **Seam & Test Integrity**: Evaluation of test boundaries, tautological assertions, and vertical slice evidence.
|
- **Seam & Test Integrity**: Evaluation of test boundaries, tautological assertions, and vertical slice evidence.
|
||||||
- **Defensive Invariants**: Status of trust boundaries, authority, consistency, failure semantics, and resource limits.
|
- **Defensive Invariants**: Status of trust boundaries, authority, consistency, failure semantics, and resource limits.
|
||||||
|
|
||||||
## Recommended Runtime Scenarios for verify-slice
|
## Executable Runtime Checks for verify-slice
|
||||||
List concrete runtime checks or adversarial test cases that static inspection identified as necessary for runtime verification:
|
Every candidate runtime check must be directly consumable by `verify-slice` without reinterpreting narrative prose. Commands must assume execution from the repository root and use repository-relative paths (if an external path or environment dependency is genuinely required, declare that dependency and scope explicitly). Each entry requires:
|
||||||
1. Scenario: Verify out-of-band 409 conflict handling with simultaneous check-in attempts.
|
- **Purpose** in the check header (`Check RV-XX: <purpose>`).
|
||||||
2. Scenario: Verify input sanitization with payload `<img src=x onerror=alert(1)>`.
|
- **Scope**: `local` (safe workstation or isolated fixture execution) or `live-infra` (touches privileged permissions, host state, or external/production infrastructure; executable when the human owner explicitly authorizes the target environment and operation, otherwise recorded by `verify-slice` as `BLOCKED (out-of-bounds)`).
|
||||||
|
- **Pass Condition**: explicit observable output or state transition.
|
||||||
|
- **Failure Signal**: explicit contradiction condition.
|
||||||
|
- **Command**: copy-pasteable fenced shell block.
|
||||||
|
|
||||||
|
### Check RV-01: Out-of-band conflict handling on concurrent submission
|
||||||
|
- **Scope**: `local`
|
||||||
|
- **Pass Condition**: First request returns HTTP `200`; concurrent duplicate returns HTTP `409` with JSON code `conflict` and persisted count increments by `1`.
|
||||||
|
- **Failure Signal**: Duplicate returns `200` or `500`, unhandled traceback, or persisted count increments by `2`.
|
||||||
|
```sh
|
||||||
|
./scripts/test-concurrency-check.sh --endpoint /api/check-in
|
||||||
|
```
|
||||||
|
|
||||||
|
### Check RV-02: Privileged service reload and health verification
|
||||||
|
- **Scope**: `live-infra`
|
||||||
|
- **Pass Condition**: Target service reloads cleanly and health endpoint returns `200 OK`.
|
||||||
|
- **Failure Signal**: Non-zero exit status, permission refusal, or failed unit healthcheck.
|
||||||
|
```sh
|
||||||
|
systemctl reload app-daemon.service && systemctl is-active --quiet app-daemon.service
|
||||||
|
```
|
||||||
|
|
||||||
## Overall Recommendation
|
## Overall Recommendation
|
||||||
- **Status**: `Ready` | `Needs Rework` | `Blocked`
|
- **Status**: `Ready` | `Needs Rework` | `Blocked`
|
||||||
- **Next Action**: State whether to hand off to `verify-slice` for runtime verification, `diagnose` for root-cause fixes, or present to human owner for adjudication.
|
- **Next Action**: State whether to hand off to `verify-slice` for runtime verification, `diagnose` for root-cause fixes, or present to human owner for adjudication. Static provenance and runtime verification remain distinct inputs; neither authorizes release on its own.
|
||||||
```
|
```
|
||||||
Reference in new issue
Block a user