Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,15 @@ jobs:
- name: Install extension dependencies
run: npm ci --prefix extensions

- name: Typecheck
run: npm run typecheck

- name: Lint (Biome)
continue-on-error: true # NOTE: kept until TP-194 (gate flip)
run: npm run lint

- name: Format check (Biome)
run: npm run format:check

- name: Run tests
run: |
cd extensions
Expand Down
3 changes: 3 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ When in doubt, optimize for: **determinism, recoverability, and clear operator v
- Especially for discovery, waves, persistence/resume, and command parsing.

4. **Run validations locally (minimum)**
- `npm run typecheck` (required CI gate — TypeScript errors block merge)
- `npm run lint` (required CI gate — Biome lint errors block merge)
- `npm run format:check` (required CI gate — Biome format drift blocks merge)
- `cd extensions && node --experimental-strip-types --experimental-test-module-mocks --no-warnings --import ./tests/loader.mjs --test tests/*.test.ts`
- If CLI changed: `node bin/taskplane.mjs help` and `node bin/taskplane.mjs doctor`

Expand Down
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,44 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Internal

- **Code-quality gates active (TP-194)**

The final task packet implementing the code-quality-gates spec
([`docs/specifications/taskplane/code-quality-gates.md`](docs/specifications/taskplane/code-quality-gates.md),
section 6.4). Flips three static-analysis checks from advisory to
required CI gates: `Typecheck` (new — `tsc --noEmit` against
`extensions/tsconfig.ci.json`), `Lint (Biome)` (was already wired
but ran with `continue-on-error: true` until now), and
`Format check (Biome)` (new — `biome format --no-errors-on-unmatched .`).
`.github/workflows/ci.yml` runs the three steps in order before the
existing `Run tests` step inside the single `ci` job, so any failure
short-circuits the rest of the pipeline. The existing required `ci`
branch-protection context already covers the new gates because a
step failure fails the whole job.

Reviewer-agent activation: the TP-188 quality-check verification
section in `templates/agents/task-reviewer.md` is now fully active.
The temporary activation note added in TP-191 (which previously
surfaced quality-check failures as Issues Found without downgrading
the verdict) is removed; failing typecheck/lint/format:check now
unconditionally downgrades APPROVE → REVISE during code review.
Documentation updates: `AGENTS.md` adds the three commands to the
validation checklist; `docs/maintainers/release-process.md` adds
them to the pre-release checks and pre-release checklist;
`docs/maintainers/development-setup.md` gets a new
"Code-quality gates (required for every PR)" section. The
long-missing `lint:fix` npm script (referenced by these docs) is
added to `package.json`.

**Operator handoff (verification-only):** no branch-protection
changes are required. After this PR merges, verify via
`gh api repos/HenryLach/taskplane/branches/main/protection`
that `required_status_checks.contexts` still contains `ci` (it
does today). If at some future point per-gate visibility in
branch protection is desirable, the follow-up is to split the
gates into separate jobs in `ci.yml` — out of scope for TP-194
per the spec's Tier-1.5 follow-up list.

- **Code-quality typecheck cleanup (TP-195):** Fourth of four sequenced
packets implementing the code-quality-gates spec
([`docs/specifications/taskplane/code-quality-gates.md`](docs/specifications/taskplane/code-quality-gates.md)).
Expand Down
27 changes: 27 additions & 0 deletions docs/maintainers/development-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,33 @@ and `@mariozechner/pi-tui` to local mock stubs so tests don't need the real pack

---

## Code-quality gates (required for every PR)

Three static checks are **required CI gates** — every PR must pass all three
before it can be merged. Each runs as a separate step in `.github/workflows/ci.yml`
and a failure blocks the merge:

```bash
npm run typecheck # TypeScript type-check (tsc --noEmit against extensions/tsconfig.ci.json)
npm run lint # Biome lint check
npm run format:check # Biome format check (non-zero exit on diff)
```

Run these locally before pushing for PR — they are cheap (each runs in a few
seconds) and catch regressions before CI does. The rationale for the three-gate
baseline is documented in
[`docs/specifications/taskplane/code-quality-gates.md`](../specifications/taskplane/code-quality-gates.md)
(the spec that introduced these gates via TP-191/TP-192/TP-193/TP-194).

