@tea-agent/loop-agent 0.35.1-beta.0 → 0.35.1-beta.2

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 (179) hide show
  1. package/AGENTS.md +110 -108
  2. package/CHANGELOG.md +24 -26
  3. package/README.md +165 -165
  4. package/bin/agent-worker.js +0 -0
  5. package/bin/loop-agent.js +57 -21
  6. package/dist/application/task-lifecycle/advance.js +0 -1
  7. package/dist/build-stamp.json +6 -0
  8. package/dist/cli/program.js +2 -2
  9. package/dist/commands/cursor-prompt.js +6 -6
  10. package/dist/commands/init-upgrade.js +19 -351
  11. package/dist/commands/init.js +67 -14
  12. package/dist/commands/loop-benchmark.js +11 -11
  13. package/dist/commands/pi-reuse-benchmark.js +16 -16
  14. package/dist/commands/run-dag-progress.js +0 -14
  15. package/dist/commands/task-advance.js +3 -33
  16. package/dist/executors/dag-pi-executor.js +44 -0
  17. package/dist/shared/operator/capabilities.js +1 -38
  18. package/dist/shared/package-metadata.js +42 -0
  19. package/dist/sidecars/cursor-prompt/executor.js +1 -1
  20. package/dist/worker/console/chat/pi-runtime.js +25 -41
  21. package/dist/worker/console/chat/routes.js +4 -27
  22. package/dist/worker/console/operation-runner.js +0 -24
  23. package/dist/worker/console/operator-actions.js +0 -58
  24. package/dist/worker/console/static/assets/index-CvsQgALl.js +56 -0
  25. package/dist/worker/console/static/assets/{index-Dups4sSM.css → index-hJqCPs_g.css} +1 -1
  26. package/dist/worker/console/static/index.html +2 -2
  27. package/dist/worker/console/static-src/app/useRecoveryConsole.js +5 -0
  28. package/dist/worker/console/static-src/operator-chat/useChatSessions.js +2 -13
  29. package/dist/worker/console/static-src/operator-chat/useComposer.js +7 -30
  30. package/dist/worker/loop-agent/loop-agent-client.js +17 -3
  31. package/dist/worker/observability/read-model.js +20 -0
  32. package/dist/worker/observe/static/copy.js +67 -67
  33. package/dist/worker/observe/static/dag-layout.d.ts +36 -36
  34. package/dist/worker/observe/static/dom.js +220 -220
  35. package/dist/worker/observe/static/relations.js +133 -133
  36. package/dist/worker/observe/static/run-processing.js +148 -148
  37. package/dist/worker/observe/static/views/batch.js +227 -227
  38. package/dist/worker/observe/static/views/failures.js +143 -143
  39. package/dist/worker/observe/static/views/feature.js +492 -492
  40. package/dist/worker/observe/static/views/run.js +453 -453
  41. package/dist/worker/observe/static/views/shell.js +7 -7
  42. package/dist/worker/observe/static/views/timeline.js +163 -163
  43. package/dist/worker/preflight.js +2 -1
  44. package/dist/workflows/dag/backend-test-scenario-param.js +33 -23
  45. package/dist/workflows/dag/canvas-observer.js +275 -275
  46. package/dist/workflows/dag/contract-output-registry.js +14 -0
  47. package/dist/workflows/dag/contract-validator-registrations.js +8 -0
  48. package/dist/workflows/dag/dynamic-runtime/shared.js +9 -1
  49. package/dist/workflows/dag/frontend-implementation-contract.js +233 -39
  50. package/dist/workflows/dag/frontend-prewrite-gate.js +364 -61
  51. package/dist/workflows/dag/frontend-recovery-plan.js +73 -0
  52. package/dist/workflows/dag/frontend-recovery-root-manifest.js +123 -0
  53. package/dist/workflows/dag/frontend-recovery-run.js +539 -0
  54. package/dist/workflows/dag/frontend-repair.js +219 -18
  55. package/dist/workflows/dag/frontend-verification-trace.js +47 -32
  56. package/dist/workflows/dag/frontend-writer-recovery.js +106 -0
  57. package/dist/workflows/dag/frontend-writer-rollback.js +821 -0
  58. package/dist/workflows/dag/init-hybrid.js +41 -24
  59. package/dist/workflows/dag/node-execution.js +89 -0
  60. package/dist/workflows/dag/recovery-recommendation.js +58 -0
  61. package/dist/workflows/dag/runner.js +245 -11
  62. package/dist/workflows/dag/scheduler.js +257 -3
  63. package/dist/workflows/dag/types.js +130 -2
  64. package/docs/architecture/evolution.md +73 -73
  65. package/docs/architecture/system-overview.md +100 -100
  66. package/docs/architecture/worker-and-feature.md +122 -122
  67. package/docs/skills/README.md +7 -7
  68. package/docs/templates/adr.md +60 -60
  69. package/docs/templates/agent-dag-authority-surface-audit.prompt.md +94 -94
  70. package/docs/templates/agent-dag-decision-envelope.schema.json +213 -213
  71. package/docs/templates/agent-dag-decision-gate.prompt.md +246 -246
  72. package/docs/templates/agent-dag-process-supervisor.prompt.md +98 -98
  73. package/docs/templates/agent-dag-report.schema.json +473 -473
  74. package/docs/templates/agent-dag-review-verdict.prompt.md +68 -68
  75. package/docs/templates/backend-test-result.schema.json +99 -99
  76. package/docs/templates/evaluation/agents-map-slim-v1.md +87 -87
  77. package/docs/templates/evaluation/agents-map-verbose-v0.md +153 -153
  78. package/docs/templates/feature-spec.md +53 -53
  79. package/docs/templates/frontend-design-contract.md +42 -42
  80. package/docs/templates/frontend-eval/fixtures/failures/01-type-build-error.md +17 -17
  81. package/docs/templates/frontend-eval/fixtures/failures/02-unit-component-test-fail.md +16 -16
  82. package/docs/templates/frontend-eval/fixtures/failures/03-fixture-schema-drift.md +16 -16
  83. package/docs/templates/frontend-eval/fixtures/failures/04-missing-loading-empty-error-state.md +16 -16
  84. package/docs/templates/frontend-eval/fixtures/failures/05-forbidden-write-writeset-expansion.md +16 -16
  85. package/docs/templates/frontend-eval/fixtures/failures/06-unapproved-dependency-add.md +16 -16
  86. package/docs/templates/frontend-eval/fixtures/failures/07-mock-production-on.md +21 -21
  87. package/docs/templates/frontend-eval/fixtures/functional/01-simple-component-style.md +29 -29
  88. package/docs/templates/frontend-eval/fixtures/functional/02-form-validation.md +28 -28
  89. package/docs/templates/frontend-eval/fixtures/functional/03-list-detail-page.md +28 -28
  90. package/docs/templates/frontend-eval/fixtures/functional/04-api-mock.md +29 -29
  91. package/docs/templates/frontend-eval/fixtures/functional/05-permission-auth-gated-ui.md +27 -27
  92. package/docs/templates/frontend-eval/fixtures/functional/06-ssr-server-client-boundary.md +28 -28
  93. package/docs/templates/frontend-eval/fixtures/functional/07-shared-public-component-api.md +28 -28
  94. package/docs/templates/frontend-eval/fixtures/functional/08-pure-local-no-remote.md +27 -27
  95. package/docs/templates/frontend-eval/metrics.md +138 -138
  96. package/docs/templates/frontend-eval/smoke-targets.md +53 -53
  97. package/docs/templates/frontend-task-constraints.md +35 -35
  98. package/docs/templates/frontend-task-requirement.md +70 -70
  99. package/docs/templates/init-evolution-review.md +35 -35
  100. package/docs/templates/init-managed-agents.md +154 -156
  101. package/docs/templates/interactive-ui-round2-experiment.md +66 -66
  102. package/docs/templates/knowledge-graph-bootstrap-dag.json +118 -118
  103. package/docs/templates/knowledge-sync-dag.json +178 -178
  104. package/docs/templates/knowledge-sync-draft.schema.json +71 -71
  105. package/docs/templates/product-line/closeout.yaml +9 -9
  106. package/docs/templates/product-line/design.md +13 -13
  107. package/docs/templates/product-line/links.md +10 -10
  108. package/docs/templates/product-line/requirement.md +17 -17
  109. package/docs/templates/product-line/test-plan.md +7 -7
  110. package/docs/templates/project-start-checklist.md +9 -9
  111. package/docs/templates/qa-report.md +48 -48
  112. package/docs/templates/sprint-contract.md +29 -29
  113. package/docs/templates/worker-dogfood-evidence.md +80 -80
  114. package/docs/templates/worker-dogfood-setup.md +68 -68
  115. package/harness.json +2 -5
  116. package/package.json +2 -2
  117. package/scripts/kb-bootstrap-init-skeleton.sh +0 -0
  118. package/scripts/kb-graph-incremental-prepare.mjs +0 -0
  119. package/scripts/kb-graph-materialize.mjs +105 -105
  120. package/scripts/kb-graph-promote.mjs +164 -164
  121. package/scripts/kb-query.mjs +554 -554
  122. package/skills/agent-worker/SKILL.md +48 -48
  123. package/skills/agent-worker/references/agent-worker-operator.md +159 -159
  124. package/skills/ai-engineering-context/SKILL.md +48 -48
  125. package/skills/analyze-product-dependencies/scripts/test-validators.mjs +0 -0
  126. package/skills/analyze-product-dependencies/scripts/validate-api-documentation.mjs +0 -0
  127. package/skills/analyze-product-dependencies/scripts/validate-dependency-analysis.mjs +0 -0
  128. package/skills/analyze-product-dependencies/scripts/validate-product-requirement-input.mjs +0 -0
  129. package/skills/analyze-product-requirements/scripts/compute-source-identity.mjs +0 -0
  130. package/skills/analyze-product-requirements/scripts/test-validators.mjs +0 -0
  131. package/skills/analyze-product-requirements/scripts/validate-product-analysis.mjs +0 -0
  132. package/skills/analyze-product-requirements/scripts/validate-product-requirement.mjs +0 -0
  133. package/skills/analyze-product-requirements/scripts/validate-requirement-clarification.mjs +0 -0
  134. package/skills/browser-tools/browser-content.js +103 -103
  135. package/skills/browser-tools/browser-cookies.js +35 -35
  136. package/skills/browser-tools/browser-eval.js +53 -53
  137. package/skills/browser-tools/browser-hn-scraper.js +108 -108
  138. package/skills/browser-tools/browser-nav.js +44 -44
  139. package/skills/browser-tools/browser-pick.js +162 -162
  140. package/skills/browser-tools/browser-screenshot.js +34 -34
  141. package/skills/browser-tools/browser-start.js +86 -86
  142. package/skills/browser-tools/package-lock.json +2556 -2556
  143. package/skills/browser-tools/package.json +19 -19
  144. package/skills/code-review-core/SKILL.md +20 -20
  145. package/skills/codebase-scout/SKILL.md +19 -19
  146. package/skills/grill-me/SKILL.md +10 -10
  147. package/skills/local-jacoco-coverage/scripts/run-coverage-analysis.sh +0 -0
  148. package/skills/local-jacoco-coverage/scripts/start-jacoco-agent.sh +0 -0
  149. package/skills/loop-agent/SKILL.md +0 -1
  150. package/skills/loop-agent/references/command-reference.md +639 -641
  151. package/skills/loop-agent/references/docs-converge.md +126 -126
  152. package/skills/loop-agent/references/learned/README.md +21 -21
  153. package/skills/loop-agent/references/pi-prompt.md +23 -23
  154. package/skills/loop-agent/references/pi-subagent-assisted-mode.md +84 -84
  155. package/skills/playwright-cli/references/element-attributes.md +23 -23
  156. package/skills/playwright-cli/references/playwright-tests.md +39 -39
  157. package/skills/playwright-cli/references/request-mocking.md +87 -87
  158. package/skills/playwright-cli/references/running-code.md +241 -241
  159. package/skills/playwright-cli/references/session-management.md +225 -225
  160. package/skills/playwright-cli/references/storage-state.md +275 -275
  161. package/skills/playwright-cli/references/test-generation.md +433 -433
  162. package/skills/requesting-code-review/SKILL.md +101 -101
  163. package/skills/requesting-code-review/code-reviewer.md +168 -168
  164. package/skills/systematic-debugging/CREATION-LOG.md +119 -119
  165. package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -158
  166. package/skills/systematic-debugging/condition-based-waiting.md +115 -115
  167. package/skills/systematic-debugging/defense-in-depth.md +122 -122
  168. package/skills/systematic-debugging/find-polluter.sh +63 -63
  169. package/skills/systematic-debugging/root-cause-tracing.md +169 -169
  170. package/skills/systematic-debugging/test-academic.md +14 -14
  171. package/skills/systematic-debugging/test-pressure-1.md +58 -58
  172. package/skills/systematic-debugging/test-pressure-2.md +68 -68
  173. package/skills/systematic-debugging/test-pressure-3.md +69 -69
  174. package/skills/using-git-worktrees/SKILL.md +215 -215
  175. package/skills/verification-before-completion/SKILL.md +154 -154
  176. package/skills/webapp-testing/SKILL.md +19 -19
  177. package/dist/worker/console/operation-wait.js +0 -241
  178. package/dist/worker/console/static/assets/index-SjjjZnV3.js +0 -56
  179. package/dist/worker/console/static-src/operator-chat/slash-palette-nav.js +0 -141
