Harness Intelligence Wiki
SpecsCLIReview Phase Token Rebuild

Review Phase Token Rebuild Plan

Plan: Review Phase Token Rebuild

Context Pointers

AuthorityLocatorIdentityFreshness rule
SPECSPEC.mdcommit f717104865da6a6fc2c6af8cbbb8bd0ed71d268cRe-read when the blob at this commit differs from the branch copy; any change returns to create-spec
ARCHITECTUREARCHITECTURE.mdcommit 12a6d5eef978d0b0b885755a2513d35b50b9d04d, sha256 3568746824f876255e31d47987bb186ad0e2816ee573b695ef9478b0d2253f2aSame; Spec Traceability state must stay complete
Grill status / logapps/wiki/content/docs/project/grilling/review-phase-token-rebuild-grill-{status,log}.mdcommit d4dfce1a4; status sha256 52587f46…, log sha256 eefd78cb…Closure: closed R4; a reopen invalidates the pair
Glossaryapps/wiki/content/docs/project/domains/review-phase-token-rebuild-glossary.mdxsha256 e83bf02f…Use exact terms: Axis Run, Adjudicator, Engine Fallback, Pass Report
Upstream helperopenclaw/agent-skills skills/autoreview/scripts/autoreviewtag v0.6.0 (tag object aa2f8f7afd8ff26a26ac0b20b8d5a62b7dd16fae, commit 6b38162c6f27792871f9a3c5df4e041eb7c5f15f)Fixed pin; a newer tag needs a plan amendment
Skills sourcewearedevpunks/skills mainbase 979a504f0fd7cd49f01b16689e224db608c89f5cVerify git -C /home/stefan/repos/skills branch --show-current is main before every skills edit
BacklogLinear Epic IP-443, Stories IP-524, IP-525, milestone V4.8 Review Phase Token Rebuildreadback 2026-10-23Blocker edges below mirror native relations
  • architecture_applicability: architecture-bearing. Evidence: eight Tasks change one capability (review-phase) cumulatively; the public seam changes (review.mjs CLI, Pass Report, delivery handoff fields); two skills leave the Baseline (SPEC OUT-009, OUT-010, OUT-011; ARC-002, ARC-009, ARC-010, ARC-013).

Initial Situation

One Full Code Review Pass costs 25–30M tokens. A gate subagent reads about 31k tokens of graph docs and does mechanical work over about 90 turns; two axis subagents wait on a frozen May 2026 autoreview fork; a Codex quota stall blocked one pass for 200 minutes; reports live in the wiki (SPEC Context).

Problem Statement

Move every one-answer step into scripts, call upstream autoreview unchanged through a wrapper with Engine Fallback, keep one Adjudicator, and store a temporary Pass Report, while delivery, the HI catalog, docs and consumers move with the new contract (SPEC OUT-001–OUT-013).

Proposed Solution Shape

Follow ARCHITECTURE FLOW-001: status → prepare → run (background) → Adjudicator → retain → route. Module tree and interfaces: ARCHITECTURE ## Modules and Interfaces.

Resolved Decision Ledger