To auto-fix the lint/format gates locally:

```bash
npm run lint:fix # apply safe Biome lint autofixes
npm run format # rewrite files in-place to match the format check
```

The typecheck gate has no auto-fix — type errors must be addressed by hand.

## Code style and `git blame.ignoreRevsFile` (recommended one-time config)

Taskplane uses [Biome](https://biomejs.dev) as both linter and formatter. The
Expand Down
14 changes: 13 additions & 1 deletion docs/maintainers/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,16 @@ npm pack --dry-run

Confirm only intended files ship (per `package.json#files`).

Run the test suite:
Run the code-quality gates (all three are required CI gates — if they fail
locally, CI will block the release PR):

```bash
npm run typecheck
npm run lint
npm run format:check
```

All three must exit 0. Then run the test suite:

```bash
cd extensions
Expand Down Expand Up @@ -306,6 +315,9 @@ a `-` qualifier).

- [ ] `main` is clean and synced
- [ ] All content PRs that should ship are merged
- [ ] `npm run typecheck` exits 0 (required CI gate)
- [ ] `npm run lint` exits 0 (required CI gate)
- [ ] `npm run format:check` exits 0 (required CI gate)
- [ ] Tests pass: `cd extensions && npm run test:fast`
- [ ] CLI smoke: `node bin/taskplane.mjs help` and `node bin/taskplane.mjs doctor`
- [ ] `npm pack --dry-run` reviewed (only intended files ship)
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"scripts": {
"typecheck": "tsc --project extensions/tsconfig.ci.json --noEmit",
"lint": "biome lint --no-errors-on-unmatched .",
"lint:fix": "biome lint --write --no-errors-on-unmatched .",
"format": "biome format --write --no-errors-on-unmatched .",
"format:check": "biome format --no-errors-on-unmatched ."
},
Expand Down
2 changes: 2 additions & 0 deletions taskplane-tasks/TP-194-cq-gates-flip/.DONE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Completed: 2026-05-10T22:05:29.412Z
Task: TP-194
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Plan Review: Step 1: Plan the gate flip

### Verdict: REVISE

### Summary
The Step 1 plan is strong on sequencing (preflight guardrail, gate ordering, reviewer-note removal, and docs touchpoints) and tracks the intended TP-194 outcomes. However, it currently assumes GitHub branch protection can require **step names** from a single `ci` job. That assumption is likely incorrect and risks producing an operator handoff that cannot be applied in repo settings.

### Issues Found
1. **[Severity: important]** — The plan treats `Typecheck`, `Lint (Biome)`, `Format check (Biome)`, `Run tests`, `CLI smoke checks`, and `Verify docs relative links` as required-status-check names while also keeping all gates as steps inside one `ci` job (`STATUS.md` Discoveries D1/D5 and draft text at lines 130-134, 138-139, 158-166). Branch protection typically consumes check-run contexts (usually job names), not individual step names. **Fix:** update the plan to either (a) model these as separate jobs with those exact names, or (b) keep one job but explicitly verify the real check contexts from an actual CI run and hand off those exact names to the operator.

### Missing Items
- Add a concrete verification action in the plan to capture the exact status-check context names emitted by GitHub Actions post-change (before finalizing Step 5/operator handoff).

### Suggestions
- In Discoveries D5, include a fallback note: “If required-check names differ from expected labels in branch protection UI, use the observed check context strings verbatim.”
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Plan Review: Step 1: Plan the gate flip

### Verdict: APPROVE

### Summary
This revised Step 1 plan is now coherent and executable: it defines the CI gate structure/order, the exact reviewer-note removal, and the required documentation touchpoints. It also correctly addresses the R001 blocker by treating branch protection as job-context based (`ci`) and adding explicit PR-time verification of emitted check contexts. I don’t see any remaining outcome-level gaps that would force rework later.

### Issues Found
1. **[Severity: minor]** — No blocking issues found.

### Missing Items
- None.

### Suggestions
- In the eventual Step 5 operator handoff text/PR body, explicitly call out that the original step-name list in PROMPT maps to enforcement through the single required `ci` context in GitHub branch protection (since checks are job-level contexts). That will avoid confusion for operators expecting per-step required checks in the UI.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Code Review: Step 2: Implement Part 1 — CI workflow updates

### Verdict: APPROVE

### Summary
The CI workflow changes for this step are correct and aligned with the TP-194 outcome: `Typecheck` and `Format check (Biome)` were added, and `continue-on-error: true` was removed from `Lint (Biome)` in `.github/workflows/ci.yml`. The step ordering is now `Typecheck → Lint (Biome) → Format check (Biome) → Run tests` (followed by existing smoke/docs checks), which preserves the intended fast-fail gate behavior before tests. I also ran the quality-check commands from `package.json` (`npm run typecheck`, `npm run lint`, `npm run format:check`); all exited successfully in this tree.

### Issues Found
1. **[Severity: minor]** — No blocking issues found.

### Pattern Violations
- None observed for this step.

### Test Gaps
- None specific to this workflow-only change; CI execution itself is the primary validation surface.

### Suggestions
- `npm run lint` currently exits 0 with a large warning/info backlog (280 warnings / 671 infos). That's not a blocker for Step 2, but consider a later cleanup/ratchet plan if the team eventually wants warning-level policy tightening.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Code Review: Step 3: Implement Part 2 — activate reviewer downgrade rule

### Verdict: APPROVE

### Summary
The Step 3 change cleanly removes only the temporary TP-191 activation override note from `templates/agents/task-reviewer.md`, restoring the TP-188 section to fully active behavior without altering the underlying downgrade-rule text. This matches the step requirement in `PROMPT.md` to reactivate unconditional APPROVE→REVISE downgrades when quality checks fail. Quality checks were executed from `package.json` fallback (`npm run typecheck`, `npm run lint`, `npm run format:check`) and all exited 0 in this tree.

### Issues Found
1. **None.**

### Pattern Violations
- None identified in the Step 3 diff.

### Test Gaps
- None blocking for this documentation/prompt-template-only change.

### Suggestions
- Optional: in a later cleanup task, consider reducing existing Biome lint warnings currently reported by `npm run lint` (command exits 0 today, but output is noisy).
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Code Review: Step 4: Implement Parts 3-4 — documentation

### Verdict: REVISE

### Summary
The Step 4 documentation updates mostly align with the task goals: `AGENTS.md`, `release-process.md`, and `development-setup.md` now call out typecheck/lint/format:check as required gates. I also ran the required quality checks (`npm run typecheck`, `npm run lint`, `npm run format:check`) and they passed on this tree. However, the newly added development-setup section introduces an invalid command that is not available in `package.json` scripts.

### Issues Found
1. **[docs/maintainers/development-setup.md:145] [important]** — The new “Code-quality gates” section instructs contributors to run `npm run lint:fix`, but this script does not exist in the repo’s `package.json` (running it returns `npm error Missing script: "lint:fix"`). Suggested fix: either add a `lint:fix` script (e.g., Biome lint with write/fix mode) or update the docs to only reference commands that currently exist.

### Pattern Violations
- None identified beyond the invalid command reference above.

### Test Gaps
- None for runtime behavior (docs-only step).

### Suggestions
- Ensure all command examples in maintainer docs are script-backed (or explicitly shown as direct `biome ...` CLI invocations) to avoid drift.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Code Review: Step 4: Implement Parts 3-4 — documentation

### Verdict: APPROVE

### Summary
The Step 4 updates satisfy the documented outcomes: `AGENTS.md`, `docs/maintainers/release-process.md`, and `docs/maintainers/development-setup.md` now describe typecheck/lint/format-check as required gates, and the previously invalid `npm run lint:fix` reference is now backed by a real `package.json` script. I also re-ran the required quality checks (`npm run typecheck`, `npm run lint`, `npm run format:check`) on the current tree; all three exit successfully. No blocking regressions were found in this step’s diff.

### Issues Found
1. None.

### Pattern Violations
- None identified.

### Test Gaps
- None for runtime behavior (docs/scripts-only scope in this step).

### Suggestions
- Optional consistency follow-up: mirror the new release quality-gate checklist bullets into the `AGENTS.md` release checklist section as well, so duplicated release guidance stays in sync with `docs/maintainers/release-process.md`.
Loading