@momentiq/dark-factory-cli 3.0.1 → 3.1.0
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/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +3 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/mode.d.ts.map +1 -1
- package/dist/commands/mode.js +120 -22
- package/dist/commands/mode.js.map +1 -1
- package/dist/commands/skills.d.ts.map +1 -1
- package/dist/commands/skills.js +11 -1
- package/dist/commands/skills.js.map +1 -1
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +113 -8
- package/dist/commands/verify.js.map +1 -1
- package/dist/mcp/tools/skills-install.d.ts.map +1 -1
- package/dist/mcp/tools/skills-install.js +8 -3
- package/dist/mcp/tools/skills-install.js.map +1 -1
- package/dist/mode/critic-registration.d.ts +30 -10
- package/dist/mode/critic-registration.d.ts.map +1 -1
- package/dist/mode/critic-registration.js +31 -10
- package/dist/mode/critic-registration.js.map +1 -1
- package/dist/mode/guard.d.ts.map +1 -1
- package/dist/mode/guard.js +30 -2
- package/dist/mode/guard.js.map +1 -1
- package/dist/mode/init.d.ts +7 -4
- package/dist/mode/init.d.ts.map +1 -1
- package/dist/mode/init.js +146 -12
- package/dist/mode/init.js.map +1 -1
- package/dist/mode/preview-capture.d.ts +3 -0
- package/dist/mode/preview-capture.d.ts.map +1 -0
- package/dist/mode/preview-capture.js +129 -0
- package/dist/mode/preview-capture.js.map +1 -0
- package/dist/mode/preview.d.ts +160 -0
- package/dist/mode/preview.d.ts.map +1 -0
- package/dist/mode/preview.js +522 -0
- package/dist/mode/preview.js.map +1 -0
- package/dist/onboard/seeders/design-md.d.ts.map +1 -1
- package/dist/onboard/seeders/design-md.js +512 -17
- package/dist/onboard/seeders/design-md.js.map +1 -1
- package/dist/skills/install.d.ts +25 -5
- package/dist/skills/install.d.ts.map +1 -1
- package/dist/skills/install.js +34 -17
- package/dist/skills/install.js.map +1 -1
- package/dist/skills/known-skills.d.ts +2 -0
- package/dist/skills/known-skills.d.ts.map +1 -0
- package/dist/skills/known-skills.js +25 -0
- package/dist/skills/known-skills.js.map +1 -0
- package/package.json +2 -2
- package/skills/designer-build/SKILL.md.tmpl +14 -0
- package/skills/designer-handoff/SKILL.md.tmpl +43 -3
- package/skills/designer-ship/SKILL.md.tmpl +17 -14
- package/skills/verify/producer/README.md +29 -4
- package/skills/verify/producer/playwright-route.sh +10 -0
- package/skills/verify/producer/surface-declaration.ts +373 -0
- package/skills/verify/producer/ui-route.producer.spec.ts +44 -11
package/dist/skills/install.js
CHANGED
|
@@ -23,23 +23,12 @@ import { dirname, join, resolve } from "node:path";
|
|
|
23
23
|
import { fileURLToPath } from "node:url";
|
|
24
24
|
import { loadDarkFactoryConfig, resolveSkillOverrides, } from "./config.js";
|
|
25
25
|
import { extractReferencedVariables, renderTemplateBody, } from "./template.js";
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"chief-engineer-blitz",
|
|
33
|
-
"objectives",
|
|
34
|
-
"verify",
|
|
35
|
-
// Designer Mode (cycle 27 Phase B) — the operator-facing skill set. Each
|
|
36
|
-
// installs via the same machinery + the darkfactory.yaml `skills` enable
|
|
37
|
-
// map (`df skills install --all` cross-checks names against this list).
|
|
38
|
-
"designer-brief",
|
|
39
|
-
"designer-build",
|
|
40
|
-
"designer-ship",
|
|
41
|
-
"designer-handoff",
|
|
42
|
-
];
|
|
26
|
+
import { KNOWN_SKILLS } from "./known-skills.js";
|
|
27
|
+
// `KNOWN_SKILLS` now lives in the dependency-free `./known-skills.js` so
|
|
28
|
+
// pure-data consumers (e.g. `df mode init`) can read it without pulling this
|
|
29
|
+
// installer's render+fs chain. Re-exported here so existing `install.js`
|
|
30
|
+
// importers keep resolving it unchanged.
|
|
31
|
+
export { KNOWN_SKILLS };
|
|
43
32
|
/**
|
|
44
33
|
* The HTML-comment marker emitted at the top of every rendered file
|
|
45
34
|
* (after frontmatter for SKILL.md, at the very top for other files). Used
|
|
@@ -47,6 +36,34 @@ export const KNOWN_SKILLS = [
|
|
|
47
36
|
* unless `--force` is passed.
|
|
48
37
|
*/
|
|
49
38
|
const GENERATED_MARKER = "GENERATED by `df skills install";
|
|
39
|
+
/**
|
|
40
|
+
* Operator-facing note appended to a successful `df skills install` — both the
|
|
41
|
+
* CLI text summary (`df skills install`) and the `df_skills_install` MCP tool —
|
|
42
|
+
* whenever at least one skill file is newly written (see {@link installWroteFiles}).
|
|
43
|
+
*
|
|
44
|
+
* Rendered skills land on disk immediately, but the Claude Code host only
|
|
45
|
+
* SURFACES them as invokable skills at the start of a NEW session, so a
|
|
46
|
+
* mid-session install cannot be invoked as a skill until a restart. Until then
|
|
47
|
+
* the rendered `SKILL.md` can be followed directly as a runbook.
|
|
48
|
+
*
|
|
49
|
+
* This is partly a harness-side dependency: skill discovery is owned by the
|
|
50
|
+
* Claude Code host, not the CLI — DF only writes the files. We surface the hint
|
|
51
|
+
* here for operator awareness rather than silently leaving the friction
|
|
52
|
+
* undiscoverable. See momentiq-ai/dark-factory#364.
|
|
53
|
+
*/
|
|
54
|
+
export const SKILLS_RESTART_NOTE = "Note: newly installed or updated skills are written to disk, but the Claude " +
|
|
55
|
+
"Code host only surfaces them as invokable skills in a NEW session. Restart " +
|
|
56
|
+
"(or start a new session in this repo) to invoke them; until then, follow " +
|
|
57
|
+
"each skill's SKILL.md directly as a runbook.";
|
|
58
|
+
/**
|
|
59
|
+
* True when an install result set wrote at least one file to disk (a `created`
|
|
60
|
+
* or `updated` action) — the trigger for surfacing {@link SKILLS_RESTART_NOTE}.
|
|
61
|
+
* All-`unchanged` / all-`skipped` runs introduced nothing the host needs a new
|
|
62
|
+
* session to surface, so they omit the note.
|
|
63
|
+
*/
|
|
64
|
+
export function installWroteFiles(results) {
|
|
65
|
+
return results.some((r) => r.files.some((f) => f.action === "created" || f.action === "updated"));
|
|
66
|
+
}
|
|
50
67
|
/**
|
|
51
68
|
* Resolve the absolute path of the bundled-skills source-of-truth root.
|
|
52
69
|
* In dev (running from src/), the path is `<package>/skills/`. In a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/skills/install.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,qEAAqE;AACrE,iCAAiC;AACjC,EAAE;AACF,wBAAwB;AACxB,0EAA0E;AAC1E,8DAA8D;AAC9D,0EAA0E;AAC1E,6EAA6E;AAC7E,sDAAsD;AACtD,wEAAwE;AACxE,8DAA8D;AAC9D,EAAE;AACF,aAAa;AACb,+EAA+E;AAC/E,8EAA8E;AAC9E,6BAA6B;AAC7B,wEAAwE;AACxE,8EAA8E;AAE9E,OAAO,EACL,UAAU,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,UAAU,EACV,SAAS,EACT,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,qBAAqB,EACrB,qBAAqB,GAGtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,GAEnB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/skills/install.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,qEAAqE;AACrE,iCAAiC;AACjC,EAAE;AACF,wBAAwB;AACxB,0EAA0E;AAC1E,8DAA8D;AAC9D,0EAA0E;AAC1E,6EAA6E;AAC7E,sDAAsD;AACtD,wEAAwE;AACxE,8DAA8D;AAC9D,EAAE;AACF,aAAa;AACb,+EAA+E;AAC/E,8EAA8E;AAC9E,6BAA6B;AAC7B,wEAAwE;AACxE,8EAA8E;AAE9E,OAAO,EACL,UAAU,GAC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eAAe,EAAE,QAAQ,CAAC,OAAO;QACjC,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,eAAe,EAAE,MAAM,CAAC,SAAS;QACjC,iBAAiB;QACjB,KAAK;KACN,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"known-skills.d.ts","sourceRoot":"","sources":["../../src/skills/known-skills.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,YAAY,EAAE,aAAa,CAAC,MAAM,CAY9C,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Data-only registry of the skills bundled with this CLI.
|
|
2
|
+
//
|
|
3
|
+
// Deliberately dependency-free (no installer / renderer / fs imports) so a
|
|
4
|
+
// pure-DATA consumer — e.g. `df mode init`, whose sibling `df mode guard|context
|
|
5
|
+
// --hook` paths run per-tool-call in an active session — can read the catalog
|
|
6
|
+
// without pulling the whole `skills/install.ts` render+fs dependency chain into
|
|
7
|
+
// its module graph. `install.ts` imports + re-exports this so existing
|
|
8
|
+
// `install.js` importers are unaffected.
|
|
9
|
+
//
|
|
10
|
+
// Adding a new skill = (1) drop the source-of-truth dir under `skills/`,
|
|
11
|
+
// (2) append the name here.
|
|
12
|
+
export const KNOWN_SKILLS = [
|
|
13
|
+
"chief-engineer-review",
|
|
14
|
+
"chief-engineer-blitz",
|
|
15
|
+
"objectives",
|
|
16
|
+
"verify",
|
|
17
|
+
// Designer Mode (cycle 27 Phase B) — the operator-facing skill set. Each
|
|
18
|
+
// installs via the same machinery + the darkfactory.yaml `skills` enable
|
|
19
|
+
// map (`df skills install --all` cross-checks names against this list).
|
|
20
|
+
"designer-brief",
|
|
21
|
+
"designer-build",
|
|
22
|
+
"designer-ship",
|
|
23
|
+
"designer-handoff",
|
|
24
|
+
];
|
|
25
|
+
//# sourceMappingURL=known-skills.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"known-skills.js","sourceRoot":"","sources":["../../src/skills/known-skills.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,EAAE;AACF,2EAA2E;AAC3E,iFAAiF;AACjF,8EAA8E;AAC9E,gFAAgF;AAChF,uEAAuE;AACvE,yCAAyC;AACzC,EAAE;AACF,yEAAyE;AACzE,4BAA4B;AAE5B,MAAM,CAAC,MAAM,YAAY,GAA0B;IACjD,uBAAuB;IACvB,sBAAsB;IACtB,YAAY;IACZ,QAAQ;IACR,yEAAyE;IACzE,yEAAyE;IACzE,wEAAwE;IACxE,gBAAgB;IAChB,gBAAgB;IAChB,eAAe;IACf,kBAAkB;CACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momentiq/dark-factory-cli",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Dark Factory OSS CLI — multi-vendor adversarial critic orchestration (Cursor, Codex, Gemini, Grok) with min-complete-quorum aggregation and trusted-surface rebind",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://momentiq.ai/dark-factory",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"@google/genai": "^2.2.0",
|
|
99
99
|
"@iarna/toml": "2.2.5",
|
|
100
100
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
101
|
-
"@momentiq/dark-factory-schemas": "0.15.
|
|
101
|
+
"@momentiq/dark-factory-schemas": "0.15.1",
|
|
102
102
|
"@openai/codex-sdk": ">=0.142.5 <1.0.0",
|
|
103
103
|
"@yarnpkg/lockfile": "1.1.0",
|
|
104
104
|
"ajv": "^8.20.0",
|
|
@@ -20,6 +20,20 @@ if a call is denied, **do not retry or route around it.** A denial means the ask
|
|
|
20
20
|
needs an engineer: stop and use `/designer-handoff`. (`df mode status` confirms
|
|
21
21
|
the active mode and its editable areas.)
|
|
22
22
|
|
|
23
|
+
### When the feature needs to save — the persistence seam
|
|
24
|
+
|
|
25
|
+
The most common end-to-end ask is "make X editable **and** saved." You can build
|
|
26
|
+
the whole optimistic UI *in scope* — the inline editor, the form, validation, the
|
|
27
|
+
visible save affordance and its happy-path feedback — but the write that actually
|
|
28
|
+
**persists** it lands on a backend path (an API route, a server mutation, a
|
|
29
|
+
migration) the guard **correctly denies**. That denial is not the feature failing;
|
|
30
|
+
it is the seam where your work hands to an engineer's.
|
|
31
|
+
|
|
32
|
+
So don't dead-end on it. Build and screenshot the optimistic UI you *can* build,
|
|
33
|
+
**commit it to the branch**, then switch to `/designer-handoff` and name that exact
|
|
34
|
+
persistence seam. Your UI and the engineer's persistence then compose into one
|
|
35
|
+
shippable feature — the build→handoff→resume loop in `/designer-handoff`.
|
|
36
|
+
|
|
23
37
|
## Reuse the design system — don't invent
|
|
24
38
|
|
|
25
39
|
`DESIGN.md` is the design source of truth (its tokens are injected into your
|
|
@@ -18,6 +18,31 @@ boundary is a clean handoff that feels like momentum.
|
|
|
18
18
|
- A gate finding **won't converge within N=2** fix rounds, or the fix requires
|
|
19
19
|
work outside your scope.
|
|
20
20
|
|
|
21
|
+
## The persistence handoff — "editable **and** saved" (build→handoff→resume)
|
|
22
|
+
|
|
23
|
+
The most common Designer Mode dead-end is a feature that must **save** something.
|
|
24
|
+
You can build the optimistic UI in scope — the inline editor, the toggle, the form
|
|
25
|
+
and its happy-path feedback — but the write that **persists** it lands on a
|
|
26
|
+
protected path (an API route, a server mutation, a migration) the guard correctly
|
|
27
|
+
denies. Make the two halves compose into ONE feature instead of losing the thread:
|
|
28
|
+
|
|
29
|
+
1. **Build and keep the in-scope UI.** Finish everything the optimistic UI needs
|
|
30
|
+
(state, validation, the visible save affordance) and screenshot it. An
|
|
31
|
+
uncommitted working tree is a lost thread — **commit the in-scope UI to the
|
|
32
|
+
branch and open the PR (a draft is fine)** so the engineer can resume *on top of*
|
|
33
|
+
it, then `df handoff --link pr:<PR#>` so the handoff points at that exact code.
|
|
34
|
+
2. **Name the persistence seam.** In the note's **Blocked — why**, name the exact
|
|
35
|
+
seam an engineer must wire: the endpoint or mutation (the path the guard
|
|
36
|
+
reported), the request/response shape the UI already expects, and where the UI
|
|
37
|
+
calls it. This is the one thing that turns a rejection into a resumable task.
|
|
38
|
+
3. **Resume as one feature.** The engineer wires the persistence on the same
|
|
39
|
+
branch/PR; your optimistic UI + their save ship together. Say so in the note so
|
|
40
|
+
the work resumes rather than restarts.
|
|
41
|
+
|
|
42
|
+
> The guard denies designer writes to persistence paths **on purpose** — a
|
|
43
|
+
> designer-safe client-mutation path is deliberately out of scope. This loop is how
|
|
44
|
+
> a save-feature still ships end-to-end today.
|
|
45
|
+
|
|
21
46
|
## Package the artifact with `df handoff`
|
|
22
47
|
|
|
23
48
|
`df handoff` is Issue-anchored: it reads the composed note on **stdin**, upserts
|
|
@@ -27,18 +52,30 @@ unassigned; it prints the Issue URL. Link the relevant PR or issue with
|
|
|
27
52
|
|
|
28
53
|
```bash
|
|
29
54
|
df handoff --link pr:<PR#> <<'EOF'
|
|
30
|
-
<the composed, scrubbed note
|
|
55
|
+
<the composed, scrubbed note from "Dual-register" below —
|
|
56
|
+
INCLUDING its <!-- agent-context:v1 --> … <!-- /agent-context:v1 --> markers>
|
|
31
57
|
EOF
|
|
32
58
|
```
|
|
33
59
|
|
|
60
|
+
The note **must** be wrapped in the `<!-- agent-context:v1 -->` …
|
|
61
|
+
`<!-- /agent-context:v1 -->` markers (they anchor the Issue-body upsert);
|
|
62
|
+
`df handoff` refuses a note that is missing them.
|
|
63
|
+
|
|
34
64
|
## Dual-register: two audiences, one artifact
|
|
35
65
|
|
|
36
66
|
Write the note for the **engineer**, and speak a separate plain sentence to the
|
|
37
67
|
**operator**.
|
|
38
68
|
|
|
39
|
-
Engineer-facing note (structured, precise):
|
|
69
|
+
Engineer-facing note (structured, precise). Keep the `agent-context:v1` markers
|
|
70
|
+
around the whole note — copy this verbatim into the heredoc above:
|
|
40
71
|
|
|
41
72
|
```markdown
|
|
73
|
+
<!-- agent-context:v1 -->
|
|
74
|
+
> 🤖 **Handoff context** — transient working memory, not a source of truth.
|
|
75
|
+
> _Updated: <YYYY-MM-DD> by <your session>_
|
|
76
|
+
|
|
77
|
+
**Work-stream:** `<the ask, in one line>` · the handoff Issue's title.
|
|
78
|
+
|
|
42
79
|
## Intent
|
|
43
80
|
What the operator asked for, in their words.
|
|
44
81
|
|
|
@@ -47,7 +84,10 @@ What is already built and where (branch or PR), and what is verified visually.
|
|
|
47
84
|
|
|
48
85
|
## Blocked — why
|
|
49
86
|
The specific boundary: which scope, protected path, dependency, or gate — and
|
|
50
|
-
what an engineer needs to decide or do next.
|
|
87
|
+
what an engineer needs to decide or do next. For a persistence handoff, name the
|
|
88
|
+
exact endpoint or mutation to wire and the request/response shape the in-scope UI
|
|
89
|
+
already expects, so the engineer resumes instead of restarting.
|
|
90
|
+
<!-- /agent-context:v1 -->
|
|
51
91
|
```
|
|
52
92
|
|
|
53
93
|
Operator-facing sentence (plain, framed as progress):
|
|
@@ -18,12 +18,14 @@ The brief's **Done-when checkboxes are the acceptance criteria.** Before
|
|
|
18
18
|
shipping, confirm each is satisfied and backed by the before/after screenshots
|
|
19
19
|
from `/designer-build` — a Done-when item with no visible proof is not done.
|
|
20
20
|
|
|
21
|
-
Make "done" proof-bound, not free text.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
Make "done" proof-bound, not free text. Derive an objectives contract straight
|
|
22
|
+
from the brief with **`df objectives derive --brief <brief-path> --apply`** — it
|
|
23
|
+
writes one objective per `## Done-when` checkbox to `.darkfactory/objectives.yaml`,
|
|
24
|
+
each text-hash-bound to its source line (id form `brief-<slug>#ac<k>`). Verify the
|
|
25
|
+
bindings and read the closeout proof with `df prove` (per-objective
|
|
26
|
+
proven/pending/failed); see the `/objectives` skill for authoring and binding
|
|
27
|
+
mechanics. Still confirm each Done-when item **visually** — the before/after
|
|
28
|
+
screenshots are the evidence behind the proof.
|
|
27
29
|
|
|
28
30
|
## 2. Run the gates locally first
|
|
29
31
|
|
|
@@ -42,14 +44,15 @@ Mode: designer
|
|
|
42
44
|
Closes #<N>
|
|
43
45
|
```
|
|
44
46
|
|
|
45
|
-
The `Mode: designer` trailer
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
`Closes #<N>` links
|
|
47
|
+
The `Mode: designer` trailer is what the **deterministic mode-scope critic**
|
|
48
|
+
keys on: it reads the trailer, loads the catalog, and validates the diff against
|
|
49
|
+
the mode's `writeScopes` / `protectedPaths` / `diffBudget` / `dependencyPolicy`,
|
|
50
|
+
blocking an out-of-scope diff at merge time — even from a jailbroken local
|
|
51
|
+
session, because CI re-derives scope from the *committed* trailer + catalog
|
|
52
|
+
independently of whatever happened locally. Scope is *also* enforced live
|
|
53
|
+
in-session by the PreToolUse guard, and the change still faces the full
|
|
54
|
+
multi-vendor critic quorum + merge queue like any other PR. `Closes #<N>` links
|
|
55
|
+
the tracking issue.
|
|
53
56
|
|
|
54
57
|
Open the PR and embed the **before/after screenshots** in the body so the change
|
|
55
58
|
is visible to reviewers and the operator:
|
|
@@ -19,18 +19,41 @@ optional, consumer-supplied Playwright **storage-state**.
|
|
|
19
19
|
| `playwright.ui-route.config.ts` | Dedicated Playwright config: one chromium project, optional storage-state, optional local-preview server. | `testDir` / dev command |
|
|
20
20
|
| `ui-route.producer.spec.ts` | The capture: ARIA snapshot + after (+ optional before) screenshots, fail-closed coverage, optional VLM hook. | **`SURFACES[]`** (required) |
|
|
21
21
|
| `coverage.ts` | Pure fail-closed coverage logic (a changed UI path with no surface blocks). Unit-tested upstream. | No |
|
|
22
|
+
| `surface-declaration.ts` | Reads the **designer-safe** `.darkfactory/ui-surfaces.json` declaration (a data file: "this changed area is shown on `<route>`") + builds the mode-aware fail-closed message. Pure, unit-tested upstream. | No |
|
|
22
23
|
|
|
23
24
|
## Setup (one-time)
|
|
24
25
|
|
|
25
|
-
1. **Copy** the
|
|
26
|
+
1. **Copy** the files into your repo. Convention: the script under
|
|
26
27
|
`scripts/verify/`, and `playwright.ui-route.config.ts` + `tests/e2e/
|
|
27
|
-
ui-route.producer.spec.ts` + `tests/e2e/coverage.ts`
|
|
28
|
-
(`web/` by default). Adjust
|
|
29
|
-
the script header) if your
|
|
28
|
+
ui-route.producer.spec.ts` + `tests/e2e/coverage.ts` + `tests/e2e/
|
|
29
|
+
surface-declaration.ts` under your web app dir (`web/` by default). Adjust
|
|
30
|
+
`DF_UI_ROUTE_WEB_DIR` / `DF_UI_ROUTE_CONFIG` (see the script header) if your
|
|
31
|
+
layout differs.
|
|
30
32
|
2. **Edit `SURFACES[]`** in `ui-route.producer.spec.ts` — your routes, each with
|
|
31
33
|
a structural `requiredHeading` (an accessible-name regex) and the `covers`
|
|
32
34
|
source globs it is the evidence for. v1 ships one public `/` surface so it
|
|
33
35
|
works zero-auth out of the box.
|
|
36
|
+
|
|
37
|
+
**Designer-safe alternative (no code edit, #359):** a non-engineer can cover a
|
|
38
|
+
changed area by DECLARING the covering route in a data file —
|
|
39
|
+
`.darkfactory/ui-surfaces.json` at the repo root — instead of editing
|
|
40
|
+
`SURFACES[]`:
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{ "surfaces": [
|
|
44
|
+
{ "path": "/chat", "covers": ["web/components/chat/**"], "requiredHeading": "Chat" }
|
|
45
|
+
] }
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Declared surfaces are captured (navigated + asserted + screenshotted) exactly
|
|
49
|
+
like a hand-authored one, so the fail-closed coverage requirement is
|
|
50
|
+
unchanged — only the authoring surface (JSON data vs TS/RegExp) differs.
|
|
51
|
+
`requiredHeading` here is a plain string (matched case-insensitively, not a
|
|
52
|
+
regex). Under an operator mode (`DF_MODE` set, e.g. Designer Mode), a still-
|
|
53
|
+
uncovered path routes to `/designer-handoff` in plain language instead of
|
|
54
|
+
"edit the spec". **Caveat:** an over-broad `covers` glob re-opens the
|
|
55
|
+
sibling-swallow hazard (a `/` surface claiming your whole app) — keep declared
|
|
56
|
+
`covers` scoped to what the route actually renders.
|
|
34
57
|
3. **(Protected surfaces only)** Mint an authenticated Playwright `storageState`
|
|
35
58
|
JSON with your own auth and point `DF_UI_ROUTE_STORAGE_STATE` at it. Public
|
|
36
59
|
surfaces need none. Gitignore your storage-state (`**/.auth/`).
|
|
@@ -59,6 +82,8 @@ optional, consumer-supplied Playwright **storage-state**.
|
|
|
59
82
|
| `DF_UI_ROUTE_WEB_DIR` | `web` | Where your app + `@playwright/test` live. |
|
|
60
83
|
| `DF_UI_ROUTE_CONFIG` | `playwright.ui-route.config.ts` | Producer config, relative to the web dir. |
|
|
61
84
|
| `DF_UI_ROUTE_STORAGE_STATE` | _(unset)_ | Path to an authenticated storage-state (protected surfaces). |
|
|
85
|
+
| `DF_UI_SURFACES` | `<repo-root>/.darkfactory/ui-surfaces.json` | Designer-safe coverage declaration (#359). Absent ⇒ no declaration; upward-walked from the web dir when unset. |
|
|
86
|
+
| `DF_MODE` | _(unset)_ | Operator mode (e.g. `designer`); when set, a still-uncovered path routes to `/designer-handoff` in plain language. |
|
|
62
87
|
| `PLAYWRIGHT_TEST_BASE_URL` | local preview | Point at a deployed preview of the SHA instead of serving locally. |
|
|
63
88
|
| `DF_UI_ROUTE_DEV_CMD` | `npm run dev` | Local-preview server command. |
|
|
64
89
|
| `DF_UI_ROUTE_PORT` | `3217` | Local-preview port. |
|
|
@@ -86,6 +86,7 @@ GUARDED_PATHS=(
|
|
|
86
86
|
"${WEB_DIR}/**" '*.tsx'
|
|
87
87
|
"${SCRIPT_REL}"
|
|
88
88
|
'.agent-review/config.json'
|
|
89
|
+
'.darkfactory/ui-surfaces.json'
|
|
89
90
|
)
|
|
90
91
|
if ! git diff-index --quiet HEAD -- "${GUARDED_PATHS[@]}" 2>/dev/null; then
|
|
91
92
|
echo "[playwright-route] BLOCK: tracked UI or route-machinery files are dirty (uncommitted changes)." >&2
|
|
@@ -121,6 +122,15 @@ mkdir -p "${OUT_DIR}"
|
|
|
121
122
|
export DF_UI_ROUTE_SHA="${SHA}"
|
|
122
123
|
export DF_UI_ROUTE_OUT="${OUT_DIR}"
|
|
123
124
|
|
|
125
|
+
# Designer-safe coverage declaration (#359). The producer runs with cwd=${WEB_DIR},
|
|
126
|
+
# but the declaration lives at the REPO ROOT alongside the other .darkfactory/
|
|
127
|
+
# config — export its absolute path so the producer resolves it deterministically
|
|
128
|
+
# (it also upward-walks as a fallback when this is unset). An absent file is
|
|
129
|
+
# treated as "no declaration". It is in GUARDED_PATHS above, so an uncommitted
|
|
130
|
+
# declaration fails closed (evidence must bind to the committed SHA). DF_MODE (if
|
|
131
|
+
# the operator set it) is inherited by the producer subprocess automatically.
|
|
132
|
+
export DF_UI_SURFACES="${REPO_ROOT}/.darkfactory/ui-surfaces.json"
|
|
133
|
+
|
|
124
134
|
# --- preflight: web tier present + Playwright installed --------------------
|
|
125
135
|
if [[ ! -d "${WEB_DIR}/node_modules/@playwright" ]]; then
|
|
126
136
|
echo "[playwright-route] SOFT-SKIP: ${WEB_DIR}/ Playwright not installed (run \`cd ${WEB_DIR} && npm ci\`)." >&2
|