easy-coding-harness 0.10.0-beta.1 → 0.10.0-beta.10

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 (33) hide show
  1. package/CHANGELOG.md +151 -0
  2. package/README.md +50 -20
  3. package/dist/cli.js +478 -47
  4. package/dist/cli.js.map +1 -1
  5. package/package.json +1 -1
  6. package/templates/claude/agents/ec-implementer.md +11 -0
  7. package/templates/claude/agents/ec-reviewer.md +6 -1
  8. package/templates/codex/agents/ec-implementer.toml +11 -0
  9. package/templates/codex/agents/ec-reviewer.toml +6 -1
  10. package/templates/common/bundled-skills/ec-init/SKILL.md +18 -6
  11. package/templates/common/bundled-skills/ec-meta/references/local-architecture/README.md +27 -12
  12. package/templates/common/bundled-skills/ec-meta/references/platform-files/README.md +1 -1
  13. package/templates/common/skills/ec-analysis/SKILL.md +141 -35
  14. package/templates/common/skills/ec-config/SKILL.md +24 -2
  15. package/templates/common/skills/ec-git/SKILL.md +7 -1
  16. package/templates/common/skills/ec-implementing/SKILL.md +61 -1
  17. package/templates/common/skills/ec-memory/SKILL.md +76 -6
  18. package/templates/common/skills/ec-reviewing/SKILL.md +21 -3
  19. package/templates/common/skills/ec-task-close/SKILL.md +4 -0
  20. package/templates/common/skills/ec-task-management/SKILL.md +7 -1
  21. package/templates/common/skills/ec-tdd-init/SKILL.md +101 -0
  22. package/templates/common/skills/ec-verification/SKILL.md +68 -26
  23. package/templates/common/skills/ec-workflow/SKILL.md +81 -22
  24. package/templates/main-constraint/AGENTS.md.tpl +49 -14
  25. package/templates/main-constraint/CLAUDE.md.tpl +46 -14
  26. package/templates/qoder/agents/ec-implementer.md +11 -0
  27. package/templates/qoder/agents/ec-reviewer.md +6 -1
  28. package/templates/runtime/templates/dev-spec-skeleton.md +8 -1
  29. package/templates/runtime/tools/easy_coding_tdd_readiness.py +306 -0
  30. package/templates/shared-hooks/easy_coding_state.py +3878 -259
  31. package/templates/shared-hooks/easy_dev_spec.py +444 -30
  32. package/templates/shared-hooks/easy_dev_spec_execution.py +1014 -0
  33. package/templates/shared-hooks/easy_dev_spec_protocol.py +1426 -18
@@ -28,7 +28,9 @@ lite semantics or an already-persisted edge, permits one IMPLEMENT -> VERIFICATI
28
28
 
29
29
  - `approval_mode = approve|guard|confirm|auto` controls whether a legal transition waits for a
30
30
  user. `confirm` waits only at ANALYSIS -> IMPLEMENT; after that, green REVIEW, VERIFICATION,
31
- MEMORY, and COMPLETE transitions advance automatically.
31
+ MEMORY, and COMPLETE transitions advance automatically. `auto` advances every legal green
32
+ edge. The only additional pause is an exceptional code diff detected after the frozen
33
+ VERIFICATION acceptance checkpoint; accepting that exact diff does not change the mode.
32
34
  - `workflow_mode = adaptive|fast|standard|strict` controls execution cost and assurance depth.
33
35
  - `tdd_enabled` independently activates Java TDD and changed-line coverage. It defaults off;
34
36
  `tdd_coverage_threshold` defaults to 90 and accepts integers from 1 to 100.
@@ -39,14 +41,20 @@ selection and reasons, allows the user to change it within the risk floor, and f
39
41
  ANALYSIS -> IMPLEMENT is applied.
40
42
 
41
43
  TDD resolves with the same session-over-project precedence and freezes its enabled flag and
42
- threshold on ANALYSIS -> IMPLEMENT. When off, it must add no CI scan, artifacts, commands,
43
- coverage work, or stronger acceptance. Use `ec-config` for all mode configuration.
44
+ threshold on ANALYSIS -> IMPLEMENT. It may be enabled only after `ec-tdd-init` readiness passes;
45
+ there is no enabled-but-pending-initialization state. A dedicated `tdd-init` task always freezes
46
+ TDD off so it can create or repair the required infrastructure without circular gating. When off,
47
+ ordinary tasks add no CI scan, artifacts, commands, coverage work, or stronger acceptance. Use
48
+ `ec-config` for all mode configuration.
44
49
 
