@tea-agent/loop-agent 0.12.0 → 0.13.0-alpha.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/CHANGELOG.md +50 -2
- package/README.md +30 -2
- package/dist/application/dag/generate-task-dag.js +30 -0
- package/dist/cli/command-definitions.js +10 -3
- package/dist/commands/knowledge.js +129 -31
- package/dist/governance/manifest-types.js +3 -0
- package/dist/task/config-types.js +5 -1
- package/dist/worker/cli.js +96 -1
- package/dist/worker/delivery/package.js +3 -3
- package/dist/worker/feature/decision-loader.js +37 -6
- package/dist/worker/feature/next-action.js +10 -2
- package/dist/worker/feature/ready-plan-projection.js +81 -0
- package/dist/worker/feature/reducer.js +2 -1
- package/dist/worker/feature/review.js +19 -2
- package/dist/worker/feature/run.js +27 -2
- package/dist/worker/follow-up/approve.js +5 -2
- package/dist/worker/follow-up/factory.js +1 -1
- package/dist/worker/observability/read-model.js +246 -41
- package/dist/worker/observe/routes.js +158 -15
- package/dist/worker/observe/spec-evidence.js +281 -0
- package/dist/worker/observe/static/api.js +19 -0
- package/dist/worker/observe/static/app.js +2 -2
- package/dist/worker/observe/static/relations.js +17 -12
- package/dist/worker/observe/static/router.js +8 -0
- package/dist/worker/observe/static/styles.css +12 -0
- package/dist/worker/observe/static/views/batch.js +3 -2
- package/dist/worker/observe/static/views/dag-inspector.js +123 -4
- package/dist/worker/observe/static/views/dashboard.js +8 -5
- package/dist/worker/observe/static/views/feature.js +43 -4
- package/dist/worker/observe/static/views/pool.js +5 -2
- package/dist/worker/observe/static/views/run.js +1 -1
- package/dist/worker/observe/static/views/task.js +69 -15
- package/dist/worker/pool/doctor.js +165 -0
- package/dist/worker/pool/migrate-state.js +303 -0
- package/dist/worker/pool/run-store.js +205 -17
- package/dist/worker/pool/types.js +17 -1
- package/dist/worker/pool/validation.js +100 -15
- package/dist/worker/report/morning-report.js +12 -2
- package/dist/worker/runner/run-ready.js +41 -26
- package/dist/worker/task-graph/ready-planner.js +136 -0
- package/dist/workflows/dag/convergence/controller.js +16 -8
- package/dist/workflows/dag/failure-routing.js +12 -1
- package/dist/workflows/dag/init-hybrid.js +837 -8
- package/dist/workflows/dag/types.js +1 -0
- package/docs/README.md +1 -1
- package/docs/agent-dag-recovery-playbook.md +9 -0
- package/docs/architecture/evolution.md +4 -3
- package/docs/architecture/facts-and-state.md +14 -1
- package/docs/architecture/worker-and-feature.md +6 -2
- package/docs/decisions/README.md +3 -0
- package/docs/design/README.md +8 -0
- package/docs/exec-plans/active/README.md +2 -0
- package/docs/exec-plans/completed/README.md +3 -2
- package/docs/feature-workflow.md +80 -2
- package/docs/loop-agent-harness.md +15 -4
- package/docs/progress/README.md +4 -0
- package/docs/reports/README.md +6 -0
- package/docs/templates/backend-test-dag.json +12 -0
- package/docs/templates/knowledge-graph-bootstrap-dag.json +118 -0
- package/docs/templates/knowledge-sync-dag.json +177 -0
- package/docs/templates/knowledge-sync-draft.schema.json +71 -0
- package/docs/verification-matrix.md +2 -1
- package/package.json +8 -2
- package/scripts/kb-bootstrap-init-skeleton.sh +239 -0
- package/scripts/kb-graph-incremental-prepare.mjs +372 -0
- package/scripts/kb-graph-incremental-prepare.sh +5 -0
- package/scripts/kb-graph-materialize.mjs +105 -0
- package/scripts/kb-graph-materialize.sh +4 -0
- package/scripts/kb-graph-promote.mjs +153 -0
- package/scripts/kb-graph-promote.sh +4 -0
- package/scripts/kb-query.mjs +554 -0
- package/scripts/kb-query.sh +5 -0
- package/skills/agent-worker/SKILL.md +3 -1
- package/skills/agent-worker/references/agent-worker-operator.md +18 -1
- package/skills/frontend-design-review/SKILL.md +26 -24
- package/skills/frontend-implementation/SKILL.md +29 -26
- package/skills/frontend-implementation/references/node-contracts.md +50 -19
- package/skills/frontend-review/SKILL.md +1 -1
- package/skills/loop-agent/references/command-reference.md +1 -0
|
@@ -3,9 +3,9 @@ name: frontend-implementation
|
|
|
3
3
|
description: >-
|
|
4
4
|
Use for frontend contract, scout, plan, and implementation DAG nodes.
|
|
5
5
|
references:
|
|
6
|
-
- path: references/node-contracts.md
|
|
7
|
-
required: true
|
|
8
|
-
maxChars:
|
|
6
|
+
- path: references/node-contracts.md
|
|
7
|
+
required: true
|
|
8
|
+
maxChars: 3200
|
|
9
9
|
- path: references/design-spec.md
|
|
10
10
|
required: true
|
|
11
11
|
maxChars: 3000
|
|
@@ -16,36 +16,39 @@ references:
|
|
|
16
16
|
|
|
17
17
|
# Frontend Implementation
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
`frontend-implement-pi`. Read
|
|
19
|
+
For `frontend-contract-pi`, `frontend-scout-pi`, `frontend-plan-pi`, and
|
|
20
|
+
`frontend-implement-pi`. Read all required references first.
|
|
21
21
|
|
|
22
22
|
## Source And Evidence Rules
|
|
23
23
|
|
|
24
|
-
Use task
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
Use task sources/references, constraints, then `task.json`. Resolve design rules in
|
|
25
|
+
`design-spec.md` order: query the knowledge base; if unavailable, failed, or empty,
|
|
26
|
+
search `<repoRoot>/openSpec/**`; only then use other repository evidence.
|
|
27
|
+
|
|
28
|
+
- Cite paths/symbols or tight lines; label assumptions, questions, and missing evidence.
|
|
29
|
+
- Never invent conventions, APIs, tokens, commands, or knowledge-base results.
|
|
30
|
+
- Record `knowledge-base`, `openSpec fallback`, `repository fallback`, or `unavailable`, plus evidence/conflicts.
|
|
31
|
+
|
|
32
|
+
### Observable Spec Retrieval
|
|
29
33
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
+
Scout/planner nodes must `grep`/`find` relevant `openSpec/**` and skill references,
|
|
35
|
+
then explicitly `read` every consulted spec (`SKILL.md`, `design-spec.md`,
|
|
36
|
+
`code-standards.md`, etc.). Observe derives evidence from session tool events: only
|
|
37
|
+
successful paired `read` calls count as “已读取规范文件”; summaries do not. If the
|
|
38
|
+
knowledge base is unavailable, record `openSpec/**` search hits before repo fallback.
|
|
34
39
|
|
|
35
40
|
## Implementation Discipline
|
|
36
41
|
|
|
37
|
-
-
|
|
38
|
-
- Reuse confirmed components, tokens, helpers, APIs, mocks, schemas, and
|
|
39
|
-
-
|
|
40
|
-
- Cover
|
|
41
|
-
- Keep state
|
|
42
|
-
-
|
|
43
|
-
- Never relax lint/type/test/build configuration or write unauthorized generated output.
|
|
42
|
+
- Project specs and repo-local skills are authoritative within scope.
|
|
43
|
+
- Reuse confirmed components, tokens, helpers, APIs, mocks, schemas, and tests.
|
|
44
|
+
- Add dependencies only when task and approved plan allow them.
|
|
45
|
+
- Cover success/error/loading/empty/disabled/permission/boundary states; justify N/A.
|
|
46
|
+
- Keep state/validation testable. Writers stay in `writeSet`, preserve unrelated behavior, and update tests.
|
|
47
|
+
- Never relax lint/type/test/build config or write unauthorized generated output.
|
|
44
48
|
|
|
45
49
|
## Output And Failure Rules
|
|
46
50
|
|
|
47
|
-
- Follow
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
- Implementation may report attempted checks, but completion requires fresh downstream shell evidence.
|
|
51
|
+
- Follow `node-contracts.md` headings exactly. Read-only nodes return Markdown and never edit files.
|
|
52
|
+
- Missing input blocks work when proceeding would guess behavior, compliance, write bounds, or verification.
|
|
53
|
+
- Preserve protocol tokens, commands, paths, identifiers, and output language.
|
|
54
|
+
- Attempted checks may be reported; completion needs fresh downstream shell evidence.
|
|
@@ -1,32 +1,63 @@
|
|
|
1
1
|
# Frontend Node Contracts
|
|
2
2
|
|
|
3
|
+
Pre-implementation nodes are read-only. Preserve IDs, protocol tokens, source
|
|
4
|
+
labels, language, and named output headings.
|
|
5
|
+
|
|
3
6
|
## `frontend-contract-pi`
|
|
4
7
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
|
|
8
|
+
Read task sources, constraints, config, and references. Define scope, non-goals,
|
|
9
|
+
routes/components, runtime, flows, criteria, states, risks, and verification. Never
|
|
10
|
+
turn a guess into a requirement. Output: `Scope`,
|
|
11
|
+
`Non-goals`, `Acceptance Criteria`, `UI States`, `Target Runtime Environment`,
|
|
12
|
+
`Risks`, `Verification Expectations`.
|
|
10
13
|
|
|
11
14
|
## `frontend-scout-pi`
|
|
12
15
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
Inspect routes, components, styles/tokens, state/data, APIs/mocks, scripts, tests,
|
|
17
|
+
and assets. Separate facts, inferences, and gaps. Query knowledge-base;
|
|
18
|
+
if absent/failed/unmatched, search and read `<repoRoot>/openSpec/**` before repo
|
|
19
|
+
conventions. Record source, query/terms, and paths. Output: `Frontend Stack`,
|
|
20
|
+
`Routes`, `Components`, `Styling System`, `Existing Design Conventions`,
|
|
21
|
+
`State / Data Flow`, `Test Entry Points`, `Reuse Opportunities`, `Risks`.
|
|
18
22
|
|
|
19
23
|
## `frontend-plan-pi`
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
Map each criterion to implementation and verification. Name in-bound files; define
|
|
26
|
+
states, reuse, interactions, dependencies, and commands. Apply `openSpec/` rules
|
|
27
|
+
when knowledge-base fails; ask only for material conflicts. Output: `Implementation Steps`, `Target
|
|
28
|
+
Files`, `UI State Handling`, `Styling / Component Strategy`, `Interaction Notes`,
|
|
29
|
+
`Dependency Policy`, `Verification Plan`, `Residual Risks`.
|
|
30
|
+
|
|
31
|
+
## First design protocol gate
|
|
32
|
+
|
|
33
|
+
`frontend-first-design-gate-shell` reads `frontend-design-gate-pi`'s first
|
|
34
|
+
non-empty line. It accepts only `VERDICT: pass` or `VERDICT: request-revision` and
|
|
35
|
+
blocks malformed output. It never authorizes writes; request-revision enters plan
|
|
36
|
+
revision. Line mode: `first-verdict-line`.
|
|
37
|
+
|
|
38
|
+
## `frontend-plan-revision-pi`
|
|
39
|
+
|
|
40
|
+
Consume the original plan and first review findings. On first-gate pass, output
|
|
41
|
+
`PASS_NO_REVISION_NEEDED`; on request-revision, address every Required Plan
|
|
42
|
+
Correction in a complete plan with the plan headings above. Always `read-only`;
|
|
43
|
+
never edit code, docs, or artifacts.
|
|
44
|
+
|
|
45
|
+
## Final design review and gate
|
|
46
|
+
|
|
47
|
+
`frontend-final-design-review-pi` rechecks the original plan for
|
|
48
|
+
`PASS_NO_REVISION_NEEDED`, otherwise verifies every correction and rejects any
|
|
49
|
+
remaining/new gap. Its first non-empty line is exactly `VERDICT: pass` or
|
|
50
|
+
`VERDICT: request-revision`.
|
|
51
|
+
|
|
52
|
+
`frontend-final-design-gate-shell` reads that verdict and accepts only
|
|
53
|
+
`VERDICT: pass`. It is the sole write authorization. Failure routes to
|
|
54
|
+
`ContractMismatch` / `frontend-plan-revision-and-rerun`, never `ProductBug` /
|
|
55
|
+
`dev-fix`. Line mode: `first-verdict-line`.
|
|
26
56
|
|
|
27
57
|
## `frontend-implement-pi`
|
|
28
58
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
59
|
+
Depends directly on final gate, revision plan, and final review. After pass, re-read
|
|
60
|
+
current files and implement only the approved plan inside `writeSet`; stop on
|
|
61
|
+
forbidden paths or blocking guesses. Reuse primitives and update tests. Output:
|
|
62
|
+
`Changed Files`, `Implemented Behavior`, `UI States Covered`, `Styling / Component
|
|
63
|
+
Notes`, `Verification Attempted`, `Residual Risks`.
|
|
@@ -25,7 +25,7 @@ required check, forbidden write, or unmet acceptance criterion forces revision.
|
|
|
25
25
|
- Inspect every changed file against allowed, forbidden, and approved write scope.
|
|
26
26
|
- Map criteria to behavior, applicable UI states, tests, and shell evidence.
|
|
27
27
|
- Review state/data flow, validation, async/error behavior, components/design, responsive behavior, accessibility, dependencies, maintenance, and regression risk when applicable.
|
|
28
|
-
- Component/design claims require traceable knowledge-base evidence or, after connection/query failure or no match, relevant `<repoRoot>/openSpec/**` evidence. The connector format is TODO; never claim a query or fallback search without evidence.
|
|
28
|
+
- Component/design claims require traceable knowledge-base evidence or, after connection/query failure or no match, relevant `<repoRoot>/openSpec/**` evidence. The connector format is TODO; never claim a query or fallback search without evidence. Execute explicit `grep`/`find` to locate spec files and `read` to load them before referencing their rules. Only successful `read` tool calls are observable as "已读取规范文件" in the spec-evidence inspector.
|
|
29
29
|
- Treat shell exit status as authoritative. Do not edit files.
|
|
30
30
|
|
|
31
31
|
## Evidence And Output
|
|
@@ -392,6 +392,7 @@ agent-worker report metrics --repo <repo-root> --month <YYYY-MM> [--json]
|
|
|
392
392
|
agent-worker task draft-followup <task-id> --worker-run-id <id> --feature-dir <feature-dir> --repo <repo-root> [--json]
|
|
393
393
|
agent-worker feature approve-followup --feature-dir <feature-dir> --followup-id <id> --repo <repo-root> --owner <owner> [--dry-run] [--json]
|
|
394
394
|
agent-worker task retry <task-id> --repo <repo-root> [--reason "<已修复的原因>"]
|
|
395
|
+
agent-worker batch plan-ready --feature-dir <feature-dir> --repo <repo-root> [--limit <count>] [--json]
|
|
395
396
|
agent-worker batch run-ready \
|
|
396
397
|
--feature-dir <feature-dir> \ # 含 tasks/task-graph.yaml
|
|
397
398
|
--repo <repo-root> \ # 目标 repo
|