frontend-harness 0.7.10 → 0.8.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/README.md +17 -10
- package/dist/cli/index.js +368 -65
- package/dist/cli/index.js.map +1 -1
- package/dist/runtime/builtin-skills.js +1 -1
- package/dist/runtime/clean.js +1 -0
- package/dist/runtime/clean.js.map +1 -1
- package/dist/runtime/command-taxonomy.js +6 -1
- package/dist/runtime/command-taxonomy.js.map +1 -1
- package/dist/runtime/context.d.ts +33 -2
- package/dist/runtime/context.js +63 -8
- package/dist/runtime/context.js.map +1 -1
- package/dist/runtime/evidence.d.ts +27 -0
- package/dist/runtime/evidence.js +240 -12
- package/dist/runtime/evidence.js.map +1 -1
- package/dist/runtime/ingest.d.ts +38 -0
- package/dist/runtime/ingest.js +157 -0
- package/dist/runtime/ingest.js.map +1 -0
- package/dist/runtime/knowledge/constants.js +1 -0
- package/dist/runtime/knowledge/constants.js.map +1 -1
- package/dist/runtime/knowledge/core.d.ts +7 -1
- package/dist/runtime/knowledge/core.js +329 -24
- package/dist/runtime/knowledge/core.js.map +1 -1
- package/dist/runtime/knowledge/types.d.ts +70 -1
- package/dist/runtime/knowledge.d.ts +2 -2
- package/dist/runtime/knowledge.js +1 -1
- package/dist/runtime/knowledge.js.map +1 -1
- package/dist/runtime/plan/guidance.d.ts +1 -1
- package/dist/runtime/plan/guidance.js +88 -25
- package/dist/runtime/plan/guidance.js.map +1 -1
- package/dist/runtime/plan/workflow.d.ts +1 -0
- package/dist/runtime/plan/workflow.js +32 -1
- package/dist/runtime/plan/workflow.js.map +1 -1
- package/dist/runtime/plan.d.ts +13 -0
- package/dist/runtime/plan.js +132 -79
- package/dist/runtime/plan.js.map +1 -1
- package/dist/runtime/policy-provenance.d.ts +17 -1
- package/dist/runtime/policy-provenance.js +42 -12
- package/dist/runtime/policy-provenance.js.map +1 -1
- package/dist/runtime/protocol-init.js +12 -7
- package/dist/runtime/protocol-init.js.map +1 -1
- package/dist/runtime/repair-packet.js +86 -4
- package/dist/runtime/repair-packet.js.map +1 -1
- package/dist/runtime/skills.d.ts +9 -0
- package/dist/runtime/skills.js +13 -0
- package/dist/runtime/skills.js.map +1 -1
- package/dist/runtime/state-explain.js +39 -7
- package/dist/runtime/state-explain.js.map +1 -1
- package/dist/runtime/state.js +36 -2
- package/dist/runtime/state.js.map +1 -1
- package/dist/runtime/task-context.d.ts +122 -0
- package/dist/runtime/task-context.js +1322 -0
- package/dist/runtime/task-context.js.map +1 -0
- package/dist/runtime/task-signals.d.ts +1 -0
- package/dist/runtime/task-signals.js +1 -1
- package/dist/runtime/task-signals.js.map +1 -1
- package/dist/runtime/ui-restoration.d.ts +3 -3
- package/dist/runtime/ui-restoration.js +3 -3
- package/dist/runtime/ui-restoration.js.map +1 -1
- package/dist/runtime/ui-source.d.ts +6 -0
- package/dist/runtime/ui-source.js +66 -0
- package/dist/runtime/ui-source.js.map +1 -0
- package/dist/runtime/verify.js +65 -25
- package/dist/runtime/verify.js.map +1 -1
- package/dist/schemas/types.d.ts +75 -2
- package/dist/schemas/validation.js +42 -7
- package/dist/schemas/validation.js.map +1 -1
- package/docs/DIRECTION.md +13 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frontend-harness
|
|
2
2
|
|
|
3
|
-
`frontend-harness` is
|
|
3
|
+
`frontend-harness` is a context and evidence policy layer for frontend teams using Codex or Claude Code.
|
|
4
4
|
|
|
5
5
|
It does not replace the agent runtime. Codex and Claude Code already provide the loop, tool execution, context handling, permissions, retries, subagents, and skill loading. `frontend-harness` adds the project-level rules those agents should follow inside a frontend repository.
|
|
6
6
|
|
|
@@ -10,16 +10,18 @@ The product goal is simple:
|
|
|
10
10
|
install once -> inject AGENTS.md / CLAUDE.md -> work normally with AI
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
After initialization, team members should not need to manually run
|
|
13
|
+
After initialization, team members should not need to manually run a heavy harness workflow for every task. They keep asking Codex or Claude Code for frontend work in plain language. The injected project protocol tells the agent when to use the full context, planning, evidence, and repair loop, and when ordinary task guidance is enough.
|
|
14
14
|
|
|
15
15
|
## What It Does
|
|
16
16
|
|
|
17
|
-
`frontend-harness` gives
|
|
17
|
+
`frontend-harness` gives complex frontend tasks a deterministic execution contract:
|
|
18
18
|
|
|
19
19
|
```text
|
|
20
20
|
context -> plan -> implement -> record changes -> verify -> repair -> done
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
The full loop is intended for work where source material, evidence, or traceability matters: design-backed UI restoration, PRD-derived product knowledge, multi-source frontend changes, and handoffs that need durable verification artifacts. Simple bug fixes, tests, docs, maintenance, and small requirement edits should stay lightweight unless the task includes explicit PRD, API, UI, or audit evidence.
|
|
24
|
+
|
|
23
25
|
The CLI exists mainly as a protocol API for AI agents. Humans use it to install, initialize, and occasionally check health.
|
|
24
26
|
|
|
25
27
|
## What It Is Not
|
|
@@ -35,7 +37,7 @@ It should not rebuild:
|
|
|
35
37
|
- long-running runtime launchers or supervised agent wrappers
|
|
36
38
|
- replacement workflows for Codex or Claude Code
|
|
37
39
|
|
|
38
|
-
Those belong to the official agent runtimes. This package owns only the frontend project policy around them.
|
|
40
|
+
Those belong to the official agent runtimes. This package owns only the frontend project context, policy, and evidence around them. It should not wrap ordinary agent conversation in process for its own sake.
|
|
39
41
|
|
|
40
42
|
## Install
|
|
41
43
|
|
|
@@ -115,7 +117,7 @@ Once those files are present, the normal team workflow is:
|
|
|
115
117
|
```text
|
|
116
118
|
Open Codex or Claude Code.
|
|
117
119
|
Ask for the frontend change.
|
|
118
|
-
Let the injected protocol
|
|
120
|
+
Let the injected protocol decide whether the task needs the full harness loop or lightweight project guidance.
|
|
119
121
|
```
|
|
120
122
|
|
|
121
123
|
## Human Commands
|
|
@@ -146,9 +148,10 @@ These commands are intended for Codex / Claude Code through the injected protoco
|
|
|
146
148
|
|
|
147
149
|
```bash
|
|
148
150
|
npm run harness -- context --json
|
|
151
|
+
npm run harness -- context task --json "<task>" --prd <prd-file> --api-source <openapi-file-or-url> --ui-source <ui-artifact-or-design-url>
|
|
149
152
|
npm run harness -- proposal check --json --file <agent-proposal.json>
|
|
150
153
|
npm run harness -- plan --json "<task>"
|
|
151
|
-
npm run harness -- plan --json "<task>" --prd <prd-file> --ui-source <ui-artifact-or-design-url>
|
|
154
|
+
npm run harness -- plan --json "<task>" --prd <prd-file> --api-source <openapi-file-or-url> --ui-source <ui-artifact-or-design-url>
|
|
152
155
|
npm run harness -- plan --json "<task>" --agent-proposal <agent-proposal.json>
|
|
153
156
|
npm run harness -- state record-change <file>
|
|
154
157
|
npm run harness -- state record-change --from-git
|
|
@@ -162,7 +165,7 @@ npm run harness -- state next --json
|
|
|
162
165
|
npm run harness -- state explain --json
|
|
163
166
|
```
|
|
164
167
|
|
|
165
|
-
The agent should call them automatically
|
|
168
|
+
The agent should call them automatically when the task needs harness-managed context, planning, or evidence. They persist local state under `.frontend-harness/` and provide deterministic evidence for each step. `context task --json` emits a compact task packet from workflow policy, selected knowledge cards, explicit PRD/API/UI inputs, candidate project files, and ingest provenance so agents can use PRD/UI/API context without loading entire source materials into the prompt. `evidence template --json` prints the machine-readable evidence entry shape for the current plan; it is a schema aid, not proof. Put real captures, checks, comparisons, and hashes in a project-local evidence input JSON, then use `evidence record --json --file <evidence-input.json>` so the harness validates and writes `.frontend-harness/verification/evidence.json`. Captured evidence and visual comparison files are local intermediate artifacts by default; scaffolded projects ignore them and `clean` may remove them.
|
|
166
169
|
|
|
167
170
|
`state check --json` verifies that recorded changed files cover the current plan's execution-unit files before verification. `verify --json` runs that contract check first, enforces PRD knowledge coverage when the plan has PRD input, and then discovers the default `typecheck`, `test`, and `build` scripts when present. Projects can also declare custom verification commands in `.frontend-harness/config.json`:
|
|
168
171
|
|
|
@@ -189,7 +192,7 @@ The agent should call them automatically while doing work. They persist local st
|
|
|
189
192
|
- `documentation`
|
|
190
193
|
- `maintenance`
|
|
191
194
|
|
|
192
|
-
Each plan includes required knowledge actions, implementation constraints, and verification focus.
|
|
195
|
+
Each plan includes required knowledge actions, implementation constraints, and verification focus. UI restoration, PRD knowledge, explicit source-backed API work, and evidence-heavy changes use the full controlled loop. Ordinary tests, bug fixes, docs, maintenance, and requirement edits are intentionally lightweight policy guidance unless the task supplies PRD/API/UI source material or asks for auditable evidence. Project skills remain guidance, not executable runtime commands.
|
|
193
196
|
|
|
194
197
|
### Agent Plan Proposals
|
|
195
198
|
|
|
@@ -251,7 +254,11 @@ These commands expose project-local knowledge and workflow guidance as provenanc
|
|
|
251
254
|
```bash
|
|
252
255
|
npm run harness -- skills list --json
|
|
253
256
|
npm run harness -- skills check --json
|
|
257
|
+
npm run harness -- ingest record --json --kind prd|openapi|ui-package --id <source-id> --source <file-or-url> --summary "<summary>"
|
|
258
|
+
npm run harness -- ingest list --json
|
|
259
|
+
npm run harness -- ingest show --json --ref ingest://<kind>/<source-id>
|
|
254
260
|
npm run harness -- knowledge add --json --kind rule --subject "<subject>" --rule "<rule>"
|
|
261
|
+
npm run harness -- knowledge draft --json --ref ingest://<kind>/<source-id>
|
|
255
262
|
npm run harness -- knowledge promote --json --title "<title>" --body "<body>"
|
|
256
263
|
npm run harness -- knowledge update --json --id <knowledge-id> --source "docs/prd/<file>.md"
|
|
257
264
|
npm run harness -- knowledge index --json
|
|
@@ -262,7 +269,7 @@ npm run harness -- knowledge show --json --id <knowledge-id>
|
|
|
262
269
|
npm run harness -- knowledge check --json
|
|
263
270
|
```
|
|
264
271
|
|
|
265
|
-
Prefer `knowledge add` for PRD digestion. It stores small atomic entries such as rules, workflows, permissions, terms, decisions, conventions, and pitfalls with `source_paths` pointing back to the
|
|
272
|
+
Prefer `knowledge add` for PRD digestion. It stores small atomic entries such as rules, workflows, permissions, terms, decisions, conventions, and pitfalls with `source_paths` pointing back to a project file, external reference, or `ingest://...` provenance record. Use `ingest record` when PRD, OpenAPI, or UI package material is temporary but the distilled knowledge needs a lightweight source proof. Use `knowledge draft` to turn an ingest record into a reviewed `knowledge add` scaffold with placeholders for the atomic fact, coverage, verification, scope, and tags; do not add the scaffold unchanged. When existing cards already point at the same ingest record, produced card IDs, or source file, draft output includes `knowledge update` candidates so agents can merge before adding duplicates. Use `knowledge update` when a requirement changes so existing cards are merged instead of duplicated. `knowledge index` writes `.frontend-harness/knowledge/index.json`, a deterministic manifest grouped by PRD source, card id, scope, and tag. `knowledge coverage` verifies active PRD semantics remain traceable to source documents or ingest provenance. `knowledge promote` remains available for authored Markdown cards, but raw PRD prose should stay in source documents or temporary ingest inputs instead of being copied into knowledge.
|
|
266
273
|
|
|
267
274
|
## Runtime Boundary
|
|
268
275
|
|
|
@@ -272,7 +279,7 @@ The boundary is strict:
|
|
|
272
279
|
- `frontend-harness` owns policy.
|
|
273
280
|
- The project owns durable state and knowledge.
|
|
274
281
|
|
|
275
|
-
Project skills under `.frontend-harness/skills/` are policy guidance and provenance for planning. They are intentionally separate from Codex or Claude runtime skills installed in the developer environment.
|
|
282
|
+
Project skills under `.frontend-harness/skills/` are policy guidance and provenance for planning. They are intentionally separate from Codex or Claude runtime skills installed in the developer environment. For simple tasks, they should be enough on their own; the harness should not force a full stateful loop when direct agent conversation plus local verification is cheaper.
|
|
276
283
|
|
|
277
284
|
That means `frontend-harness` should stay small and focused. Its job is to make frontend work repeatable, not to become a second runtime.
|
|
278
285
|
|