45
50
  `confirm` and `auto` do not hide the proposal: show it in the plan. Confirm waits for that one
46
51
  plan decision; Auto continues immediately. Both remove later waiting, not quality gates.
47
52
 
48
53
  ## Startup
49
54
 
55
+ Throughout this skill, `<agent-id>` is the canonical workflow owner ID: `claude-code`, `codex`,
56
+ or `qoder`. Never use a display or source-author attribution such as `Codex with Easy Coding`.
57
+
50
58
  1. Read the injected state breadcrumbs or call:
51
59
 
52
60
  ```bash
@@ -58,36 +66,63 @@ plan decision; Auto continues immediately. Both remove later waiting, not qualit
58
66
  - Present with `status != "COMPLETE"`: invoke `{{skill_trigger}}ec-init`, then stop.
59
67
  - `[easy-coding:upgrade-init-pending:X]`: recommend `{{skill_trigger}}ec-init` for vX
60
68
  adaptation, but allow the user to continue; this reminder is not a workflow block.
61
- 3. When the user explicitly references a Dev-Spec, run the read-only `inspect-dev-spec` command
62
- before ordinary task creation. For `protocol=canonical-v1`, show every task ID, repository,
63
- title, dependency, and baseline status; never select all tasks by default. After the user
64
- chooses one or more tasks and resolves repository paths or omitted hard-dependency evidence,
65
- call `create-task-from-spec` once for the complete selection. A document without a Canonical
66
- manifest remains a legacy ANALYSIS input for an ordinary task. A malformed, DRAFT, or otherwise
67
- non-READY Canonical Spec stays blocked and must never be downgraded to the legacy route. Never
68
- edit the source Spec.
69
+ 3. When the user explicitly references a Dev-Spec, first run read-only `inspect-dev-spec
70
+ --manifest-only`. This routing pass validates the document, identifies the current worktree by
71
+ normalized remote, and returns the task catalog without resolving unrelated repositories. For
72
+ `protocol=canonical-v1`, show every task ID, repository, title, static status, actual execution
73
+ status, and dependency; never select all tasks by default and never calculate baseline drift
74
+ before selection.
75
+
76
+ After the user chooses one or more tasks, run one selected inspection with repeated
77
+ `--spec-task`. Resolve paths only for repositories that own selected tasks. The current
78
+ worktree needs no explicit mapping when its normalized remote matches uniquely; pass
79
+ `--repo-path` only for an additional selected repository or to confirm an ambiguous current
80
+ match. A differing `path_hint` is a one-time runtime mapping notice, not a Spec portability
81
+ failure: never copy, mirror, or rewrite the source Spec because of it.
82
+
83
+ Then call `create-task-from-spec` once for the complete selection. Do not call
84
+ `select-dev-spec-scope` during routing; `ec-analysis` owns the single consumption-closure read
85
+ after task creation. A document without a Canonical manifest remains a legacy ANALYSIS input
86
+ for an ordinary task. A malformed, DRAFT, or otherwise non-READY Canonical Spec stays blocked
87
+ and must never be downgraded to the legacy route. A READY Canonical Spec without shared
88
+ execution remains readable, but run `initialize-spec-execution` before selection can become an
89
+ executable Harness task.
69
90
 
70
91
  ```bash