IDDecisionSource
P1Work follows the eight provider Tasks and their native blockers; Tn are aliaseswrite-backlog readback 2026-10-23
P2T2 owns deletion of tests/review-phase-graph.contract.test.mjs, tests/v43-frozen-review.contract.test.mjs and tests/fixtures/v43/IP-453/{retained-pass,prove-native}.mjs, because they import exports T2 removes; T3 adds tests/review-phase-cli.test.mjsCodebase finding F3; keeps npm test green per Task
P3Harness work continues on branch spec/review-phase-token-rebuild (based on main), one PR to main; skills work commits on skills mainSPEC Branch/Base Intent; root AGENTS.md
P4The scaffolded wiki contract has no reviews/ section today (only review-phase creates it); AC-030's scaffold part is proved by inspection in T6, with no code changeCodebase finding F5
P5T8 measures three passes of the rebuilt skill over already delivered real changes (merge commits of harness PRs #272, #274, #277), each in a scratch delivery folder; this delivery's own closing pass is not part of T8SPEC AC-002; plan-reviewer finding (loop)
P6$grilling found no open plan-shaping decision; the frontier was empty after P1–P5Planning run 2026-10-23
P7Skills tasks in one wave share the single main checkout. Each worker commits only its owned_paths with a pathspec commit; the wave gate runs npm test once after every task of the wave has committed, and a red test is attributed by owned pathRoot AGENTS.md (skills on main only); plan-reviewer finding
P8T3 tests use fixture prompt files under tests/fixtures/review-phase-cli/; review.mjs resolves references/axis-*.md at runtime, so T3 does not wait for T4plan-reviewer finding; keeps native blockers unchanged
P9IMPLEMENTATION-NOTES.md is owned by the implement-spec parent; each task's Task Result carries its $writing-for-agents evidence and the parent records it (AC-032). T8 writes only ## Acceptance Measurementimplement-spec lifecycle
P10.agents/skills/**, host agent files (.claude/agents, .codex, .cursor, .opencode) and other hi update outputs refresh in the next Baseline adoption after publication, outside this PR; root AGENTS.md (authored) changes in T6hi update ownership; memory skills-sync-release-flow

Assumptions and Constraints

  • Skills edits only in /home/stefan/repos/skills on main; harness copies change only through bun run sync:skills (HI-REPO-004).
  • The vendored helper stays byte-identical to upstream; no byte test (SPEC AC-024).
  • Every prompt and skill text change applies $writing-for-agents (SPEC OUT-013).
  • Live Codex was unavailable on 2026-10-23 (model_not_found for gpt-6-sol, gpt-6.1-sol); tests use fake engines, and T8 may run on Claude only.

Codebase Findings

  • F1: review-contract.mjs (1008 lines) is a library with no CLI; its exports are imported only by tests and fixtures (skills tests/review-phase-graph.contract.test.mjs:5-29, tests/v43-frozen-review.contract.test.mjs:10, tests/fixtures/v43/IP-453/*.mjs).
  • F2: Upstream engine seam --codex-bin/CODEX_BIN and --claude-bin/CLAUDE_BIN (upstream S:7301, S:7312); status sidecar fields S:8336-8347; exits S:8567.
  • F3: Text-pin tests that name review files: workflow-boundaries.contract.test.mjs:69-109 (autoreview SKILL.md and delivery text), matt-pocock-provenance.contract.test.mjs:19, show-me test :93, agent-workflow-contract:41, v43-delivery-continuity:28, v43-draft-review-transition:13.
  • F4: Harness consumers: apps/cli/src/data/catalog/skills.ts:841-857, packs.ts:266-268, apps/cli/src/data/registry/subagents/manifest.mjs:30,148, .agents/subagents/manifest.mjs:24,256, apps/cli/src/registry/publisher/sources/skills.test.ts:106, builders/prompts.ts:36, apps/cli/src/data/registry/prompts/root.md.tmpl:37,69 (line 69 still says the Standards axis covers simplification).
  • F5: No scaffold source writes a wiki reviews/ section (grep over apps/cli/src, packages/scaffold/src); only review-phase/references/durable-report.md creates it.
  • F6: hi update STEP-011 removes unedited stale copies and reports edited ones (apps/cli/src/registry/pipeline.ts:1135-1166); existing tests use a hook file (pipeline.test.ts:629,650), none a whole skill directory.
  • F7: Sync pin apps/cli/scripts/sync-skills-repo.mjs:22 defaultRepositoryCommit = "979a504f…".

Wiki Context

  • Knowledge used
    • harness/entrypoints/review.mdx — selected by search review-phase; claims: two axes each run autoreview once, retained wiki report, explicit-only invocation; freshness fresh (matches skills 979a504f review-phase/SKILL.md); status verified implementation. T7 rewrites it.
    • Delivery Phase Flow Optimization Glossary — "Applies when" review terms; claims: Review Packet, Review Lens Result, Full Code Review Pass definitions; fresh; verified.
    • hi-cli-scaffolding runbook :135 STEP-011 and :658-712 review section — search stale, review; fresh against pipeline.ts:1135-1166; verified.
  • Stale or contradictory claims: none found; the review pages describe current behaviour that this plan replaces.
  • Returned findings: knowledge no-op; the new behaviour is documented by T7 after delivery.

External Research Used

  • openclaw/agent-skills v0.6.0 source read 2026-10-23 (Technical Grounding in grill status).
  • openai/codex codex-rs/core/src/exec_env.rs:30-42 for CODEX_THREAD_ID.

Architecture Contract

Target Ownership Topology

review-phase (skill)                 ARC-001  procedure text only; owns no state
  scripts/review.mjs                 ARC-002  side effects: git, fs, processes; owns run dir + Pass Report writes
  scripts/review-contract.mjs        ARC-003  pure policy: identity, budget, engine order, source context, routing, schema
  scripts/vendor/autoreview          ARC-004  upstream review method + engine CLIs; unchanged
  references/adjudicator.md          ARC-007  Adjudicator brief + adjudication.json schema
  references/axis-*.md, routing.md   ARC-006, ARC-010
delivery-phase (skill)               ARC-010  consumes pass_report + review_run_id; owns repair routing
HI CLI catalog/publisher             ARC-013  distributes skills; owns no review policy

Must not absorb: review.mjs holds no policy that review-contract.mjs owns; delivery-phase stores no review_count; the vendored helper receives no local edit.

Declared Dependency Graph

review-phase/SKILL.md ──invokes CLI──▶ review.mjs
review.mjs ──import──▶ review-contract.mjs
review.mjs ──process (argv, CODEX_BIN/CLAUDE_BIN)──▶ vendor/autoreview ──process──▶ claude | codex
delivery-phase ──reads JSON line + Pass Report path──▶ review.mjs status/retain
HI catalog ──copies files──▶ skills/review-phase/**

Forbidden: any import of vendor/autoreview internals; review-contract.mjs importing node:fs/node:child_process; delivery-phase reading wiki review reports; any skill other than review-phase invoking the helper.

Responsibility Acceptance Criteria

criterion_idOwnerObservable assertionEvidencedue_architecture_wave
RAC-1vendor/autoreviewHelper bytes equal upstream v0.6.0; UPSTREAM.md sha equals --versioncmp against the tagged file; python3 vendor/autoreview --versionA1
RAC-2review-contract.mjsExports exactly the SPEC AC-006 set; no fs/process importnode --test tests/review-contract.test.mjs; grep importsA1
RAC-3review.mjsFour subcommands, one JSON line each, Engine Fallback, exclusive Pass Reportnode --test tests/review-phase-cli.test.mjsA2
RAC-4review-phase skillLayout per AC-025; autoreview/review skills absent; no watch stepfind skills/phases/review-phase; npm testA2
RAC-5delivery-phaseHandoff field list carries pass_report + review_run_id, no stored count or retained-report fieldsT5 contract test in workflow-boundaries.contract.test.mjsA3
RAC-6HI catalogNo autoreview/review entries; vendored helper copied executablebun run --cwd apps/cli test (catalog, publisher)A4
RAC-7pass costMedian ≤ 4M tokens, ≤ 10 root turns over ≥ 3 passesMeasurement record in IMPLEMENTATION-NOTESA4
RAC-8harness docsReview pages, runbook and changelog describe Axis Runs, Engine Fallback, Adjudicator, Pass Report; check:health adds no findingbun run --cwd apps/wiki check:health; grep -rn autoreview over T7 pages finds only the vendored-helper mentionA4
RAC-9writing disciplineEvery prompt and skill text edit has $writing-for-agents evidenceIMPLEMENTATION-NOTES skill evidence for T4, T5, T6, T7A4

Architecture Waves

A1 boundary: pinned upstream adapter + pure library      (T1, T2)   checkpoint: RAC-1, RAC-2
  A2 slice: CLI + skill text on the new seam              (T3, T4)   checkpoint: RAC-1..RAC-4
    A3 caller migration: delivery-phase + sibling skills  (T5)       checkpoint: RAC-1..RAC-5
      A4 distribution + final closure                     (T6, T7, T8) checkpoint: RAC-1..RAC-9, ledger empty

Public Seam Contract

SeamOwnerAllowed consumers
`review.mjs preparerunretain
pass-report-v1 file at .devpunks/delivery/<goal>/reviews/pass-<n>.jsonreview-phasedelivery-phase, debt capture
adjudication.json in run dirAdjudicator (written) / review.mjs (validated)review.mjs retain
Delivery handoff pass_report, review_run_iddelivery-phasedelivery-phase phases

Migration Ledger

Temporary seamIntroduced byReasonAllowed consumersRemoved byExpiry waveRemoval proof
Old delivery-phase handoff fields (report path/SHA, verified_retained_ref, stored review_count) remain while A2 landsexistingdelivery text changes in T5delivery-phaseT5A3RAC-5 grep
Catalog still lists autoreview/review after skills main drops themT4harness syncs in T6HI catalogT6A4RAC-6 tests

Dependency Graph

Parallel Execution Waves

WaveTasksWhy parallel is safe
W1T1, T2Disjoint paths (scripts/vendor/** vs scripts/review-contract.mjs + its tests)
W2T3, T4T3 owns scripts/review.mjs + CLI test; T4 owns skill text, references, removed skills and text-pin tests. T4 starts when T1 passes; T3 waits for T1 and T2
W3T5Needs T3 interface and T4 text
W4T6Needs skills main with T4 and T5
W5T7, T8Disjoint (wiki pages + changelog vs measurement section of IMPLEMENTATION-NOTES)

Testing Strategy

  • Skills repo: npm test (node --test tests/*.test.mjs) green after every Task; new tests/review-contract.test.mjs (T2) and tests/review-phase-cli.test.mjs (T3) with fake engine scripts on CODEX_BIN/CLAUDE_BIN that emit upstream-shaped JSON and status sidecars.
  • Harness: bun run --cwd apps/cli test for catalog, publisher, prompt and pipeline tests (T6); bun run --cwd apps/wiki check:health shows no finding beyond the 10 recorded on 2026-10-23 (T7).
  • Runtime: T8 runs real passes with live engines.

Risks and Mitigations

RiskMitigation
Upstream --dry-run output format differs from expectationT3 RED test runs the real vendored helper with --dry-run against a fixture repo before parsing
Codex unavailable during T8Engine Fallback runs Claude; AC-002 measures what runs; record the engine per attempt
Source context exceeds 512 KB for large deliveriesprepare blocker before any model (AC-005); T3 test covers it
Text-pin tests break across W2/W3P2 ownership; each Task keeps npm test green before its gate
Consumers with edited autoreview copiesChangelog note (T7); STEP-011 reports them (F6)

Validation Gates

  • Per Task: its validation and RED/GREEN. Skills waves: one npm test wave gate after every task of the wave commits (P7). Harness: the named tests.
  • A1 checkpoint after T1, T2: RAC-1, RAC-2.
  • A2 checkpoint after T3, T4: RAC-1–RAC-4; skills npm test green.
  • A3 checkpoint after T5: RAC-1–RAC-5; skills commit pushed to main.
  • A4 final closure after T6–T8: RAC-1–RAC-9; migration ledger empty; release classification selects baseline.

Tasks

T1: Vendor upstream autoreview v0.6.0 into review-phase

  • depends_on: []
  • location: /home/stefan/repos/skills/skills/phases/review-phase/scripts/vendor/
  • owned_paths: [skills/phases/review-phase/scripts/vendor/autoreview, skills/phases/review-phase/scripts/vendor/UPSTREAM.md]
  • read_dependencies: [SPEC AC-024, ARCHITECTURE ARC-004, upstream tag v0.6.0]
  • shared_runtime_resources: none; download into a new empty scratch dir, removed after copy
  • relevant_input_set: upstream commit aa2f8f7a; sha256 of the copied file before/after commit
  • wave_boundary: W1
  • description: Copy the upstream helper unchanged and executable; write UPSTREAM.md with repo, tag, commit and --version output.
  • validation: cmp with the tagged upstream file; python3 skills/phases/review-phase/scripts/vendor/autoreview --version equals UPSTREAM.md; npm test green.
  • status: Done
  • log:
  • files edited/created:
  • task_identity_mode: provider-task
  • backlog_item_id: IP-526
  • backlog_item_url: https://linear.app/devpunks/issue/IP-526/vendor-upstream-autoreview-v060-into-review-phase
  • relation_mode: native
  • backlog_sync_skip_reason:
  • assigned_skills: [tdd (planning-only: classified the task not_applicable), codebase-design]
  • implementation_skill_guidance:
    • skill: codebase-design applicable_behavior: Treat the helper as an unchanged adapter behind the CODEX_BIN/CLAUDE_BIN process seam; add no local edits.
  • tdd_status: not_applicable
  • tdd_target: Vendored file identity (byte compare and --version).
  • red_command:
  • expected_red_failure:
  • green_command:
  • reason_not_testable: Byte copy of a third-party file; the user rejected a byte-identity test (Q25); behaviour is proved through T3.
  • red_evidence:
  • green_evidence:
  • codebase_design_notes: Adapter at the process seam; consumers use only its CLI.
  • review_mode: cli
  • runtime_validation: not_required
  • runtime_target: not_applicable
  • runtime_evidence: not_applicable
  • runtime_cleanup: not_applicable
  • architecture_wave: A1
  • behavior_owner: vendor/autoreview
  • integration_surface: review.mjs process calls
  • public_seam: upstream CLI (unchanged)
  • topology_delta: new adapter inside review-phase/scripts
  • forbidden_ownership: any local policy or patch
  • temporary_seams: none
  • responsibility_acceptance_criteria: [RAC-1]

T2: Rework review-contract.mjs as the pure pass library

  • depends_on: []
  • location: /home/stefan/repos/skills/skills/phases/review-phase/scripts/review-contract.mjs
  • owned_paths: [skills/phases/review-phase/scripts/review-contract.mjs, tests/review-contract.test.mjs, tests/review-phase-graph.contract.test.mjs (delete), tests/v43-frozen-review.contract.test.mjs (delete), tests/fixtures/v43/IP-453/retained-pass.mjs (delete), tests/fixtures/v43/IP-453/prove-native.mjs (delete)]
  • read_dependencies: [SPEC AC-006, AC-008, AC-010, AC-017, AC-018; ARCHITECTURE ARC-003, Modules and Interfaces; grill Q26, Q27, Q34, Q36]
  • shared_runtime_resources: none
  • relevant_input_set: Context Pointers SPEC/ARCHITECTURE; sha256 of review-contract.mjs before/after
  • wave_boundary: W1
  • description: Keep reviewPacketIdentity, planDeliveryReviewGate, deriveReviewRouting; add recoverPassCount, validatePassReport, planEngineOrder, selectSourceContext; remove wiki report path, Markdown encode/parse, retained-ref checks, validateRetainedPass, resolveRetainedRun, standalone bundle normalizer; delete the tests and fixtures that import removed exports (P2).
  • validation: node --test tests/review-contract.test.mjs; npm test green; no node:fs/node:child_process import in the library.
  • status: Done
  • log:
  • files edited/created:
  • task_identity_mode: provider-task
  • backlog_item_id: IP-527
  • backlog_item_url: https://linear.app/devpunks/issue/IP-527/rework-review-contractmjs-as-the-pure-pass-library
  • relation_mode: native
  • backlog_sync_skip_reason:
  • assigned_skills: [tdd, codebase-design]
  • implementation_skill_guidance:
    • skill: tdd applicable_behavior: Write each new export's public-result test first and capture RED before implementing.
    • skill: codebase-design applicable_behavior: Keep the library pure (inputs in, values out); the CLI injects environment, file lists and clock.
  • tdd_status: required
  • tdd_target: planEngineOrder({CLAUDECODE:"1"}) returns ["claude","codex"]; {CODEX_THREAD_ID:"x"} returns ["codex","claude"]; HI_REVIEW_ENGINES overrides; recoverPassCount counts only valid pass-*.json.
  • red_command: cd /home/stefan/repos/skills && node --test tests/review-contract.test.mjs
  • expected_red_failure: SyntaxError/does not provide an export named 'planEngineOrder'
  • green_command: cd /home/stefan/repos/skills && node --test tests/review-contract.test.mjs && npm test
  • reason_not_testable:
  • red_evidence:
  • green_evidence:
  • codebase_design_notes: Deep pure module; interface = seven exports; test surface = those exports only.
  • review_mode: cli
  • runtime_validation: not_required
  • runtime_target: not_applicable
  • runtime_evidence: not_applicable
  • runtime_cleanup: not_applicable
  • architecture_wave: A1
  • behavior_owner: review-contract.mjs
  • integration_surface: review.mjs import
  • public_seam: library exports (SPEC AC-006)
  • topology_delta: removes wiki-report and retained-ref policy; adds engine order, source context, Pass Report policy
  • forbidden_ownership: fs, process, git calls
  • temporary_seams: none
  • responsibility_acceptance_criteria: [RAC-2]

T3: Build the review.mjs CLI with Engine Fallback and fake-engine tests

  • depends_on: [T1, T2]
  • location: /home/stefan/repos/skills/skills/phases/review-phase/scripts/review.mjs
  • owned_paths: [skills/phases/review-phase/scripts/review.mjs, tests/review-phase-cli.test.mjs, tests/fixtures/review-phase-cli/**]
  • read_dependencies: [T1 vendored helper, T2 library; fixture prompt files (P8); SPEC AC-001, AC-003, AC-004, AC-005, AC-007, AC-011, AC-012, AC-014, AC-016, AC-019–AC-023, AC-031; ARCHITECTURE FLOW-001–FLOW-004]
  • shared_runtime_resources: per-test temp Git repos and $TMPDIR/hi-review/<run-id>/ dirs, created and removed by each test
  • relevant_input_set: library and helper sha256 before/after; fixture repo HEADs
  • wave_boundary: W2
  • description: Implement prepare, run, retain, status (one JSON line each), --standalone, review-target exclusion of .devpunks/delivery/**/reviews/, Engine Fallback, resume reuse, exclusive Pass Report create and pathspec commit, run-dir cleanup.
  • validation: node --test tests/review-phase-cli.test.mjs covers fallback, timeout to next engine, all-engines-fail blocker, resume reuse, exclusive ordinal, oversize blocker, standalone refusal of non-Git target, routing, retain refusal of an invalid adjudication.json (AC-014), per-attempt usage and subagent_tokens in the Pass Report (AC-001), no failure on large usage (AC-003), and status ignoring legacy wiki reports (AC-020); npm test green at the W2 wave gate (P7).
  • status: Done
  • log:
  • files edited/created:
  • task_identity_mode: provider-task
  • backlog_item_id: IP-528
  • backlog_item_url: https://linear.app/devpunks/issue/IP-528/build-the-reviewmjs-cli-with-engine-fallback-and-fake-engine-tests
  • relation_mode: native
  • backlog_sync_skip_reason:
  • assigned_skills: [tdd, codebase-design, backend-recoverable-actions]
  • implementation_skill_guidance:
    • skill: tdd applicable_behavior: Drive each subcommand from a CLI-level test with fake engines; RED before code.
    • skill: codebase-design applicable_behavior: Keep side effects in review.mjs; call the library for every decision; engine seam is CODEX_BIN/CLAUDE_BIN only.
    • skill: backend-recoverable-actions applicable_behavior: Make retain safe to retry: exclusive create first, then pathspec commit; a retry after a successful create reports the existing report instead of a second ordinal.
  • tdd_status: required
  • tdd_target: With a fake Claude engine that exits nonzero and a fake Codex engine that returns a clean report, run prints {"standards":{"outcome":"clean","engine":"codex","attempts":2},…}.
  • red_command: cd /home/stefan/repos/skills && node --test tests/review-phase-cli.test.mjs
  • expected_red_failure: review.mjs not found / non-zero exit with no JSON line
  • green_command: cd /home/stefan/repos/skills && node --test tests/review-phase-cli.test.mjs && npm test
  • reason_not_testable:
  • red_evidence:
  • green_evidence:
  • codebase_design_notes: Thin imperative shell over the pure library; two adapters at the engine seam (real CLIs, fake scripts).
  • review_mode: cli
  • runtime_validation: not_required
  • runtime_target: not_applicable
  • runtime_evidence: not_applicable
  • runtime_cleanup: not_applicable
  • architecture_wave: A2
  • behavior_owner: review.mjs
  • integration_surface: review-phase procedure; delivery-phase
  • public_seam: review.mjs JSON lines; pass-report-v1; adjudication.json validation
  • topology_delta: new CLI owns run state and Pass Report writes
  • forbidden_ownership: policy owned by the library; any watch/poll loop exposed to agents
  • temporary_seams: none
  • responsibility_acceptance_criteria: [RAC-3]

T4: Rewrite review-phase skill text and remove autoreview and review skills

  • depends_on: [T1]
  • location: /home/stefan/repos/skills/skills/phases/review-phase/
  • owned_paths: [skills/phases/review-phase/SKILL.md, skills/phases/review-phase/references/, skills/phases/review-phase/phases/ (delete), skills/phases/review-phase/AUTHORING-HANDOFF.md (delete), skills/phases/review-phase/agents/openai.yaml, skills/phases/review-phase/UPSTREAM.md, skills/phases/review-phase/LICENSE, skills/agnostic/quality/autoreview/** (delete), skills/agnostic/quality/review/** (delete), tests/matt-pocock-provenance.contract.test.mjs, tests/show-me.contract.test.mjs, tests/workflow-boundaries.contract.test.mjs (tests that read review-phase/** or autoreview/**, including "review routes scope decisions before repair" :69-87 and the autoreview SKILL.md assertions), docs/upstream/mattpocock-writing-skills.md]
  • read_dependencies: [SPEC AC-009, AC-013–AC-015, AC-025, AC-026, AC-032; ARCHITECTURE ARC-001, ARC-006, ARC-007; skills review/SKILL.md (guidance source); $writing-for-agents]
  • shared_runtime_resources: none
  • relevant_input_set: Context Pointers; T3's CLI interface as fixed in ARCHITECTURE Modules and Interfaces
  • wave_boundary: W2
  • description: Write SKILL.md (status → prepare → run in background → Adjudicator → retain → route; no watch step), references/adjudicator.md, axis-standards.md (repo standards hard rules, smells P3 info, no simplify), axis-spec.md, routing.md; move mattpocock UPSTREAM.md/LICENSE; delete graph docs and the two skills; update text-pin tests.
  • validation: layout check per AC-025/AC-026; grep finds no watch/poll/sleep step and no simplify in axis-standards.md; npm test green at the W2 wave gate (P7); Task Result carries $writing-for-agents evidence (P9).
  • status: Done
  • log:
  • files edited/created:
  • task_identity_mode: provider-task
  • backlog_item_id: IP-529
  • backlog_item_url: https://linear.app/devpunks/issue/IP-529/rewrite-review-phase-skill-text-and-remove-autoreview-and-review-skills
  • relation_mode: native
  • backlog_sync_skip_reason:
  • assigned_skills: [writing-for-agents]
  • implementation_skill_guidance:
    • skill: writing-for-agents applicable_behavior: Steps end on checkable completion criteria; state positive targets; disclose references behind pointers; use the glossary terms as leading words.
  • tdd_status: not_applicable
  • tdd_target: Skill files and layout; text-pin tests updated to the new files.
  • red_command:
  • expected_red_failure:
  • green_command: cd /home/stefan/repos/skills && npm test
  • reason_not_testable: Prompt text and file removals; behaviour is proved by T3 tests and T8 runs.
  • red_evidence:
  • green_evidence:
  • codebase_design_notes: not_applicable
  • review_mode: cli
  • runtime_validation: not_required
  • runtime_target: not_applicable
  • runtime_evidence: not_applicable
  • runtime_cleanup: not_applicable
  • architecture_wave: A2
  • behavior_owner: review-phase skill
  • integration_surface: agents loading review-phase
  • public_seam: skill procedure text
  • topology_delta: graph gates and two skills removed
  • forbidden_ownership: mechanics owned by review.mjs
  • temporary_seams: none
  • responsibility_acceptance_criteria: [RAC-4, RAC-9]

T5: Move delivery-phase and sibling skills onto the Pass Report contract

  • depends_on: [T3, T4]
  • location: /home/stefan/repos/skills/skills/phases/delivery-phase/
  • owned_paths: [skills/phases/delivery-phase/references/phase-handoff.md, skills/phases/delivery-phase/references/artifact-state.md, skills/phases/delivery-phase/phases/{review,router,closeout,implement,debug}.md, skills/phases/delivery-phase/SKILL.md, skills/agnostic/cli/ask-hi/references/{quality,phase-graph,known-gaps}.md, skills/phases/debugging-phase/SKILL.md, skills/phases/finder-phase/references/root-routing.md, tests/workflow-boundaries.contract.test.mjs (tests that read delivery-phase/**, including implement.md :106), tests/wayfinder-lifecycle.contract.test.mjs (:330,349 if artifact-state.md wording moves), skills/agnostic/cli/ask-hi/references/{baseline,delivery}.md, tests/agent-workflow-contract.test.mjs, tests/v43-delivery-continuity.contract.test.mjs, tests/v43-draft-review-transition.contract.test.mjs]
  • read_dependencies: [SPEC AC-027, AC-030; ARCHITECTURE ARC-010, ARC-011; T3 JSON shapes; $writing-for-agents]
  • shared_runtime_resources: none
  • relevant_input_set: T3 and T4 commits on skills main
  • wave_boundary: W3
  • description: Replace retained-report fields with pass_report and review_run_id; derive the count from review.mjs status; rewrite ask-hi review references and the $review-phase invocations in debugging-phase and finder-phase; update pinned tests; push skills main.
  • validation: the T5 contract test passes; npm test green; Task Result carries $writing-for-agents evidence (P9); skills main pushed.
  • status: Done
  • log:
  • files edited/created:
  • task_identity_mode: provider-task
  • backlog_item_id: IP-530
  • backlog_item_url: https://linear.app/devpunks/issue/IP-530/move-delivery-phase-and-sibling-skills-onto-the-pass-report-contract
  • relation_mode: native
  • backlog_sync_skip_reason:
  • assigned_skills: [writing-for-agents]
  • implementation_skill_guidance:
    • skill: writing-for-agents applicable_behavior: Keep one source of truth (the CLI derives the count); replace field lists instead of adding parallel ones.
  • tdd_status: required
  • tdd_target: A contract test in workflow-boundaries.contract.test.mjs asserts the delivery handoff field list in phase-handoff.md contains pass_report and review_run_id and no verified_retained_ref, report SHA or stored review_count field.
  • red_command: cd /home/stefan/repos/skills && node --test tests/workflow-boundaries.contract.test.mjs
  • expected_red_failure: assertion fails: verified_retained_ref still listed in phase-handoff.md
  • green_command: cd /home/stefan/repos/skills && npm test
  • reason_not_testable:
  • red_evidence:
  • green_evidence:
  • codebase_design_notes: not_applicable
  • review_mode: cli
  • runtime_validation: not_required
  • runtime_target: not_applicable
  • runtime_evidence: not_applicable
  • runtime_cleanup: not_applicable
  • architecture_wave: A3
  • behavior_owner: delivery-phase
  • integration_surface: review-phase CLI outputs
  • public_seam: delivery handoff fields
  • topology_delta: delivery stops storing the count and reading wiki reports
  • forbidden_ownership: review mechanics
  • temporary_seams: removes ledger entry 1
  • responsibility_acceptance_criteria: [RAC-5, RAC-9]

T6: Ship the rebuilt review through the HI catalog and sync

  • depends_on: [T4, T5]
  • location: /home/stefan/repos/harness-intelligence/apps/cli/
  • owned_paths: [apps/cli/scripts/sync-skills-repo.mjs, apps/cli/skills/, .agents/skills/, apps/cli/src/data/catalog/skills.ts, apps/cli/src/data/catalog/packs.ts, apps/cli/src/data/registry/subagents/manifest.mjs, .agents/subagents/manifest.mjs, apps/cli/src/registry/publisher/sources/skills.test.ts, apps/cli/src/registry/builders/prompts.ts, apps/cli/src/registry/builders/prompts.test.ts, apps/cli/src/registry/publisher/sources/prompts.test.ts, apps/cli/src/data/registry/prompts/root.md.tmpl, apps/cli/src/registry/pipeline.test.ts, AGENTS.md (root, line 7 review wording; CLAUDE.md is its symlink mirror)]
  • read_dependencies: [skills main after T5; SPEC AC-028, AC-029, AC-030; rules HI-REPO-002, HI-REPO-004, HI-CLI-003, HI-CLI-004]
  • shared_runtime_resources: network fetch of wearedevpunks/skills by sync:skills
  • relevant_input_set: skills commit SHA pinned in sync-skills-repo.mjs:22; sync receipt SHA
  • wave_boundary: W4
  • description: Pin the new skills commit and run bun run sync:skills; remove autoreview/review from catalog, packs and manifests (spec-reviewer keeps review-phase); pin skills/review-phase/scripts/vendor/autoreview executable; update prompt wording (line 69 drops simplify); add a pipeline test that a dropped skill directory is removed when unedited and reported when edited; confirm by inspection that no scaffold source writes a wiki reviews/ section (P4).
  • validation: bun run --cwd apps/cli test (catalog, publisher, prompts, pipeline); sync receipt SHA equals the pinned commit; root AGENTS.md names no autoreview; Task Result carries $writing-for-agents evidence (P9).
  • status: Done
  • log:
  • files edited/created:
  • task_identity_mode: provider-task
  • backlog_item_id: IP-531
  • backlog_item_url: https://linear.app/devpunks/issue/IP-531/ship-the-rebuilt-review-through-the-hi-catalog-and-sync
  • relation_mode: native
  • backlog_sync_skip_reason:
  • assigned_skills: [tdd, writing-for-agents]
  • implementation_skill_guidance:
    • skill: tdd applicable_behavior: Change the publisher test to expect the vendored helper path first and capture RED before syncing.
    • skill: writing-for-agents applicable_behavior: Edit root.md.tmpl review lines with positive, minimal wording.
  • tdd_status: required
  • tdd_target: (1) Publisher test asserts skill-review-phase copies skills/review-phase/scripts/vendor/autoreview as executable and no skill-autoreview item exists. (2) pipeline.test.ts asserts a skill directory dropped from the Baseline is removed when unedited and stale-reported when edited (AC-029).
  • red_command: cd /home/stefan/repos/harness-intelligence && bun run --cwd apps/cli test src/registry/publisher/sources/skills.test.ts src/registry/pipeline.test.ts
  • expected_red_failure: missing file entry for skills/review-phase/scripts/vendor/autoreview; the new pipeline case fails only if whole-directory removal differs from file removal (record either result)
  • green_command: cd /home/stefan/repos/harness-intelligence && bun run --cwd apps/cli test
  • reason_not_testable:
  • red_evidence:
  • green_evidence:
  • codebase_design_notes: Catalog is data; publisher is the tested seam.
  • review_mode: cli
  • runtime_validation: not_required
  • runtime_target: not_applicable
  • runtime_evidence: not_applicable
  • runtime_cleanup: not_applicable
  • architecture_wave: A4
  • behavior_owner: HI catalog and publisher
  • integration_surface: hi init / hi update
  • public_seam: Registry Baseline items
  • topology_delta: two skill items removed; review-phase gains scripts
  • forbidden_ownership: review policy
  • temporary_seams: removes ledger entry 2
  • responsibility_acceptance_criteria: [RAC-6, RAC-9]

T7: Document the rebuilt review in the wiki, runbook and Baseline changelog

  • depends_on: [T6]
  • location: /home/stefan/repos/harness-intelligence/apps/wiki/content/docs/
  • owned_paths: [apps/wiki/content/docs/harness/entrypoints/review.mdx, apps/wiki/content/docs/harness/skills-and-packs/atomic-skills.mdx, apps/wiki/content/docs/harness/skills-and-packs/phase-wrappers.mdx, apps/wiki/content/docs/harness/validation-and-tools/validation-gates.mdx, apps/wiki/content/docs/get-started/basic-usage.mdx, apps/wiki/content/docs/cli/scaffold-model/scaffold-pack.mdx, apps/wiki/content/docs/harness/entrypoints/debugging.mdx, apps/wiki/content/docs/harness/entrypoints/massive-bug-hunt-and-fix.mdx, apps/wiki/content/docs/project/runbooks/hi-cli-scaffolding.md, apps/wiki/content/docs/harness/skills-and-packs/{skill-graph,skill-reference,skill-packs,skill-model}.mdx, apps/wiki/content/docs/harness/entrypoints/implementation/{index,afk}.mdx, apps/wiki/content/docs/harness/entrypoints/{design,finder-phase,manual-hitl-flow}.mdx, apps/wiki/content/docs/project/reference/{harness-intelligence,hi-requirements}.md, apps/wiki/content/docs/project/public-docs/**/fragments.md, apps/wiki/content/docs/project/reviews/index.mdx, apps/wiki/log.md, BASELINE_CHANGELOG.md]
  • read_dependencies: [SPEC AC-029, AC-030; ARCHITECTURE FLOW-001; rules HI-WIKI-001, HI-WIKI-003, HI-DOCS-001]
  • shared_runtime_resources: none
  • relevant_input_set: T6 commit; wiki health baseline of 10 findings
  • wave_boundary: W5
  • description: Rewrite review pages and runbook for Axis Runs, Engine Fallback, Adjudicator, Pass Report; mark project/reviews/ frozen history; add Unreleased baseline notes with compatibility (hi update --yes for edited copies; in-flight deliveries restart the count); run release classification.
  • validation: bun run --cwd apps/wiki check:health adds no finding; release classification selects baseline with non-empty Unreleased notes.
  • status: Done
  • log:
  • files edited/created:
  • task_identity_mode: provider-task
  • backlog_item_id: IP-532
  • backlog_item_url: https://linear.app/devpunks/issue/IP-532/document-the-rebuilt-review-in-the-wiki-runbook-and-baseline-changelog
  • relation_mode: native
  • backlog_sync_skip_reason:
  • assigned_skills: [writing-for-agents]
  • implementation_skill_guidance:
    • skill: writing-for-agents applicable_behavior: Use the glossary terms; replace stale sections rather than appending.
  • tdd_status: not_applicable
  • tdd_target: Docs and changelog content.
  • red_command:
  • expected_red_failure:
  • green_command: cd /home/stefan/repos/harness-intelligence && bun run --cwd apps/wiki check:health
  • reason_not_testable: Documentation only.
  • red_evidence:
  • green_evidence:
  • codebase_design_notes: not_applicable
  • review_mode: cli
  • runtime_validation: not_required
  • runtime_target: not_applicable
  • runtime_evidence: not_applicable
  • runtime_cleanup: not_applicable
  • architecture_wave: A4
  • behavior_owner: harness wiki
  • integration_surface: operators and agents reading docs
  • public_seam: unchanged
  • topology_delta: docs follow the new pass
  • forbidden_ownership: product behaviour
  • temporary_seams: none
  • responsibility_acceptance_criteria: [RAC-8, RAC-9]

T8: Measure the rebuilt pass against the token target

  • depends_on: [T6]
  • location: /home/stefan/repos/harness-intelligence/apps/wiki/content/docs/project/specs/cli/review-phase-token-rebuild/
  • owned_paths: [apps/wiki/content/docs/project/specs/cli/review-phase-token-rebuild/IMPLEMENTATION-NOTES.md (section ## Acceptance Measurement only)]
  • read_dependencies: [Pass Reports of ≥ 3 real passes; root-agent session logs ~/.claude/projects/**; SPEC AC-001–AC-003]
  • shared_runtime_resources: live engine CLIs (Claude, Codex); delivery folders of the measured deliveries
  • relevant_input_set: each pass's run_id and Pass Report path
  • wave_boundary: W5
  • description: Run three Full Code Review Passes of the rebuilt skill (from apps/cli/skills/review-phase after T6) over the merge commits of harness PRs #272, #274 and #277, each in a scratch delivery folder (P5); sum root review turns, Adjudicator subagent_tokens and recorded engine usage; record median tokens and turns.
  • validation: measurement table shows median ≤ 4M tokens and ≤ 10 root turns; no pass stopped for token use.
  • status: Done
  • log:
  • files edited/created:
  • task_identity_mode: provider-task
  • backlog_item_id: IP-533
  • backlog_item_url: https://linear.app/devpunks/issue/IP-533/measure-the-rebuilt-pass-against-the-token-target
  • relation_mode: native
  • backlog_sync_skip_reason:
  • assigned_skills: []
  • implementation_skill_guidance: none (no scoped skill trigger matches; record falsifiable evidence per pass and keep a failed target visible)
  • tdd_status: not_testable
  • tdd_target: Median pass cost over real runs.
  • red_command:
  • expected_red_failure:
  • green_command:
  • reason_not_testable: Acceptance measurement over live engine runs, not a unit behaviour.
  • red_evidence:
  • green_evidence:
  • codebase_design_notes: not_applicable
  • review_mode: cli
  • runtime_validation: required
  • runtime_target: Installed review-phase in a Claude Code host over real deliveries
  • runtime_evidence: Pass Reports with per-attempt usage and Adjudicator tokens; root session turn counts
  • runtime_cleanup: Each pass's $TMPDIR/hi-review/<run-id>/ removed by retain; scratch delivery folders and their Pass Report commits live on a throwaway branch that is deleted after the record is written
  • architecture_wave: A4
  • behavior_owner: pass cost (whole system)
  • integration_surface: delivery-phase review step
  • public_seam: Pass Report usage fields
  • topology_delta: none
  • forbidden_ownership: none
  • temporary_seams: none
  • responsibility_acceptance_criteria: [RAC-7]

Backlog Sync

provider-task mode. Every Tn maps to one Linear Task with parent Story, milestone V4.8 Review Phase Token Rebuild and native blockers read back on 2026-10-23: IP-528 ← IP-526, IP-527; IP-529 ← IP-526; IP-530 ← IP-528, IP-529; IP-531 ← IP-529, IP-530; IP-532 ← IP-531; IP-533 ← IP-531.

Rule Activation

RuleTasksResult at planning
HI-REPO-004 shared-skill-sourceT1–T6applies: T1–T5 edit the source in ~/repos/skills on main; T6 syncs it into apps/cli/skills
HI-REPO-002 baseline-release-entrypointT6 (publisher)applies
HI-CLI-003 source boundaries, HI-CLI-004 managed-asset integrityT6apply
HI-WIKI-001, HI-WIKI-003, HI-DOCS-001T7, T8apply

Unresolved Questions

  • None blocking. The Codex host marker is source-proven only (ARCHITECTURE Parked Work); T3 tests it with environment fixtures and T8 records the engine actually used.

On this page