valent-pipeline 0.19.51 → 0.19.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valent-pipeline",
3
- "version": "0.19.51",
3
+ "version": "0.19.53",
4
4
  "description": "v3 multi-agent AI pipeline for software development lifecycle",
5
5
  "type": "module",
6
6
  "bin": {
@@ -83,7 +83,10 @@
83
83
  * PRODUCES the evidence and JUDGE remains the single ship gate that rejects a bad/missing visual result.
84
84
  * `onMissingMcp` controls the no-browser-MCP case — `block` (default) records a failing/blocked evidence
85
85
  * file so JUDGE rejects the UI story; `na` records the checkpoints N/A (loudly) and proceeds. The
86
- * installer registers playwright-mcp for UI projects, so `block` is normally never hit. Non-ui stories
86
+ * installer registers the browser MCP as `playwright` (committed to .mcp.json); PMCP matches it by
87
+ * browser-tool CAPABILITY (`mcp__<server>__browser_navigate`), NOT the exact configured name, so a
88
+ * `playwright` vs `playwright-mcp` label difference is harmless. `block` is hit only when no browser MCP
89
+ * is available at all — e.g. a session predating the .mcp.json server (restart to register it). Non-ui stories
87
90
  * have no checklist => the stage is a no-op (N/A), exactly mirroring QA-A's checklist-production trigger.
88
91
  *
89
92
  * `preCriticGate` (from pipeline-config.yaml `pre_critic_gate`) is the deterministic pre-CRITIC
@@ -2112,10 +2115,21 @@ async function runStory(story) {
2112
2115
  // the round-trip cost and the rework-cycle count. Same preCriticChecks the gate runs; the
2113
2116
  // skip-waiver / spec-conformance rules are always named. Static + args only => journal-replay safe.
2114
2117
  const preHandoffStaticCmds = preCriticChecks.map((c) => subCmd(c, storyId, effectiveWorkspaces))
2115
- const preHandoffNote = (preHandoffStaticCmds.length || specConformanceEnabled || traceCheckEnabled)
2118
+ // Fix #3 (rework-reduction, 2026-06-24): the pre-CRITIC gate ALSO runs spec-conformance + trace check
2119
+ // (runPreCriticGate below), but the dev was only TOLD the rules, never handed the commands to run them.
2120
+ // The field's `rework after static` round-trips were test files with a dropped assertion target / a
2121
+ // missing AC trace-id / a mis-placed waiver — all catchable by running these two CLIs in the build turn.
2122
+ // Thread the SAME commands the gate runs into the self-gate so the dev catches them in-context (no
2123
+ // re-spawn). Static + args only => journal-replay safe.
2124
+ const preHandoffSpecCmds = [
2125
+ ...(specConformanceEnabled ? [`node .valent-pipeline/bin/cli.js check-spec-conformance --story ${storyId}`] : []),
2126
+ ...(traceCheckEnabled ? [`node .valent-pipeline/bin/cli.js trace check --story ${storyId}`] : []),
2127
+ ]
2128
+ const preHandoffNote = (preHandoffStaticCmds.length || preHandoffSpecCmds.length)
2116
2129
  ? '\n\n## Definition of done — run these BEFORE you write your handoff\n' +
2117
2130
  'The deterministic pre-CRITIC gate runs the moment you hand off; a failure costs a full rework cycle (a re-spawn). Pass them first-try:\n' +
2118
2131
  preHandoffStaticCmds.map((c) => ` - \`${c}\` — must exit 0 (lint / type / static).\n`).join('') +
2132
+ preHandoffSpecCmds.map((c) => ` - \`${c}\` — must exit 0 (spec-conformance / trace: catches a dropped assertion target, an omitted spec\'d case, a missing AC trace-id, or an un-waived skip BEFORE the gate round-trips you).\n`).join('') +
2119
2133
  ' - Every deliberately skipped or pending test MUST carry an inline `// valent-waiver: <reason>` (on the skip line or in the test name) — an un-waived skip is rejected by the spec-conformance check.\n' +
2120
2134
  ' - Do NOT drop a spec\'d assertion target or omit a spec\'d case to make a suite pass.\n' +
2121
2135
  'Run them locally, fix EVERYTHING they flag, and only then write your handoff — this is part of the build, not the gate\'s job to find for you.'
@@ -2796,17 +2810,22 @@ async function runStory(story) {
2796
2810
  schema: PMCP_SCHEMA,
2797
2811
  model: modelFor('PMCP'),
2798
2812
  trigger:
2799
- `Read \`stories/${sid}/output/visual-validation-checklist.md\`. FIRST confirm the browser-` +
2800
- `automation MCP (\`${visualBrowserMcp}\`) is actually available to you in this session.\n` +
2813
+ `Read \`stories/${sid}/output/visual-validation-checklist.md\`. FIRST confirm a browser-` +
2814
+ `automation MCP is actually available to you in THIS session. Match by CAPABILITY, not the ` +
2815
+ `exact server name: you have it if your tools include a \`mcp__<server>__browser_navigate\` ` +
2816
+ `(and \`browser_snapshot\`). The server is configured as \`${visualBrowserMcp}\` but may be ` +
2817
+ `registered under another name (commonly \`playwright\`) — check the tool SHAPE, not the label.\n` +
2801
2818
  (naMode
2802
- ? `• If it is NOT available: do NOT block. Write pmcp-evidence.md marking every checkpoint ` +
2803
- `N/A with a LOUD note that visual validation was SKIPPED because \`${visualBrowserMcp}\` is ` +
2804
- `not installed, set verdict "na", mcpAvailable:false, and return.\n`
2805
- : `• If it is NOT available: this is a BLOCKER (the project requires visual evidence for UI ` +
2806
- `stories). Write pmcp-evidence.md recording that visual validation COULD NOT RUN because ` +
2807
- `\`${visualBrowserMcp}\` is not installed, set verdict "fail", mcpAvailable:false, and return ` +
2808
- `— JUDGE will reject on the missing visual evidence. Install it with \`node ` +
2809
- `.valent-pipeline/bin/cli.js init --force\` (or \`claude mcp add --scope project playwright -- npx -y @playwright/mcp\`).\n`) +
2819
+ ? `• If NO such browser tool is available: do NOT block. Write pmcp-evidence.md marking every ` +
2820
+ `checkpoint N/A with a LOUD note that visual validation was SKIPPED because no browser-` +
2821
+ `automation MCP (\`${visualBrowserMcp}\`) is available, set verdict "na", mcpAvailable:false, and return.\n`
2822
+ : `• If NO such browser tool is available: this is a BLOCKER (the project requires visual ` +
2823
+ `evidence for UI stories). Write pmcp-evidence.md recording that visual validation COULD NOT ` +
2824
+ `RUN because no browser-automation MCP (\`${visualBrowserMcp}\`) is available, set verdict ` +
2825
+ `"fail", mcpAvailable:false, and return — JUDGE will reject on the missing visual evidence. ` +
2826
+ `If it IS installed (\`claude mcp list\` shows it Connected) but its tools are absent here, the ` +
2827
+ `session likely PREDATES the \`.mcp.json\` server and must be RESTARTED to register it. Install/` +
2828
+ `repair with \`node .valent-pipeline/bin/cli.js init --force\` (or \`claude mcp add --scope project playwright -- npx -y @playwright/mcp\`).\n`) +
2810
2829
  `• If it IS available (mcpAvailable:true): start the dev server yourself, then for EACH ` +
2811
2830
  `checkpoint navigate to its route, establish the required state, wait for the expected state ` +
2812
2831
  `(element/network conditions — never hard waits), capture a screenshot into the story output ` +
@@ -40,7 +40,8 @@ browser MCP is available, **start the dev server yourself**, run every checkpoin
40
40
 
41
41
  - `{story_id}`, `{story_output_dir}`
42
42
  - `{tech_stack.browser_automation_mcp}` — the browser-automation MCP to use (default: `playwright-mcp`).
43
- The orchestrator passes the exact name to look for in your task trigger.
43
+ The orchestrator passes this as a **hint**; confirm availability by tool **capability**
44
+ (`mcp__<server>__browser_navigate`), since the server is often registered under a different name (e.g. `playwright`).
44
45
 
45
46
  ## Execution Steps
46
47
 
@@ -50,7 +51,11 @@ state, AC reference, expected visual elements, setup instructions, and pass crit
50
51
  is missing, set a blocker in your output and STOP (a `ui`-profile story should always have one from QA-A).
51
52
 
52
53
  ### Step 2: Confirm MCP availability and branch
53
- Confirm the browser-automation MCP named in your trigger is actually available to you in this session.
54
+ Confirm a browser-automation MCP is actually available to you in this session — match by **capability,
55
+ not the exact server name**: you have it if your tools include `mcp__<server>__browser_navigate` /
56
+ `browser_snapshot`. The configured name in your trigger is a hint; the server is commonly registered as
57
+ `playwright`, so check the tool **shape**, not the label. If `claude mcp list` shows it Connected but the
58
+ tools are absent here, the session predates the `.mcp.json` server and must be **restarted** to register it.
54
59
  Follow the on-missing-MCP behavior the orchestrator passed in your trigger:
55
60
  - **`block`:** if the MCP is absent, write `pmcp-evidence.md` recording that visual validation could not
56
61
  run, set `verdict: fail`, `mcpAvailable: false`, and return — JUDGE rejects on the missing evidence.
@@ -492,8 +492,10 @@ export const defaults = {
492
492
  // visual-validation-checklist.md and writes pmcp-evidence.md — the artifact JUDGE's evidence pass
493
493
  // REQUIRES for UI stories. `on_missing_mcp` controls what happens when that MCP is not installed:
494
494
  // block — record a failing/blocked evidence file so JUDGE rejects the UI story (visual evidence
495
- // is mandatory). This is the default; the installer registers playwright-mcp for UI
496
- // projects, so it is normally never hit.
495
+ // is mandatory). This is the default; the installer registers the browser MCP as
496
+ // `playwright` and PMCP matches it by tool capability (mcp__*__browser_navigate), NOT the
497
+ // exact configured name, so it is hit only when no browser MCP is available at all (e.g. a
498
+ // session predating the .mcp.json server — restart to register it).
497
499
  // na — record the checkpoints as N/A (loudly) and let the story ship without visual evidence.
498
500
  visual: {
499
501
  on_missing_mcp: 'block',