71
92
  {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py inspect-dev-spec \
72
- --spec <path> [--repo-path <repo-id>=<path>]...
93
+ --spec <path> --manifest-only
94
+
95
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py inspect-dev-spec \
96
+ --spec <path> --spec-task <task-id> [--spec-task <task-id>]... \
97
+ [--repo-path <repo-id>=<path>]...
73
98
 
74
- {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py select-dev-spec-scope \
75
- --spec <path> --spec-task <task-id> [--spec-task <task-id>]...
99
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py initialize-spec-execution \
100
+ --spec <path>
76
101
 
77
102
  {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py create-task-from-spec \
78
103
  --spec <path> --spec-task <task-id> [--spec-task <task-id>]... \
79
104
  --task-id <harness-task-id> --type <type> --title <title> \
80
- --repo-path <repo-id>=<path> [--dependency-evidence <dependency-id>=<evidence>]... \
105
+ [--repo-path <repo-id>=<path>]... \
106
+ [--dependency-evidence <dependency-id>=<evidence>]... \
81
107
  --agent <agent-id> --session-file <P>
82
108
  ```
83
109
 
84
- `select-dev-spec-scope` is read-only and may run only after explicit task selection. Its
85
- per-repository payload is the authoritative ANALYSIS context; do not load unselected task
86
- bodies from the source document.
110
+ Shared `EDS:EXECUTION` is the dependency fact source. Accept a completed hard dependency or a
111
+ satisfied edge directly from that snapshot. Only accept manual dependency evidence when the
112
+ shared edge is still pending and the user explicitly supplies independently verifiable
113
+ evidence; never reconstruct completion from another local Harness task, Git history, or an
114
+ agent's inference.
87
115
 
88
116
  When multiple selected tasks depend on the same target, disambiguate creation evidence with
89
117
  `<source-task-id>-><dependency-task-id>=<evidence>`.
90
- 4. Match the user's intent against `current_task` and the active task list before resuming.
118
+ Explicit project-external Spec files are supported and stored as absolute locators. If that
119
+ locator moves, use `rebind-spec-source`; never guess by basename. Shared execution progress is
120
+ written only through state API writer commands. Static design edits require revision + READY +
121
+ `sync-spec-design`; never hand-edit the `EDS:EXECUTION` region.
122
+ 4. When the user explicitly invokes `ec-tdd-init`, let that skill own preflight and create a
123
+ `type=tdd-init` code task only after scope confirmation. Do not reinterpret it as an ordinary
124
+ TDD-enabled feature task and do not require readiness before creating it.
125
+ 5. Match the user's intent against `current_task` and the active task list before resuming.
91
126
  If the user names or clearly matches another task, confirm the switch and call
92
127
  `claim-task --task-id <id> --agent <agent-id> --session-file <P>`. Do not execute task A
93
128
  under task B's request.
@@ -99,10 +134,10 @@ plan decision; Auto continues immediately. Both remove later waiting, not qualit
99
134
  to the requested deliverable. Feature, bugfix, refactor, performance, and workflow changes
100
135
  are code tasks. Use `doc`, `analysis`, or `report` only when the user explicitly requested
101
136
  a no-code deliverable; never downgrade a code request to the read-only completion path.
102
- 5. Resume the matched/current task, then load only state-relevant assets. Do not read five full
137
+ 6. Resume the matched/current task, then load only state-relevant assets. Do not read five full
103
138
  memories at every startup; ANALYSIS searches memory metadata and opens relevant entries on
104
139
  demand.
105
- 6. If another Agent last owned the task, summarize the stored handoff before continuing.
140
+ 7. If another Agent last owned the task, summarize the stored handoff before continuing.
106
141
 
107
142
  ## Stage dispatch
108
143
 
@@ -110,10 +145,17 @@ plan decision; Auto continues immediately. Both remove later waiting, not qualit
110
145
  - `ANALYSIS`: dispatch `ec-analysis`; it produces artifacts and a workflow proposal.
111
146
  - `IMPLEMENT`: dispatch `ec-implementing` using the frozen concrete mode.
112
147
  - `REVIEW`: dispatch `ec-reviewing`; the transition requires current fingerprint evidence.
113
- - `VERIFICATION`: dispatch `ec-verification`; archive requires current green evidence.
148
+ - `VERIFICATION`: dispatch `ec-verification`; the MEMORY boundary requires green evidence and an
149
+ unchanged or explicitly accepted verification checkpoint.
114
150
  - `MEMORY`: dispatch `ec-memory`.
115
151
  - `COMPLETE` / `CLOSED`: report terminal status and clear stale session ownership.
116
152
 
153
+ For a Canonical-backed task whose snapshot reports pending writeback, call
154
+ `reconcile-spec-execution` before dispatching the stage. Do not advance locally while shared
155
+ writeback remains pending or conflicted. A deterministic writer rejection reports `error` and
156
+ clears the pending action so the corrected action can proceed; never overwrite a different
157
+ pending action.
158
+
117
159
  ## Boundary handling
118
160
 
119
161
  Use `request-transition` for a boundary that requires approval, then present the complete
@@ -130,6 +172,23 @@ Use `auto-transition` only when the state API says the edge is automatic. Mechan
130
172
  (analysis artifacts and proposal, review fingerprint, verification fingerprint, memory
131
173
  completion) apply in every approval mode.
132
174
 
175
+ `[easy-coding:acceptance-drift-confirmation-required]` is a narrow exception to automatic-edge
176
+ handling. Call `inspect-transition-drift`, present every returned patch/binary/mode change and the
177
+ current `diff_sha256`, then use the platform's native choice UI for these branches:
178
+
179
+ 1. Accept this exact diff and continue to MEMORY (recommended only with the stated verification
180
+ policy).
181
+ 2. Return to IMPLEMENT because the change needs normal repair/review.
182
+ 3. Hand off to another Agent.
183
+ 4. Other / revise.
184
+
185
+ Never call `auto-transition` repeatedly to hide this pause. If the user accepts, preserve the
186
+ existing REVIEW conclusion and call `confirm-transition` with the exact digest,
187
+ `--verification-policy carry-forward|targeted|waived`, and a decision summary. `targeted` needs a
188
+ passed current-fingerprint targeted check first. If the digest changes, inspect and present the
189
+ new diff. Config, plan, workflow, Canonical-design, or nested-repository drift is not an
190
+ acceptance-diff choice and returns to the stage required by the state API.
191
+
133
192
  For a migrated pre-0.9 Lite task, the breadcrumb
134
193
  `[easy-coding:lite-review-bypass-required:IMPLEMENT->REVIEW]` means the stored REVIEW edge is
135
194
  stale. Call `cancel-transition`, then immediately call `auto-transition --stage VERIFICATION`.
@@ -33,7 +33,7 @@ Trigger Easy Coding skills with your platform prefix — Codex: `$ec-*`, Qoder:
33
33
  - `ec-brainstorming` — design exploration before building (hard design gate)
34
34
  - `ec-analysis` `ec-implementing` `ec-reviewing` `ec-verification` — workflow stages
35
35
  - `ec-memory` — short/long memory archive
36
- - `ec-task-management` — task lifecycle panel · `ec-config` — Approval/Workflow/TDD settings · `ec-task-close` — interrupt a task
36
+ - `ec-task-management` — task lifecycle panel · `ec-config` — Approval/Workflow/TDD settings · `ec-tdd-init` — Java changed-line gate initialization · `ec-task-close` — interrupt a task
37
37
  - `ec-no-harness` — bypass only Easy Coding for the current session
38
38
  - `ec-git` — git discipline · `ec-meta` — understand/customize the harness
39
39
 
@@ -45,13 +45,19 @@ First run `ec-init`; daily work goes through `ec-workflow`.
45
45
  is session override > project `behavior.workflow_mode` > `adaptive`. Approval controls waiting;
46
46
  workflow controls execution depth. ANALYSIS shows and freezes adaptive to fast/standard/strict.
47
47
  Confirm approval waits only at ANALYSIS -> IMPLEMENT, then advances green later stages
48
- automatically. Every new code task runs REVIEW; no mode changes scope, delivery form, or
49
- evidence gates.
48
+ automatically; Auto advances all legal green edges. A new code diff after the VERIFICATION
49
+ checkpoint is the only exceptional pause across all modes: show the exact diff, bind acceptance
50
+ to its digest, and continue without rereview when the user accepts.
51
+ Every new code task runs REVIEW; no mode changes scope, delivery form, or evidence gates.
50
52
  - TDD is session override > project `behavior.tdd_enabled` > `false`; its changed-line threshold
51
53
  is session override > project `behavior.tdd_coverage_threshold` > `90`. ANALYSIS -> IMPLEMENT
52
- freezes both. Disabled TDD adds no CI scan, JaCoCo work, commands, artifacts, or stronger gates.
53
- Enabled TDD applies only to Java code tasks and requires lifecycle, review, local coverage, and
54
- GitLab TEST-stage gate evidence.
54
+ freezes both. TDD may be enabled only after `ec-tdd-init` records valid infrastructure readiness;
55
+ there is no enable-now/init-later state. The dedicated `tdd-init` task always freezes TDD off and
56
+ initializes only changed-line coverage infrastructure, never historical business-test coverage.
57
+ Disabled TDD adds no CI scan, JaCoCo work, commands, artifacts, or stronger gates. Enabled TDD
58
+ applies only to Java code tasks and requires lifecycle, review, passed local unit tests, and
59
+ local coverage for production lines changed since the task baseline. `ec-tdd-init` still
60
+ generates GitLab TEST-stage automation, but remote CI status is not Harness acceptance evidence.
55
61
  - Confirmation-required edges use `pending_transition`; automatic edges use the restricted
56
62
  `auto-transition` API. A read-only task creates no test-strategy.md, never enters REVIEW,
57
63
  VERIFICATION, or MEMORY, and writes no task memory.
@@ -72,15 +78,35 @@ First run `ec-init`; daily work goes through `ec-workflow`.
72
78
  only Easy Coding workflow/stage orchestration for this session. Continue honoring every
73
79
  non-Easy-Coding skill, hook, and instruction. Do not clear or mutate the suspended task.
74
80
  - ANALYSIS must follow template-first: read `.easy-coding/templates/dev-spec-skeleton.md` then
75
- write its exact content to the task's dev-spec.md as the FIRST tool calls. Next inspect evidence
76
- without editing the skeleton, ask every unresolved decision during analysis, and wait. Only
77
- after all decisions are resolved may the agent fill the complete dev-spec.md. The final report
78
- contains neither `[阶段:ANALYSIS]` nor a `待用户决策` section.
81
+ write its exact content to the task's dev-spec.md as the FIRST tool calls. Next inspect evidence,
82
+ set `decision_status: open`, ask every unresolved material decision, and progressively record
83
+ each confirmed answer and its evidence in `### 决策闭环`. Only after all material decisions are
84
+ resolved may the agent set the single `decision_status: closed`, finalize the artifacts, and
85
+ propose IMPLEMENT. The session presentation is a concise core-solution, acceptance, workflow,
86
+ and risk summary with an absolute local link/path to the full dev-spec.md; never paste the full
87
+ artifact by default. The final artifact contains neither `[阶段:ANALYSIS]` nor a
88
+ `待用户决策` section.
79
89
  - REVIEW and VERIFICATION are fingerprinted hard gates. Review evidence must match the final
80
90
  implementation; verification evidence must match final implementation and config. The frozen
81
91
  workflow mode selects targeted, impacted, or full commands without weakening the green gate.
92
+ Freeze a verification checkpoint after green checks. Unchanged checkpoints follow approval
93
+ mode normally; post-checkpoint code drift requires exact digest acceptance and
94
+ carry-forward/targeted/waived verification policy, but never an automatic second REVIEW.
95
+ - Canonical-backed tasks bind static validity to design revision + `design_sha256`, while
96
+ `document_sha256` and `execution_revision` may advance through shared writer commands. Project-
97
+ external explicit Spec paths are allowed and may be repaired only with identity-checked rebind.
98
+ Runtime progress must use the shared writer with CAS/idempotency and reconciliation; static
99
+ design changes require revision + READY + `sync-spec-design`. Never hand-edit `EDS:EXECUTION`.
100
+ Selected source tasks remain `implemented` through local VERIFICATION and become `verified`
101
+ only when the accepted VERIFICATION -> MEMORY boundary is actually applied.
102
+ - Canonical routing is two-pass: first use manifest-only discovery for the current worktree, then
103
+ inspect only the explicitly selected task IDs and repositories. A remote-confirmed worktree
104
+ overrides a stale `path_hint`; never mirror the source Spec or re-check unselected repositories.
105
+ ANALYSIS reads the selected consumption closure once and treats exact/scope-unchanged as a fast
106
+ projection, while shared execution is the dependency fact source.
82
107
  - MEMORY combines short-memory creation and the conditional long-memory gate. Entry follows the
83
- effective confirmation mode; once memory processing completes, COMPLETE is automatic.
108
+ effective confirmation mode; its checkpoint records any accepted post-verification diff digest
109
+ and decision. Once memory processing completes, COMPLETE is automatic.
84
110
  - NO CODE-TASK COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE.
85
111
  - All cross-platform modules (skills, hooks, references) must use universal agent protocols.
86
112
  Do not rely on any specific agent's proprietary conventions unless the module is explicitly
@@ -89,15 +115,24 @@ First run `ec-init`; daily work goes through `ec-workflow`.
89
115
 
90
116
  ## Runtime contract
91
117
 
92
- - Workflow state operations go through `{{platform_config_dir}}/hooks/easy_coding_state.py`;
93
- do not hand-edit session files, `current_task`, task `status`, `stage_history`,
94
- `pending_transition`, workflow/TDD proposal or freeze fields, `memory_progress`, or `last_agent`.
118
+ - Workflow state operations use the script installed for the active host: Codex uses
119
+ `.codex/hooks/easy_coding_state.py`, while Qoder uses its installed `.qoder/hooks/easy_coding_state.py`
120
+ or `.qodercn/hooks/easy_coding_state.py` variant.
121
+ Never substitute one platform's script for the other, and pass only the canonical owner ID
122
+ (`codex` or `qoder`) to `--agent`; display attribution such as `Codex with Easy Coding` is not
123
+ a workflow identity. The installed script's embedded platform identity, canonical owner, and
124
+ injected session namespace must agree. Do not hand-edit session files, `current_task`, task
125
+ `status`, `stage_history`,
126
+ `pending_transition`, `verification_checkpoint`, workflow/TDD proposal or freeze fields,
127
+ `memory_progress`, or `last_agent`.
95
128
  - The hook injects `[easy-coding:session-file:P]`; pass that path to the state script with
96
129
  `--session-file <P>` when changing the current task or stage.
97
130
  - Workflow session files live at `{{workflow_state_path}}`; the CLI only installs files and
98
131
  creates the project-init task — agent skills perform all project analysis.
99
132
  - Cross-repo references in git-tracked task artifacts use repo NAMES, never local paths.
100
133
  Cache local paths only through the state script so they land on the current task.
134
+ - Shared Canonical writeback is a stage gate but not proof of Git commit/push, and Git delivery is
135
+ not proof of writeback. Keep those facts and scopes separate.
101
136
  {{supermodule_boundary}}
102
137
 
103
138
  <!-- ═══ end easy-coding-harness generated ═══ -->
@@ -31,7 +31,7 @@ platform prefixes such as `/` or `$`. If no status line is injected, do not inve
31
31
  - `/ec-brainstorming` — design exploration before building (hard design gate)
32
32
  - `/ec-analysis` `/ec-implementing` `/ec-reviewing` `/ec-verification` — workflow stages
33
33
  - `/ec-memory` — short/long memory archive
34
- - `/ec-task-management` — task lifecycle panel · `/ec-config` — Approval/Workflow/TDD settings · `/ec-task-close` — interrupt a task
34
+ - `/ec-task-management` — task lifecycle panel · `/ec-config` — Approval/Workflow/TDD settings · `/ec-tdd-init` — Java changed-line gate initialization · `/ec-task-close` — interrupt a task
35
35
  - `/ec-no-harness` — bypass only Easy Coding for the current session
36
36
  - `/ec-git` — git discipline · `/ec-meta` — understand/customize the harness
37
37
 
@@ -43,13 +43,19 @@ First run `/ec-init`; daily work goes through `/ec-workflow`.
43
43
  is session override > project `behavior.workflow_mode` > `adaptive`. Approval controls waiting;
44
44
  workflow controls execution depth. ANALYSIS shows and freezes adaptive to fast/standard/strict.
45
45
  Confirm approval waits only at ANALYSIS -> IMPLEMENT, then advances green later stages
46
- automatically. Every new code task runs REVIEW; no mode changes scope, delivery form, or
47
- evidence gates.
46
+ automatically; Auto advances all legal green edges. A new code diff after the VERIFICATION
47
+ checkpoint is the only exceptional pause across all modes: show the exact diff, bind acceptance
48
+ to its digest, and continue without rereview when the user accepts.
49
+ Every new code task runs REVIEW; no mode changes scope, delivery form, or evidence gates.
48
50
  - TDD is session override > project `behavior.tdd_enabled` > `false`; its changed-line threshold
49
51
  is session override > project `behavior.tdd_coverage_threshold` > `90`. ANALYSIS -> IMPLEMENT
50
- freezes both. Disabled TDD adds no CI scan, JaCoCo work, commands, artifacts, or stronger gates.
51
- Enabled TDD applies only to Java code tasks and requires lifecycle, review, local coverage, and
52
- GitLab TEST-stage gate evidence.
52
+ freezes both. TDD may be enabled only after `ec-tdd-init` records valid infrastructure readiness;
53
+ there is no enable-now/init-later state. The dedicated `tdd-init` task always freezes TDD off and
54
+ initializes only changed-line coverage infrastructure, never historical business-test coverage.
55
+ Disabled TDD adds no CI scan, JaCoCo work, commands, artifacts, or stronger gates. Enabled TDD
56
+ applies only to Java code tasks and requires lifecycle, review, passed local unit tests, and
57
+ local coverage for production lines changed since the task baseline. `ec-tdd-init` still
58
+ generates GitLab TEST-stage automation, but remote CI status is not Harness acceptance evidence.
53
59
  - Confirmation-required edges use `pending_transition`; automatic edges use the restricted
54
60
  `auto-transition` API. A read-only task creates no test-strategy.md, never enters REVIEW,
55
61
  VERIFICATION, or MEMORY, and writes no task memory.
@@ -70,15 +76,35 @@ First run `/ec-init`; daily work goes through `/ec-workflow`.
70
76
  only Easy Coding workflow/stage orchestration for this session. Continue honoring every
71
77
  non-Easy-Coding skill, hook, and instruction. Do not clear or mutate the suspended task.
72
78
  - ANALYSIS must follow template-first: read `.easy-coding/templates/dev-spec-skeleton.md` then
73
- write its exact content to the task's dev-spec.md as the FIRST tool calls. Next inspect evidence
74
- without editing the skeleton, ask every unresolved decision during analysis, and wait. Only
75
- after all decisions are resolved may the agent fill the complete dev-spec.md. The final report
76
- contains neither `[阶段:ANALYSIS]` nor a `待用户决策` section.
79
+ write its exact content to the task's dev-spec.md as the FIRST tool calls. Next inspect evidence,
80
+ set `decision_status: open`, ask every unresolved material decision, and progressively record
81
+ each confirmed answer and its evidence in `### 决策闭环`. Only after all material decisions are
82
+ resolved may the agent set the single `decision_status: closed`, finalize the artifacts, and
83
+ propose IMPLEMENT. The session presentation is a concise core-solution, acceptance, workflow,
84
+ and risk summary with an absolute local link/path to the full dev-spec.md; never paste the full
85
+ artifact by default. The final artifact contains neither `[阶段:ANALYSIS]` nor a
86
+ `待用户决策` section.
77
87
  - REVIEW and VERIFICATION are fingerprinted hard gates. Review evidence must match the final
78
88
  implementation; verification evidence must match final implementation and config. The frozen
79
89
  workflow mode selects targeted, impacted, or full commands without weakening the green gate.
90
+ Freeze a verification checkpoint after green checks. Unchanged checkpoints follow approval
91
+ mode normally; post-checkpoint code drift requires exact digest acceptance and
92
+ carry-forward/targeted/waived verification policy, but never an automatic second REVIEW.
93
+ - Canonical-backed tasks bind static validity to design revision + `design_sha256`, while
94
+ `document_sha256` and `execution_revision` may advance through shared writer commands. Project-
95
+ external explicit Spec paths are allowed and may be repaired only with identity-checked rebind.
96
+ Runtime progress must use the shared writer with CAS/idempotency and reconciliation; static
97
+ design changes require revision + READY + `sync-spec-design`. Never hand-edit `EDS:EXECUTION`.
98
+ Selected source tasks remain `implemented` through local VERIFICATION and become `verified`
99
+ only when the accepted VERIFICATION -> MEMORY boundary is actually applied.
100
+ - Canonical routing is two-pass: first use manifest-only discovery for the current worktree, then
101
+ inspect only the explicitly selected task IDs and repositories. A remote-confirmed worktree
102
+ overrides a stale `path_hint`; never mirror the source Spec or re-check unselected repositories.
103
+ ANALYSIS reads the selected consumption closure once and treats exact/scope-unchanged as a fast
104
+ projection, while shared execution is the dependency fact source.
80
105
  - MEMORY combines short-memory creation and the conditional long-memory gate. Entry follows the
81
- effective confirmation mode; once memory processing completes, COMPLETE is automatic.
106
+ effective confirmation mode; its checkpoint records any accepted post-verification diff digest
107
+ and decision. Once memory processing completes, COMPLETE is automatic.
82
108
  - NO CODE-TASK COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE.
83
109
  - All cross-platform modules (skills, hooks, references) must use universal agent protocols.
84
110
  Do not rely on any specific agent's proprietary conventions unless the module is explicitly
@@ -87,15 +113,21 @@ First run `/ec-init`; daily work goes through `/ec-workflow`.
87
113
 
88
114
  ## Runtime contract
89
115
 
90
- - Workflow state operations go through `{{platform_config_dir}}/hooks/easy_coding_state.py`;
91
- do not hand-edit session files, `current_task`, task `status`, `stage_history`,
92
- `pending_transition`, workflow/TDD proposal or freeze fields, `memory_progress`, or `last_agent`.
116
+ - Workflow state operations go through `{{platform_config_dir}}/hooks/easy_coding_state.py` and
117
+ pass only the canonical owner ID `claude-code` to `--agent`; display attribution such as
118
+ `Claude with Easy Coding` is not a workflow identity. The installed script's embedded platform
119
+ identity, canonical owner, and injected session namespace must agree. Do not hand-edit session
120
+ files, `current_task`, task `status`, `stage_history`,
121
+ `pending_transition`, `verification_checkpoint`, workflow/TDD proposal or freeze fields,
122
+ `memory_progress`, or `last_agent`.
93
123
  - The hook injects `[easy-coding:session-file:P]`; pass that path to the state script with
94
124
  `--session-file <P>` when changing the current task or stage.
95
125
  - Workflow session files live at `{{workflow_state_path}}`; the CLI only installs files and
96
126
  creates the project-init task — agent skills perform all project analysis.
97
127
  - Cross-repo references in git-tracked task artifacts use repo NAMES, never local paths.
98
128
  Cache local paths only through the state script so they land on the current task.
129
+ - Shared Canonical writeback is a stage gate but not proof of Git commit/push, and Git delivery is
130
+ not proof of writeback. Keep those facts and scopes separate.
99
131
  {{supermodule_boundary}}
100
132
 
101
133
  <!-- ═══ end easy-coding-harness generated ═══ -->
@@ -18,6 +18,17 @@ complete exactly that unit. Your reply IS the return value, not a message to a h
18
18
  context is in the card.
19
19
  - Make no workflow stage-transition decisions; you do not know the state machine exists.
20
20
  - Follow the coding rules and architecture context embedded in the card.
21
+ - Follow the task card's `Local Baseline`: match nearby naming, control flow, null/error handling,
22
+ layering, object modeling, method granularity, literal usage, and comment style unless a stated
23
+ correctness, security, requirement, or hard-rule reason requires a deviation.
24
+ - Treat the task card's `Code Comments` author value and field/member/constant rules as mandatory.
25
+ - Do not add generic defensive null checks, speculative abstractions/layers, fragmented one-use
26
+ micro-methods, or a constant that exists only to hold one getter return.
27
+ - Local, obvious magic values are allowed when they match surrounding code; create constants for
28
+ reuse, stable domain/config/protocol semantics, or established project convention.
29
+ - Every method and field in a new core Java class, and every added or materially modified method
30
+ or field in an existing core Java class, must have meaningful Javadoc; comment complex logic
31
+ where intent or constraints are not obvious.
21
32
  - Treat acceptance criteria, test points, contracts, and risks in the card as required inputs.
22
33
  - Run the exact targeted checks requested by the card and report their real outcome.
23
34
  - Preserve each existing file's original encoding; never silently convert.
@@ -17,7 +17,12 @@ dimension named in your task card. Your reply IS the return value.
17
17
  - correctness → does the implementation match the dev-spec requirement? edge cases,
18
18
  null/empty handling, races, off-by-one.
19
19
  - compliance → does the code obey the RULES sections in the card? naming, format, comment
20
- language, error handling.
20
+ language, error handling, and the evidenced Local Baseline.
21
+ - Do not request defensive null checks, abstraction, constant extraction, or legacy-wide comment
22
+ cleanup solely as generic best practice. Flag unjustified local-style deviations, speculative
23
+ layers, fragmented one-use micro-methods, constants created only for a getter return, and
24
+ missing Javadoc on any method/field in a new core Java class or any added/materially modified
25
+ method/field in an existing core Java class.
21
26
  - `error` means a demonstrated acceptance, contract, security, or build failure. Use `warning`
22
27
  for a credible risk and `info` for non-blocking maintainability advice.
23
28
 
@@ -24,8 +24,15 @@
24
24
  - 需求 vs 现有代码:[[EC_TODO:填写结果或“无冲突”]]
25
25
  - Dev-Spec vs 现有代码:[[EC_TODO:填写结果或“无冲突”]]
26
26
 
27
+ ### 决策闭环
28
+ decision_status: [[EC_TODO:仅当所有实质性问题均已解决并回填后写 closed]]
29
+ - **已解决问题与结论**:[[EC_TODO:逐项记录影响技术路线、接口、模型、状态、范围或验收的问题及最终结论;无则写“无”]]
30
+ - **确认依据**:[[EC_TODO:用户答复、冻结 Spec、现有代码证据或“无额外决策”]]
31
+
27
32
  ### Canonical Spec 来源
28
- - **来源**:[[EC_TODO:非 Canonical 任务写“无”;否则填写 repo-relative path、spec_id、revision、SHA-256]]
33
+ - **来源定位**:[[EC_TODO:非 Canonical 任务写“无”;否则填写 path、path_mode、spec_id 与 design revision]]
34
+ - **设计 / 文档摘要**:[[EC_TODO:非 Canonical 任务写“无”;否则填写 design_sha256、document_sha256]]
35
+ - **共享执行状态**:[[EC_TODO:非 Canonical 任务写“无”;否则填写 execution_revision、writeback 状态及是否需要 reconcile]]
29
36
  - **选择任务 / 仓库**:[[EC_TODO:非 Canonical 任务写“无”;否则填写 selected task IDs 与 repo IDs]]
30
37
  - **消费闭包**:[[EC_TODO:非 Canonical 任务写“无”;否则填写 contracts、direct dependencies、changes、steps、tests 摘要]]
31
38
  - **基线与冲突**:[[EC_TODO:非 Canonical 任务写“无”;否则逐仓填写 exact/scope-unchanged/scope-drifted/baseline-unavailable 及处理结论]]