@tea-agent/loop-agent 0.35.0-beta.2 → 0.35.1-beta.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 (154) hide show
  1. package/AGENTS.md +108 -108
  2. package/CHANGELOG.md +55 -4
  3. package/README.md +165 -165
  4. package/bin/agent-worker.js +0 -0
  5. package/bin/loop-agent.js +21 -21
  6. package/dist/application/task-lifecycle/advance.js +1 -0
  7. package/dist/commands/cursor-prompt.js +6 -6
  8. package/dist/commands/init-upgrade.js +351 -19
  9. package/dist/commands/init.js +14 -67
  10. package/dist/commands/loop-benchmark.js +11 -11
  11. package/dist/commands/pi-reuse-benchmark.js +16 -16
  12. package/dist/commands/run-dag-progress.js +14 -0
  13. package/dist/commands/task-advance.js +33 -3
  14. package/dist/shared/operator/capabilities.js +38 -1
  15. package/dist/sidecars/cursor-prompt/executor.js +1 -1
  16. package/dist/worker/console/chat/pi-runtime.js +41 -25
  17. package/dist/worker/console/chat/routes.js +27 -4
  18. package/dist/worker/console/operation-runner.js +24 -0
  19. package/dist/worker/console/operation-wait.js +241 -0
  20. package/dist/worker/console/operator-actions.js +58 -0
  21. package/dist/worker/console/static/assets/{index-hJqCPs_g.css → index-Dups4sSM.css} +1 -1
  22. package/dist/worker/console/static/assets/index-SjjjZnV3.js +56 -0
  23. package/dist/worker/console/static/index.html +2 -2
  24. package/dist/worker/console/static-src/operator-chat/slash-palette-nav.js +141 -0
  25. package/dist/worker/console/static-src/operator-chat/useChatSessions.js +13 -2
  26. package/dist/worker/console/static-src/operator-chat/useComposer.js +30 -7
  27. package/dist/worker/observe/static/copy.js +67 -67
  28. package/dist/worker/observe/static/dag-layout.d.ts +36 -36
  29. package/dist/worker/observe/static/dom.js +220 -220
  30. package/dist/worker/observe/static/relations.js +133 -133
  31. package/dist/worker/observe/static/run-processing.js +148 -148
  32. package/dist/worker/observe/static/views/batch.js +227 -227
  33. package/dist/worker/observe/static/views/failures.js +143 -143
  34. package/dist/worker/observe/static/views/feature.js +492 -492
  35. package/dist/worker/observe/static/views/run.js +453 -453
  36. package/dist/worker/observe/static/views/shell.js +7 -7
  37. package/dist/worker/observe/static/views/timeline.js +163 -163
  38. package/dist/workflows/dag/canvas-observer.js +275 -275
  39. package/dist/workflows/dag/frontend-prewrite-gate.js +9 -1
  40. package/dist/workflows/dag/init-hybrid.js +2 -0
  41. package/docs/architecture/evolution.md +73 -73
  42. package/docs/architecture/system-overview.md +100 -100
  43. package/docs/architecture/worker-and-feature.md +122 -122
  44. package/docs/skills/README.md +7 -7
  45. package/docs/templates/adr.md +60 -60
  46. package/docs/templates/agent-dag-authority-surface-audit.prompt.md +94 -94
  47. package/docs/templates/agent-dag-decision-envelope.schema.json +213 -213
  48. package/docs/templates/agent-dag-decision-gate.prompt.md +246 -246
  49. package/docs/templates/agent-dag-process-supervisor.prompt.md +98 -98
  50. package/docs/templates/agent-dag-report.schema.json +473 -473
  51. package/docs/templates/agent-dag-review-verdict.prompt.md +68 -68
  52. package/docs/templates/backend-test-result.schema.json +99 -99
  53. package/docs/templates/evaluation/agents-map-slim-v1.md +87 -87
  54. package/docs/templates/evaluation/agents-map-verbose-v0.md +153 -153
  55. package/docs/templates/feature-spec.md +53 -53
  56. package/docs/templates/frontend-design-contract.md +42 -42
  57. package/docs/templates/frontend-eval/fixtures/failures/01-type-build-error.md +17 -17
  58. package/docs/templates/frontend-eval/fixtures/failures/02-unit-component-test-fail.md +16 -16
  59. package/docs/templates/frontend-eval/fixtures/failures/03-fixture-schema-drift.md +16 -16
  60. package/docs/templates/frontend-eval/fixtures/failures/04-missing-loading-empty-error-state.md +16 -16
  61. package/docs/templates/frontend-eval/fixtures/failures/05-forbidden-write-writeset-expansion.md +16 -16
  62. package/docs/templates/frontend-eval/fixtures/failures/06-unapproved-dependency-add.md +16 -16
  63. package/docs/templates/frontend-eval/fixtures/failures/07-mock-production-on.md +21 -21
  64. package/docs/templates/frontend-eval/fixtures/functional/01-simple-component-style.md +29 -29
  65. package/docs/templates/frontend-eval/fixtures/functional/02-form-validation.md +28 -28
  66. package/docs/templates/frontend-eval/fixtures/functional/03-list-detail-page.md +28 -28
  67. package/docs/templates/frontend-eval/fixtures/functional/04-api-mock.md +29 -29
  68. package/docs/templates/frontend-eval/fixtures/functional/05-permission-auth-gated-ui.md +27 -27
  69. package/docs/templates/frontend-eval/fixtures/functional/06-ssr-server-client-boundary.md +28 -28
  70. package/docs/templates/frontend-eval/fixtures/functional/07-shared-public-component-api.md +28 -28
  71. package/docs/templates/frontend-eval/fixtures/functional/08-pure-local-no-remote.md +27 -27
  72. package/docs/templates/frontend-eval/metrics.md +138 -138
  73. package/docs/templates/frontend-eval/smoke-targets.md +53 -53
  74. package/docs/templates/frontend-task-constraints.md +35 -35
  75. package/docs/templates/frontend-task-requirement.md +70 -70
  76. package/docs/templates/init-evolution-review.md +35 -35
  77. package/docs/templates/init-managed-agents.md +156 -154
  78. package/docs/templates/interactive-ui-round2-experiment.md +66 -66
  79. package/docs/templates/knowledge-graph-bootstrap-dag.json +118 -118
  80. package/docs/templates/knowledge-sync-dag.json +178 -178
  81. package/docs/templates/knowledge-sync-draft.schema.json +71 -71
  82. package/docs/templates/product-line/closeout.yaml +9 -9
  83. package/docs/templates/product-line/design.md +13 -13
  84. package/docs/templates/product-line/links.md +10 -10
  85. package/docs/templates/product-line/requirement.md +17 -17
  86. package/docs/templates/product-line/test-plan.md +7 -7
  87. package/docs/templates/project-start-checklist.md +9 -9
  88. package/docs/templates/qa-report.md +48 -48
  89. package/docs/templates/sprint-contract.md +29 -29
  90. package/docs/templates/worker-dogfood-evidence.md +80 -80
  91. package/docs/templates/worker-dogfood-setup.md +68 -68
  92. package/harness.json +5 -2
  93. package/package.json +1 -1
  94. package/scripts/kb-bootstrap-init-skeleton.sh +0 -0
  95. package/scripts/kb-graph-incremental-prepare.mjs +0 -0
  96. package/scripts/kb-graph-materialize.mjs +105 -105
  97. package/scripts/kb-graph-promote.mjs +164 -164
  98. package/scripts/kb-query.mjs +554 -554
  99. package/skills/agent-worker/SKILL.md +48 -48
  100. package/skills/agent-worker/references/agent-worker-operator.md +159 -159
  101. package/skills/ai-engineering-context/SKILL.md +48 -48
  102. package/skills/analyze-product-dependencies/scripts/test-validators.mjs +0 -0
  103. package/skills/analyze-product-dependencies/scripts/validate-api-documentation.mjs +0 -0
  104. package/skills/analyze-product-dependencies/scripts/validate-dependency-analysis.mjs +0 -0
  105. package/skills/analyze-product-dependencies/scripts/validate-product-requirement-input.mjs +0 -0
  106. package/skills/analyze-product-requirements/scripts/compute-source-identity.mjs +0 -0
  107. package/skills/analyze-product-requirements/scripts/test-validators.mjs +0 -0
  108. package/skills/analyze-product-requirements/scripts/validate-product-analysis.mjs +0 -0
  109. package/skills/analyze-product-requirements/scripts/validate-product-requirement.mjs +0 -0
  110. package/skills/analyze-product-requirements/scripts/validate-requirement-clarification.mjs +0 -0
  111. package/skills/browser-tools/browser-content.js +103 -103
  112. package/skills/browser-tools/browser-cookies.js +35 -35
  113. package/skills/browser-tools/browser-eval.js +53 -53
  114. package/skills/browser-tools/browser-hn-scraper.js +108 -108
  115. package/skills/browser-tools/browser-nav.js +44 -44
  116. package/skills/browser-tools/browser-pick.js +162 -162
  117. package/skills/browser-tools/browser-screenshot.js +34 -34
  118. package/skills/browser-tools/browser-start.js +86 -86
  119. package/skills/browser-tools/package-lock.json +2556 -2556
  120. package/skills/browser-tools/package.json +19 -19
  121. package/skills/code-review-core/SKILL.md +20 -20
  122. package/skills/codebase-scout/SKILL.md +19 -19
  123. package/skills/grill-me/SKILL.md +10 -10
  124. package/skills/local-jacoco-coverage/scripts/run-coverage-analysis.sh +0 -0
  125. package/skills/local-jacoco-coverage/scripts/start-jacoco-agent.sh +0 -0
  126. package/skills/loop-agent/SKILL.md +1 -0
  127. package/skills/loop-agent/references/command-reference.md +641 -639
  128. package/skills/loop-agent/references/docs-converge.md +126 -126
  129. package/skills/loop-agent/references/learned/README.md +21 -21
  130. package/skills/loop-agent/references/pi-prompt.md +23 -23
  131. package/skills/loop-agent/references/pi-subagent-assisted-mode.md +84 -84
  132. package/skills/playwright-cli/references/element-attributes.md +23 -23
  133. package/skills/playwright-cli/references/playwright-tests.md +39 -39
  134. package/skills/playwright-cli/references/request-mocking.md +87 -87
  135. package/skills/playwright-cli/references/running-code.md +241 -241
  136. package/skills/playwright-cli/references/session-management.md +225 -225
  137. package/skills/playwright-cli/references/storage-state.md +275 -275
  138. package/skills/playwright-cli/references/test-generation.md +433 -433
  139. package/skills/requesting-code-review/SKILL.md +101 -101
  140. package/skills/requesting-code-review/code-reviewer.md +168 -168
  141. package/skills/systematic-debugging/CREATION-LOG.md +119 -119
  142. package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -158
  143. package/skills/systematic-debugging/condition-based-waiting.md +115 -115
  144. package/skills/systematic-debugging/defense-in-depth.md +122 -122
  145. package/skills/systematic-debugging/find-polluter.sh +63 -63
  146. package/skills/systematic-debugging/root-cause-tracing.md +169 -169
  147. package/skills/systematic-debugging/test-academic.md +14 -14
  148. package/skills/systematic-debugging/test-pressure-1.md +58 -58
  149. package/skills/systematic-debugging/test-pressure-2.md +68 -68
  150. package/skills/systematic-debugging/test-pressure-3.md +69 -69
  151. package/skills/using-git-worktrees/SKILL.md +215 -215
  152. package/skills/verification-before-completion/SKILL.md +154 -154
  153. package/skills/webapp-testing/SKILL.md +19 -19
  154. package/dist/worker/console/static/assets/index-fsjzREob.js +0 -56
@@ -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 体验。