@tea-agent/loop-agent 0.21.0 → 0.22.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/bin/agent-worker.js +0 -0
  3. package/dist/adapters/loop-agent.js +52 -0
  4. package/dist/commands/init.js +97 -0
  5. package/dist/executors/dag-pi-executor.js +2 -0
  6. package/dist/executors/shell-executor.js +162 -19
  7. package/dist/shared/openspec-spec.js +49 -0
  8. package/dist/worker/observability/read-model.js +21 -1
  9. package/dist/worker/observe/spec-evidence.js +12 -15
  10. package/dist/worker/observe/static/dag-helpers.js +22 -0
  11. package/dist/worker/observe/static/views/dag.js +5 -0
  12. package/dist/workflows/dag/backend-test-markdown-workflow.js +37 -0
  13. package/dist/workflows/dag/frontend-implementation-contract.js +141 -32
  14. package/dist/workflows/dag/frontend-lint-baseline.js +471 -0
  15. package/dist/workflows/dag/frontend-prewrite-gate.js +79 -16
  16. package/dist/workflows/dag/frontend-project-capability.js +11 -8
  17. package/dist/workflows/dag/frontend-repair.js +6 -4
  18. package/dist/workflows/dag/frontend-review-context.js +67 -0
  19. package/dist/workflows/dag/frontend-test-case-quality.js +105 -0
  20. package/dist/workflows/dag/frontend-test-result-contract.js +71 -66
  21. package/dist/workflows/dag/frontend-verification-trace.js +31 -1
  22. package/dist/workflows/dag/frontend-worktree-diff.js +81 -6
  23. package/dist/workflows/dag/init-hybrid.js +344 -64
  24. package/dist/workflows/dag/types.js +62 -1
  25. package/docs/templates/agent-dag.schema.json +15 -5
  26. package/docs/templates/backend-test-dag.json +1 -1
  27. package/docs/templates/frontend-implementation-contract.schema.json +4 -3
  28. package/docs/templates/frontend-test-case-checklist.md +6 -2
  29. package/docs/templates/frontend-test-dag.json +2 -2
  30. package/package.json +1 -1
  31. package/skills/frontend-design-review/SKILL.md +12 -10
  32. package/skills/frontend-design-review/references/review-checklist.md +4 -4
  33. package/skills/frontend-implementation/SKILL.md +2 -2
  34. package/skills/frontend-implementation/references/code-standards.md +4 -3
  35. package/skills/frontend-implementation/references/design-spec.md +19 -14
  36. package/skills/frontend-implementation/references/node-contracts.md +2 -2
  37. package/skills/frontend-review/SKILL.md +15 -28
  38. package/skills/frontend-review/references/review-findings.md +16 -18
  39. package/skills/frontend-verification/SKILL.md +16 -13
  40. package/skills/frontend-verification/references/verification-checklist.md +18 -30
@@ -17,18 +17,22 @@ verdict/findings, and required browser, visual, manual, or knowledge evidence.
17
17
 
18
18
  ## Evidence Rules
19
19
 
20
- - Static evidence covers type/lint/build/schema; behavior evidence must exercise the flow.
20
+ - Static evidence covers type/build/schema; behavior evidence must exercise the flow.
21
+ Lint has its own assessment status: `passed`, `baseline-debt`, `failed`, or
22
+ `unavailable`.
21
23
  - Shell exit status is authoritative. Classify as `passed`, `failed`, `not-run`,
22
24
  `blocked`, or `unavailable`; only passed satisfies a required check.
23
25
  - Never use static success as behavior proof, or tests as visual/browser proof they did not exercise.
24
26
  - Mock-backed behavior proves frontend rendering and state transitions only. It never
25
27
  proves backend readiness, transport compatibility, or real API integration.
26
28
  - Unavailable commands remain gaps.
27
- - Resolve design evidence from two parallel sources: query the execution environment's
28
- knowledge base connector when available; regardless of result, also read
29
- `<repoRoot>/openspec/**` for index and task-relevant specification content.
30
- The connector format remains TODO; never invent it. Applied `openspec` rules
31
- from successful reads are available project evidence.
29
+ - `baseline-debt` is not lint passed. It requires
30
+ `frontend-lint-assessment-v1` proving only pre-writer diagnostics on unchanged
31
+ files. Report debt count, changed files, and raw evidence. Typecheck/build/test do
32
+ not support debt.
33
+ - Resolve design evidence from parallel sources: query the available knowledge
34
+ connector and always read task-relevant `<repoRoot>/openspec/schemas/`,
35
+ `<repoRoot>/openspec/project-specs/`, and `<repoRoot>/ai_workspace/`. Connector format is TODO; never invent it.
32
36
  - Separate Mock service/handler checks from page consumption and record the
33
37
  dev/test-only boundary; handler tests alone do not prove page use.
34
38
 
@@ -40,18 +44,17 @@ only proven changes.
40
44
  Return Markdown headings:
41
45
 
42
46
  - `Changes`: changed behavior and areas.
43
- - `Mock Decision`, `Mock Files`, `Mock Verification`, `Production Boundary`: status is `passed`, `failed`, `not-required`, `blocked`, or `unavailable`.
47
+ - `Mock Decision`, `Mock Files`, `Mock Verification`, `Production Boundary`.
44
48
  - `Verification Evidence`: table of check, command/source, status, and artifact/result.
49
+ Keep lint `baseline-debt` verbatim rather than converting it to `passed`.
45
50
  - `Review Result`: exact review verdict and findings.