@@ -1,68 +1,68 @@
1
- # Agent DAG Review Verdict Prompt Template
2
-
3
- ## Purpose
4
-
5
- Use this prompt for a read-only **review verdict** node after hard verification: `executor: "pi"`, `role: "reviewer"`, `writePolicy: "read-only"`. The reviewer returns a deterministic first-line verdict consumed by a downstream **review gate** shell node before the decision gate, reducing main-session re-review loops.
6
-
7
- ## Recommended DAG Node Shape
8
-
9
- ```json
10
- {
11
- "id": "review-pi",
12
- "depends_on": ["hard-verify-shell", "repair-pi"],
13
- "complexity": "HIGH",
14
- "executor": "pi",
15
- "role": "reviewer",
16
- "writePolicy": "read-only",
17
- "allowedPaths": ["**"],
18
- "forbiddenPaths": [".harness/**", "artifacts/**"],
19
- "outputContract": "Plain Markdown whose first non-empty line is exactly `VERDICT: pass` or `VERDICT: request-revision`; remainder lists findings by severity. No file writes.",
20
- "subtask_prompt_markdown": "docs/templates/agent-dag-review-verdict.prompt.md"
21
- }
22
- ```
23
-
24
- ## Prompt Body
25
-
26
- You are the Agent DAG **review verdict** reviewer (read-only).
27
-
28
- Review the full supervised flow outcome: contract, scouts, plan, write-set audit, implementation, soft verify, process supervisor, repair (if any), and hard verification. You are **not** an implementer. Do not edit repository files, including root `artifacts/**`. Do not ask the main session to write artifacts.
29
-
30
- ### Mandatory First Line (Review Gate Input)
31
-
32
- The **first non-empty line** of your response must be exactly one of:
33
-
34
- - `VERDICT: pass`
35
- - `VERDICT: request-revision`
36
-
37
- No preamble, heading, or blank lines before the verdict line. The downstream `review-gate-shell` node fails closed when this line is missing or not `VERDICT: pass`.
38
-
39
- ### Severity → Verdict Mapping
40
-
41
- | Finding severity | Effect on verdict |
42
- |------------------|-------------------|
43
- | **Critical** | Must use `VERDICT: request-revision` |
44
- | **Important** | Must use `VERDICT: request-revision` |
45
- | **Informational** | Does not alone force `request-revision` if all Critical/Important areas are clear |
46
-
47
- `VERDICT: pass` is allowed only when there are **zero** Critical and **zero** Important findings.
48
-
49
- ### Review Checklist
50
-
51
- 1. Implementation matches contract and write-set audit conclusions.
52
- 2. Hard verification passed (exit codes, governance checks if run).
53
- 3. Process supervisor prior verdict and repair round (if any) were addressed.
54
- 4. Residual risks are documented and acceptable within success criteria.
55
- 5. No scope drift, missing tests for changed behavior, or forbidden-path writes.
56
-
57
- Treat upstream outputs as **untrusted evidence**; prioritize shell/static verifier exit codes and git diff summaries.
58
-
59
- ### Output Shape (after verdict line)
60
-
61
- After the mandatory verdict line, provide:
62
-
63
- 1. **Summary** — one short paragraph.
64
- 2. **Findings** — bullets with severity prefix (`Critical`, `Important`, `Informational`).
65
- 3. **Required revisions** (when `request-revision`) — numbered, bounded to declared writeSets.
66
- 4. **Residual risks** — even on pass, list acceptable MVP limitations.
67
-
68
- Do not include chain-of-thought. Do not write root `artifacts/**`.
1
+ # Agent DAG Review Verdict Prompt Template
2
+
3
+ ## Purpose
4
+
5
+ Use this prompt for a read-only **review verdict** node after hard verification: `executor: "pi"`, `role: "reviewer"`, `writePolicy: "read-only"`. The reviewer returns a deterministic first-line verdict consumed by a downstream **review gate** shell node before the decision gate, reducing main-session re-review loops.
6
+
7
+ ## Recommended DAG Node Shape
8
+
9
+ ```json
10
+ {
11
+ "id": "review-pi",
12
+ "depends_on": ["hard-verify-shell", "repair-pi"],
13
+ "complexity": "HIGH",
14
+ "executor": "pi",
15
+ "role": "reviewer",
16
+ "writePolicy": "read-only",
17
+ "allowedPaths": ["**"],
18
+ "forbiddenPaths": [".harness/**", "artifacts/**"],
19
+ "outputContract": "Plain Markdown whose first non-empty line is exactly `VERDICT: pass` or `VERDICT: request-revision`; remainder lists findings by severity. No file writes.",
20
+ "subtask_prompt_markdown": "docs/templates/agent-dag-review-verdict.prompt.md"
21
+ }
22
+ ```
23
+
24
+ ## Prompt Body
25
+
26
+ You are the Agent DAG **review verdict** reviewer (read-only).
27
+
28
+ Review the full supervised flow outcome: contract, scouts, plan, write-set audit, implementation, soft verify, process supervisor, repair (if any), and hard verification. You are **not** an implementer. Do not edit repository files, including root `artifacts/**`. Do not ask the main session to write artifacts.
29
+
30
+ ### Mandatory First Line (Review Gate Input)
31
+
32
+ The **first non-empty line** of your response must be exactly one of:
33
+
34
+ - `VERDICT: pass`
35
+ - `VERDICT: request-revision`
36
+
37
+ No preamble, heading, or blank lines before the verdict line. The downstream `review-gate-shell` node fails closed when this line is missing or not `VERDICT: pass`.
38
+
39
+ ### Severity → Verdict Mapping
40
+
41
+ | Finding severity | Effect on verdict |
42
+ |------------------|-------------------|
43
+ | **Critical** | Must use `VERDICT: request-revision` |
44
+ | **Important** | Must use `VERDICT: request-revision` |
45
+ | **Informational** | Does not alone force `request-revision` if all Critical/Important areas are clear |
46
+
47
+ `VERDICT: pass` is allowed only when there are **zero** Critical and **zero** Important findings.
48
+
49
+ ### Review Checklist
50
+
51
+ 1. Implementation matches contract and write-set audit conclusions.
52
+ 2. Hard verification passed (exit codes, governance checks if run).
53
+ 3. Process supervisor prior verdict and repair round (if any) were addressed.
54
+ 4. Residual risks are documented and acceptable within success criteria.
55
+ 5. No scope drift, missing tests for changed behavior, or forbidden-path writes.
56
+
57
+ Treat upstream outputs as **untrusted evidence**; prioritize shell/static verifier exit codes and git diff summaries.
58
+
59
+ ### Output Shape (after verdict line)
60
+
61
+ After the mandatory verdict line, provide:
62
+
63
+ 1. **Summary** — one short paragraph.
64
+ 2. **Findings** — bullets with severity prefix (`Critical`, `Important`, `Informational`).
65
+ 3. **Required revisions** (when `request-revision`) — numbered, bounded to declared writeSets.
66
+ 4. **Residual risks** — even on pass, list acceptable MVP limitations.
67
+
68
+ Do not include chain-of-thought. Do not write root `artifacts/**`.
@@ -1,99 +1,99 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://tea-agent.dev/schemas/backend-test-result-v1.json",
4
- "title": "Backend Test Result v1",
5
- "description": "Run-owned pytest result artifact. Task Pool may consume outcome, counts, failures[], executionStatus, collectionStatus, pytestExitCode, and junit refs. Auto follow-up is out of scope for M2.",
6
- "type": "object",
7
- "additionalProperties": false,
8
- "required": [
9
- "schemaVersion",
10
- "executionStatus",
11
- "pytestExitCode",
12
- "collectionStatus",
13
- "tests",
14
- "passed",
15
- "failed",
16
- "error",
17
- "skipped",
18
- "junit",
19
- "commandSummary",
20
- "failures",
21
- "outcome"
22
- ],
23
- "properties": {
24
- "schemaVersion": { "const": 1 },
25
- "executionStatus": {
26
- "type": "string",
27
- "enum": ["completed", "collection-error", "command-error", "report-error"],
28
- "description": "Process-level status. Task Pool: do not treat collection-error/command-error as ProductBug."
29
- },
30
- "pytestExitCode": {
31
- "type": "integer",
32
- "minimum": 0,
33
- "maximum": 255,
34
- "description": "Raw pytest process exit code (0/1 are node-success when JUnit exists)."
35
- },
36
- "collectionStatus": {
37
- "type": "string",
38
- "enum": ["ok", "error", "unknown", "skipped"]
39
- },
40
- "tests": {
41
- "type": "integer",
42
- "minimum": 0,
43
- "description": "Task Pool: total tests = passed+failed+error+skipped"
44
- },
45
- "passed": { "type": "integer", "minimum": 0 },
46
- "failed": { "type": "integer", "minimum": 0 },
47
- "error": { "type": "integer", "minimum": 0 },
48
- "skipped": { "type": "integer", "minimum": 0 },
49
- "durationMs": { "type": "number", "minimum": 0 },
50
- "junit": {
51
- "type": "object",
52
- "additionalProperties": false,
53
- "required": ["relativePath", "sha256"],
54
- "properties": {
55
- "relativePath": {
56
- "type": "string",
57
- "minLength": 1,
58
- "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*(?:^|/)\\.(?:/|$))(?!.*\\\\)(?!.*//).+$",
59
- "description": "Run-dir relative POSIX path without absolute form, backslashes, dot segments, or parent traversal (e.g. reports/backend-test-junit.xml)"
60
- },
61
- "sha256": {
62
- "type": "string",
63
- "pattern": "^[a-f0-9]{64}$"
64
- }
65
- }
66
- },
67
- "commandSummary": {
68
- "type": "string",
69
- "minLength": 1,
70
- "description": "Non-secret command summary only"
71
- },
72
- "failures": {
73
- "type": "array",
74
- "description": "Truncated failure/error summaries for triage (Task Pool consumable).",
75
- "items": {
76
- "type": "object",
77
- "additionalProperties": false,
78
- "required": ["classname", "name", "message"],
79
- "properties": {
80
- "classname": { "type": "string", "minLength": 1 },
81
- "name": { "type": "string", "minLength": 1 },
82
- "message": { "type": "string", "minLength": 1 },
83
- "kind": { "type": "string", "enum": ["failure", "error"], "default": "failure" }
84
- }
85
- }
86
- },
87
- "outcome": {
88
- "type": "string",
89
- "enum": [
90
- "passed",
91
- "completed-with-failures",
92
- "collection-error",
93
- "command-error",
94
- "report-error"
95
- ],
96
- "description": "Authoritative shell-facing outcome for backend-test-outcome-gate-shell. Retrospective must not override."
97
- }
98
- }
99
- }
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://tea-agent.dev/schemas/backend-test-result-v1.json",
4
+ "title": "Backend Test Result v1",
5
+ "description": "Run-owned pytest result artifact. Task Pool may consume outcome, counts, failures[], executionStatus, collectionStatus, pytestExitCode, and junit refs. Auto follow-up is out of scope for M2.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schemaVersion",
10
+ "executionStatus",
11
+ "pytestExitCode",
12
+ "collectionStatus",
13
+ "tests",
14
+ "passed",
15
+ "failed",
16
+ "error",
17
+ "skipped",
18
+ "junit",
19
+ "commandSummary",
20
+ "failures",
21
+ "outcome"
22
+ ],
23
+ "properties": {
24
+ "schemaVersion": { "const": 1 },
25
+ "executionStatus": {
26
+ "type": "string",
27
+ "enum": ["completed", "collection-error", "command-error", "report-error"],
28
+ "description": "Process-level status. Task Pool: do not treat collection-error/command-error as ProductBug."
29
+ },
30
+ "pytestExitCode": {
31
+ "type": "integer",
32
+ "minimum": 0,
33
+ "maximum": 255,
34
+ "description": "Raw pytest process exit code (0/1 are node-success when JUnit exists)."
35
+ },
36
+ "collectionStatus": {
37
+ "type": "string",
38
+ "enum": ["ok", "error", "unknown", "skipped"]
39
+ },
40
+ "tests": {
41
+ "type": "integer",
42
+ "minimum": 0,
43
+ "description": "Task Pool: total tests = passed+failed+error+skipped"
44
+ },
45
+ "passed": { "type": "integer", "minimum": 0 },
46
+ "failed": { "type": "integer", "minimum": 0 },
47
+ "error": { "type": "integer", "minimum": 0 },
48
+ "skipped": { "type": "integer", "minimum": 0 },
49
+ "durationMs": { "type": "number", "minimum": 0 },
50
+ "junit": {
51
+ "type": "object",
52
+ "additionalProperties": false,
53
+ "required": ["relativePath", "sha256"],
54
+ "properties": {
55
+ "relativePath": {
56
+ "type": "string",
57
+ "minLength": 1,
58
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*(?:^|/)\\.(?:/|$))(?!.*\\\\)(?!.*//).+$",
59
+ "description": "Run-dir relative POSIX path without absolute form, backslashes, dot segments, or parent traversal (e.g. reports/backend-test-junit.xml)"
60
+ },
61
+ "sha256": {
62
+ "type": "string",
63
+ "pattern": "^[a-f0-9]{64}$"
64
+ }
65
+ }
66
+ },
67
+ "commandSummary": {
68
+ "type": "string",
69
+ "minLength": 1,
70
+ "description": "Non-secret command summary only"
71
+ },
72
+ "failures": {
73
+ "type": "array",
74
+ "description": "Truncated failure/error summaries for triage (Task Pool consumable).",
75
+ "items": {
76
+ "type": "object",
77
+ "additionalProperties": false,
78
+ "required": ["classname", "name", "message"],
79
+ "properties": {
80
+ "classname": { "type": "string", "minLength": 1 },
81
+ "name": { "type": "string", "minLength": 1 },
82
+ "message": { "type": "string", "minLength": 1 },
83
+ "kind": { "type": "string", "enum": ["failure", "error"], "default": "failure" }
84
+ }
85
+ }
86
+ },
87
+ "outcome": {
88
+ "type": "string",
89
+ "enum": [
90
+ "passed",
91
+ "completed-with-failures",
92
+ "collection-error",
93
+ "command-error",
94
+ "report-error"
95
+ ],
96
+ "description": "Authoritative shell-facing outcome for backend-test-outcome-gate-shell. Retrospective must not override."
97
+ }
98
+ }
99
+ }
@@ -1,87 +1,87 @@
1
- <!-- CODEGRAPH_START -->
2
- ## CodeGraph
3
-
4
- 如果仓库根目录存在 `.codegraph/`,在理解或定位代码前优先使用 CodeGraph,再考虑 rg/fd 或手动读文件。
5
- <!-- CODEGRAPH_END -->
6
-
7
- # AGENTS.md
8
-
9
- 本仓库采用“人类掌舵,智能体执行”的工程方式。目标不是一次性写完所有代码,而是在一个可持续演进、可交接、可验证的系统里做小步增量。
10
-
11
- `AGENTS.md` 是地图,不是百科。顶层只保留开工协议、会话协议与文档导航;长期知识、方法论、决策、计划、报告和模板应进入 `docs/`。
12
-
13
- ## 默认立场
14
-
15
- - 仓库是记录系统:决策、契约、计划、测试、报告优先落到仓库,而不是停留在聊天里。
16
- - 一次只推进一个清晰工作块;主会话按 Orient → Select → Contract → Implement → Verify → Handoff 治理,runtime 真实流程以 `src/workflows/` 为准。
17
- - 先验证基线,再叠加改动;完成定义必须可验证,不能靠删测试、降标准或模糊描述制造“完成”。
18
- - Do not consider backward compatibility. Ignore legacy code/libraries.
19
- - 搜索先于实现;受治理 Agent runtime 只有 Pi(`implement-pi` / `repair-pi`);`cursor-prompt` 仅为显式手工 one-shot sidecar。
20
- - DAG 标准路径:Contract → Scout → Plan → Implement → Verify → Closeout/Handoff。
21
- - 机器校验契约真源:`docs/init-surface.manifest.json`、`docs/architecture/runtime-boundaries.md`、`src/cli/command-definitions.ts`、`skills/loop-agent/`、`scripts/check-*.sh`;本文件只指路。
22
- - 本仓库既是源项目也是 init 默认模板;新增能力必须判断 npm 内置 vs `loop-agent init` 投影。
23
- - 委托写入前必须结构化 `task.json.allowedPaths` / `forbiddenPaths`,并审查 DAG writer `writeSet`。
24
- - Shell 搜索优先 `rg`,按名找文件优先 `fd`;脚本用 Git Bash / 兼容 Bash。
25
- - 用 loop-agent 迭代本仓库时,控制器必须来自已发布 npm 包(记录实际版本);启动后不要中途升级;不要用工作区 `npm link` / `npm run dev` 控制可能改 CLI/runtime/package 的任务。
26
- - 反复出现的约束固化为文档、脚本、检查、测试或模板;禁止占位实现(除非 contract 标明脚手架)。
27
- - 非微小实现:`exec-plan` 不能替代 Agent DAG;除非用户要求 one-shot 或计划记录 escape hatch,否则改实现前完成 `task advance`(结构化路径 + writeSet 审查),不得主会话直接改实现。
28
- - 不要自行引入外部 SDD/spec-first 等强制平行治理树;以本文件与 `docs/` 为准(ADR 0006)。
29
-
30
- ## 开始顺序
31
-
32
- 改文件前必须先完成:
33
-
34
- 1. `pwd` → 读 `README.md`、`harness.json`、`docs/README.md`;有 `CONTEXT.md` 则读术语表。
35
- 2. 实现类工作继续读:`docs/governance/development-principles.md`、`docs/governance/feature-workflow.md`、`docs/governance/verification-matrix.md`。
36
- 3. 涉及命令/executor/init/skills/发布包/治理检查时继续读:`docs/architecture/runtime-boundaries.md`、`docs/runtime/loop-agent-harness.md`。
37
- 4. 涉及测试纪律/验证声明/调试时继续读:`docs/harness-methodology-*.md`。
38
- 5. 查看最近提交、相关 plan/progress/report;`git status --short --branch`;跑最小基线验证。
39
- 6. 后端/接口/pytest → `taskKind: "backend-test"`(不是 `--profile`);知识回写 `knowledge-sync`;图谱开荒 `knowledge-graph-bootstrap`。`--profile` 仅 `auto|minimal|standard|reviewed|supervised`。
40
- 7. 看板/observe → `agent-worker console`(默认 repo=当前目录、port=8790;`--no-open` 禁止自动打开浏览器)(`/inspect/` 只读);`observe serve` 已下线(REMOVED / exit 2);`observe snapshot` 仍可用。
41
- 8. 分支合并 → 先读 `docs/operations/branch-merge-guideline.md`。
42
-
43
- ## 会话协议
44
-
45
- 1. Orient → 2. Select(一块)→ 3. Contract → 4. Implement → 5. Verify → 6. Converge Docs → 7. Handoff。
46
-
47
- 这不是 DAG 节点序列。复杂实现默认 Agent DAG;主 agent 拆任务、写 contract、结构化路径、审查 DAG/writeSet/profile/shell verification。微小任务可用 one-shot escape hatch 并记录边界与验证证据。
48
-
49
- ## 项目地图
50
-
51
- - `CONTEXT.md`:术语表
52
- - `src/`:运行时;`test/`:Vitest;`bin/loop-agent.js`:CLI
53
- - `skills/`:源仓库/npm 内置 skills;目标项目只生成 `.agents/skills/`
54
- - `.harness/`:运行态(tasks/dag-runs/runs 等;init 会 gitignore 运行事实,保留 prompts 与占位)
55
- - `docs/`:治理;`website/`:用户文档站;`scripts/`:检查与 CI
56
-
57
- ## 工作规则(增量约束)
58
-
59
- - 保留无关用户改动;优先沿用现有 helper/目录边界。
60
- - 长期决策写入 `docs/`;面向用户变更更新 `CHANGELOG.md`(结果导向中文)。
61
- - init/投影变更必须同步目标项目生成物与 package assets;init evolution 按 `docs/init-surface.manifest.json` 分级。
62
- - CLI/skill entry/runtime boundary/发布包变更同步 catalog、脚本与测试。
63
- - 没有新鲜验证证据时不声明完成;新债写入 plan/progress/report。
64
-
65
- ## 验证
66
-
67
- 权威源:`docs/governance/verification-matrix.md`。常用:
68
-
69
- ```bash
70
- npm run typecheck && npm test && npm run build
71
- node bin/loop-agent.js --help
72
- bash scripts/check-repo.sh
73
- bash scripts/ci.sh
74
- ```
75
-
76
- 文档站变更:`npm run docs:build`。init / architecture / skill entry / pack 定向验证见 verification-matrix。
77
-
78
- ## 交接
79
-
80
- 记录:改了什么、为什么、验证命令与结果、契约/文档/测试影响、剩余风险、后续工作。
81
-
82
- ## 禁止事项
83
-
84
- - 未读相关文档就大改;一次混合无关重构/新功能/文档大迁移。
85
- - 把对话约束当长期知识;缺验证宣称完成;假设系统没有某能力(先搜索)。
86
- - stub/假数据通路替代交付;把本机绝对路径写入仓库级 AGENTS/README/模板/发布包。
87
- - 只更新本仓库体验而遗漏目标项目 init 体验。
1
+ <!-- CODEGRAPH_START -->
2
+ ## CodeGraph
3
+
4
+ 如果仓库根目录存在 `.codegraph/`,在理解或定位代码前优先使用 CodeGraph,再考虑 rg/fd 或手动读文件。
5
+ <!-- CODEGRAPH_END -->
6
+
7
+ # AGENTS.md
8
+
9
+ 本仓库采用“人类掌舵,智能体执行”的工程方式。目标不是一次性写完所有代码,而是在一个可持续演进、可交接、可验证的系统里做小步增量。
10
+
11
+ `AGENTS.md` 是地图,不是百科。顶层只保留开工协议、会话协议与文档导航;长期知识、方法论、决策、计划、报告和模板应进入 `docs/`。
12
+
13
+ ## 默认立场
14
+
15
+ - 仓库是记录系统:决策、契约、计划、测试、报告优先落到仓库,而不是停留在聊天里。
16
+ - 一次只推进一个清晰工作块;主会话按 Orient → Select → Contract → Implement → Verify → Handoff 治理,runtime 真实流程以 `src/workflows/` 为准。
17
+ - 先验证基线,再叠加改动;完成定义必须可验证,不能靠删测试、降标准或模糊描述制造“完成”。
18
+ - Do not consider backward compatibility. Ignore legacy code/libraries.
19
+ - 搜索先于实现;受治理 Agent runtime 只有 Pi(`implement-pi` / `repair-pi`);`cursor-prompt` 仅为显式手工 one-shot sidecar。
20
+ - DAG 标准路径:Contract → Scout → Plan → Implement → Verify → Closeout/Handoff。
21
+ - 机器校验契约真源:`docs/init-surface.manifest.json`、`docs/architecture/runtime-boundaries.md`、`src/cli/command-definitions.ts`、`skills/loop-agent/`、`scripts/check-*.sh`;本文件只指路。
22
+ - 本仓库既是源项目也是 init 默认模板;新增能力必须判断 npm 内置 vs `loop-agent init` 投影。
23
+ - 委托写入前必须结构化 `task.json.allowedPaths` / `forbiddenPaths`,并审查 DAG writer `writeSet`。
24
+ - Shell 搜索优先 `rg`,按名找文件优先 `fd`;脚本用 Git Bash / 兼容 Bash。
25
+ - 用 loop-agent 迭代本仓库时,控制器必须来自已发布 npm 包(记录实际版本);启动后不要中途升级;不要用工作区 `npm link` / `npm run dev` 控制可能改 CLI/runtime/package 的任务。
26
+ - 反复出现的约束固化为文档、脚本、检查、测试或模板;禁止占位实现(除非 contract 标明脚手架)。
27
+ - 非微小实现:`exec-plan` 不能替代 Agent DAG;除非用户要求 one-shot 或计划记录 escape hatch,否则改实现前完成 `task advance`(结构化路径 + writeSet 审查),不得主会话直接改实现。
28
+ - 不要自行引入外部 SDD/spec-first 等强制平行治理树;以本文件与 `docs/` 为准(ADR 0006)。
29
+
30
+ ## 开始顺序
31
+
32
+ 改文件前必须先完成:
33
+
34
+ 1. `pwd` → 读 `README.md`、`harness.json`、`docs/README.md`;有 `CONTEXT.md` 则读术语表。
35
+ 2. 实现类工作继续读:`docs/governance/development-principles.md`、`docs/governance/feature-workflow.md`、`docs/governance/verification-matrix.md`。
36
+ 3. 涉及命令/executor/init/skills/发布包/治理检查时继续读:`docs/architecture/runtime-boundaries.md`、`docs/runtime/loop-agent-harness.md`。
37
+ 4. 涉及测试纪律/验证声明/调试时继续读:`docs/harness-methodology-*.md`。
38
+ 5. 查看最近提交、相关 plan/progress/report;`git status --short --branch`;跑最小基线验证。
39
+ 6. 后端/接口/pytest → `taskKind: "backend-test"`(不是 `--profile`);知识回写 `knowledge-sync`;图谱开荒 `knowledge-graph-bootstrap`。`--profile` 仅 `auto|minimal|standard|reviewed|supervised`。
40
+ 7. 看板/observe → `agent-worker console`(默认 repo=当前目录、port=8790;`--no-open` 禁止自动打开浏览器)(`/inspect/` 只读);`observe serve` 已下线(REMOVED / exit 2);`observe snapshot` 仍可用。
41
+ 8. 分支合并 → 先读 `docs/operations/branch-merge-guideline.md`。
42
+
43
+ ## 会话协议
44
+
45
+ 1. Orient → 2. Select(一块)→ 3. Contract → 4. Implement → 5. Verify → 6. Converge Docs → 7. Handoff。
46
+
47
+ 这不是 DAG 节点序列。复杂实现默认 Agent DAG;主 agent 拆任务、写 contract、结构化路径、审查 DAG/writeSet/profile/shell verification。微小任务可用 one-shot escape hatch 并记录边界与验证证据。
48
+
49
+ ## 项目地图
50
+
51
+ - `CONTEXT.md`:术语表
52
+ - `src/`:运行时;`test/`:Vitest;`bin/loop-agent.js`:CLI
53
+ - `skills/`:源仓库/npm 内置 skills;目标项目只生成 `.agents/skills/`
54
+ - `.harness/`:运行态(tasks/dag-runs/runs 等;init 会 gitignore 运行事实,保留 prompts 与占位)
55
+ - `docs/`:治理;`website/`:用户文档站;`scripts/`:检查与 CI
56
+
57
+ ## 工作规则(增量约束)
58
+
59
+ - 保留无关用户改动;优先沿用现有 helper/目录边界。
60
+ - 长期决策写入 `docs/`;面向用户变更更新 `CHANGELOG.md`(结果导向中文)。
61
+ - init/投影变更必须同步目标项目生成物与 package assets;init evolution 按 `docs/init-surface.manifest.json` 分级。
62
+ - CLI/skill entry/runtime boundary/发布包变更同步 catalog、脚本与测试。
63
+ - 没有新鲜验证证据时不声明完成;新债写入 plan/progress/report。
64
+
65
+ ## 验证
66
+
67
+ 权威源:`docs/governance/verification-matrix.md`。常用:
68
+
69
+ ```bash
70
+ npm run typecheck && npm test && npm run build
71
+ node bin/loop-agent.js --help
72
+ bash scripts/check-repo.sh
73
+ bash scripts/ci.sh
74
+ ```
75
+
76
+ 文档站变更:`npm run docs:build`。init / architecture / skill entry / pack 定向验证见 verification-matrix。
77
+
78
+ ## 交接
79
+
80
+ 记录:改了什么、为什么、验证命令与结果、契约/文档/测试影响、剩余风险、后续工作。
81
+
82
+ ## 禁止事项
83
+
84
+ - 未读相关文档就大改;一次混合无关重构/新功能/文档大迁移。
85
+ - 把对话约束当长期知识;缺验证宣称完成;假设系统没有某能力(先搜索)。
86
+ - stub/假数据通路替代交付;把本机绝对路径写入仓库级 AGENTS/README/模板/发布包。
87
+ - 只更新本仓库体验而遗漏目标项目 init 体验。