46
51
  - `Known Risks`: missing optional checks and environment caveats.
47
52
  - `Follow-up`: concrete work or `None`.
48
53
 
49
- When the backend remains unavailable but required mock-backed checks pass, state
50
- `Frontend status: mock-validated` and `Real integration: pending`. When default
51
- `auto` skipped Mock and no real API evidence passed, state
52
- `Frontend status: locally-validated` and `Real integration: pending`. Use a completed
53
- `<task-id>-real-api-integration-verify` task before changing the latter to complete;
54
- the follow-up is explicit, not auto-created or auto-executed.
54
+ With only Mock evidence, state `Frontend status: mock-validated`; when default `auto`
55
+ skipped Mock without real API evidence, state `Frontend status: locally-validated`.
56
+ Both require `Real integration: pending` and explicit
57
+ `<task-id>-real-api-integration-verify` follow-up; it is not auto-created/executed.
55
58
 
56
59
  Do not edit files. Do not claim complete when review is not pass or a required check
57
60
  is failed, not-run, blocked, unavailable, stale, or contradicted.
@@ -3,19 +3,26 @@
3
3
  ## Static And Behavior Evidence
4
4
 
5
5
  - Required type/compile, lint/format, build, schema/client, browser/e2e/manual checks ran.
6
+ - Lint is recorded as `passed | baseline-debt | failed | unavailable`.
7
+ `baseline-debt` cites `frontend-lint-baseline-v1` and
8
+ `frontend-lint-assessment-v1`, writer changed files, tolerated diagnostic count,
9
+ command identity, and raw output hashes; it is never labeled passed.
10
+ - Every remaining lint diagnostic is on an unchanged file and matches the
11
+ writer-preceding baseline. Changed-file diagnostics, new unmatched diagnostics,
12
+ command drift, timeout, worktree mutation, or unparseable output fail closed.
13
+ - Typecheck, build, and test are fully passed; none accepts baseline debt.
6
14
  - Generated output was authorized; tests cover changed logic, flows, and regressions.
7
- - Fixed DAG entrypoints prove selected-strategy behavior and applicable loading/empty/error/success/disabled/permission/retry/boundary states.
15
+ - Fixed entrypoints prove selected-strategy behavior and applicable UI states.
8
16
  - Mock-specific checks cover service/handler/schema/fixtures; behavior evidence separately proves page consumption.
9
17
  - Mock activation is explicit/non-production; a default-real-path build with Mock off proves the real request remains default.
10
- - `not-needed` has real/no-remote evidence, or default-auto skipped-Mock rationale with Real Integration Gap preserved when no project Mock capability exists.
18
+ - `not-needed` has real/no-remote evidence or a default-auto skipped-Mock rationale.
11
19
  - Mock-backed evidence is frontend-only and never satisfies real API integration.
12
20
 
13
21
  ## Design And Component Evidence
14
22
 
15
- - Claims cite two parallel sources: knowledge-base retrieval and
16
- `<repoRoot>/openspec/**`.
17
- - Evidence records query/source/time for knowledge base plus openspec search terms, paths, headings, and applied rules for both.
18
- - Relevant `openspec/` matches satisfy source availability; missing both sources blocks explicit compliance or required design decisions.
23
+ - Claims cite knowledge-base, OpenSpec, and `<repoRoot>/ai_workspace/` sources.
24
+ - Evidence records query/source/time, local-spec terms, paths, headings, and rules.
25
+ - OpenSpec or `ai_workspace/` matches satisfy source availability; none blocks required design decisions.
19
26
 
20
27
  ## Status
21
28
 
@@ -25,7 +32,8 @@
25
32
  - `blocked`: a prerequisite prevented execution.
26
33
  - `unavailable`: tool, environment, connector, or source was absent.
27
34
 
28
- Only passed satisfies a required check. Other optional statuses remain disclosed risks.
35
+ Only passed satisfies a required check. For lint alone, evidence-backed
36
+ `baseline-debt` may continue as explicit debt; it replaces no other check.
29
37
 
30
38
  ## Closeout Checks
31
39
 
@@ -35,26 +43,6 @@ Only passed satisfies a required check. Other optional statuses remain disclosed
35
43
  - If only Mock evidence exists, report `Frontend status: mock-validated` and `Real integration: pending`, with actual API verification follow-up.
36
44
  - If default `auto` skipped Mock and no real API evidence exists, report `Frontend status: locally-validated` and `Real integration: pending`.
37
45
 
38
- ```markdown
39
- ## Changes
40
- - ...
41
-
42
- ## Verification Evidence
43
- | Check | Command or source | Status | Evidence |
44
- |---|---|---|---|
45
- | ... | ... | passed | ... |
46
-
47
- ## Mock Decision / Mock Files / Mock Verification / Production Boundary
48
- - Status: `passed | failed | not-required | blocked | unavailable`
49
-
50
- ## Review Result
51
- - Verdict: `VERDICT: pass`
52
-
53
- ## Known Risks
54
- - ...
55
-
56
- ## Follow-up
57
- - None.
58
- ```
59
-
60
- If review is not pass or a required check is not passed, describe the task as incomplete and list concrete follow-up.
46
+ Output uses Changes, Verification Evidence, Mock Decision/Files/Verification,
47
+ Production Boundary, Review Result, Known Risks, and Follow-up headings. If review is
48
+ not pass or a required check fails, describe the task as incomplete with follow-up.