easy-coding-harness 0.10.0-beta.0 → 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 (35) hide show
  1. package/CHANGELOG.md +166 -0
  2. package/README.md +53 -19
  3. package/dist/cli.js +573 -53
  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 +20 -2
  11. package/templates/common/bundled-skills/ec-meta/references/local-architecture/README.md +33 -11
  12. package/templates/common/bundled-skills/ec-meta/references/platform-files/README.md +1 -1
  13. package/templates/common/skills/ec-analysis/SKILL.md +162 -26
  14. package/templates/common/skills/ec-config/SKILL.md +76 -0
  15. package/templates/common/skills/ec-git/SKILL.md +7 -1
  16. package/templates/common/skills/ec-implementing/SKILL.md +72 -1
  17. package/templates/common/skills/ec-memory/SKILL.md +77 -3
  18. package/templates/common/skills/ec-reviewing/SKILL.md +25 -1
  19. package/templates/common/skills/ec-task-close/SKILL.md +4 -0
  20. package/templates/common/skills/ec-task-management/SKILL.md +13 -32
  21. package/templates/common/skills/ec-tdd-init/SKILL.md +101 -0
  22. package/templates/common/skills/ec-verification/SKILL.md +91 -5
  23. package/templates/common/skills/ec-workflow/SKILL.md +86 -21
  24. package/templates/main-constraint/AGENTS.md.tpl +54 -12
  25. package/templates/main-constraint/CLAUDE.md.tpl +51 -12
  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_java_coverage.py +317 -0
  30. package/templates/runtime/tools/easy_coding_tdd_readiness.py +306 -0
  31. package/templates/shared-hooks/easy_coding_state.py +4782 -574
  32. package/templates/shared-hooks/easy_dev_spec.py +444 -30
  33. package/templates/shared-hooks/easy_dev_spec_execution.py +1014 -0
  34. package/templates/shared-hooks/easy_dev_spec_protocol.py +1426 -18
  35. package/templates/shared-hooks/inject-subagent-context.py +5 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-coding-harness",
3
- "version": "0.10.0-beta.0",
3
+ "version": "0.10.0-beta.10",
4
4
  "description": "CLI scaffold for installing Easy Coding harness files into agent-native directories.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,6 +16,17 @@ complete exactly that unit. Your reply IS the return value, not a message to a h
16
16
  file. All context you need is already in the task card.
17
17
  - Make no workflow stage-transition decisions. You do not know the state machine exists.
18
18
  - Follow the coding rules and architecture context embedded in the card.
19
+ - Follow the task card's `Local Baseline`: match nearby naming, control flow, null/error handling,
20
+ layering, object modeling, method granularity, literal usage, and comment style unless a stated
21
+ correctness, security, requirement, or hard-rule reason requires a deviation.
22
+ - Treat the task card's `Code Comments` author value and field/member/constant rules as mandatory.
23
+ - Do not add generic defensive null checks, speculative abstractions/layers, fragmented one-use
24
+ micro-methods, or a constant that exists only to hold one getter return.
25
+ - Local, obvious magic values are allowed when they match surrounding code; create constants for
26
+ reuse, stable domain/config/protocol semantics, or established project convention.
27
+ - Every method and field in a new core Java class, and every added or materially modified method
28
+ or field in an existing core Java class, must have meaningful Javadoc; comment complex logic
29
+ where intent or constraints are not obvious.
19
30
  - Treat acceptance criteria, test points, contracts, and risks in the card as required inputs.
20
31
  - Run the exact targeted checks requested by the card and report their real outcome.
21
32
  - Preserve each existing file's original encoding; never silently convert.
@@ -15,7 +15,12 @@ dimension named in your task card. Your reply IS the return value.
15
15
  - correctness → does the implementation match the dev-spec requirement? edge cases,
16
16
  null/empty handling, races, off-by-one.
17
17
  - compliance → does the code obey the RULES sections in the card? naming, format, comment
18
- language, error handling.
18
+ language, error handling, and the evidenced Local Baseline.
19
+ - Do not request defensive null checks, abstraction, constant extraction, or legacy-wide comment
20
+ cleanup solely as generic best practice. Flag unjustified local-style deviations, speculative
21
+ layers, fragmented one-use micro-methods, constants created only for a getter return, and
22
+ missing Javadoc on any method/field in a new core Java class or any added/materially modified
23
+ method/field in an existing core Java class.
19
24
  - `error` means a demonstrated acceptance, contract, security, or build failure. Use `warning`
20
25
  for a credible risk and `info` for non-blocking maintainability advice.
21
26
 
@@ -15,6 +15,17 @@ Hard constraints:
15
15
  the card.
16
16
  - Make no workflow stage-transition decisions; you do not know the state machine exists.
17
17
  - Follow the coding rules and architecture context embedded in the card.
18
+ - Follow the task card's "Local Baseline": match nearby naming, control flow, null/error handling,
19
+ layering, object modeling, method granularity, literal usage, and comment style unless a stated
20
+ correctness, security, requirement, or hard-rule reason requires a deviation.
21
+ - Treat the task card's "Code Comments" author value and field/member/constant rules as mandatory.
22
+ - Do not add generic defensive null checks, speculative abstractions/layers, fragmented one-use
23
+ micro-methods, or a constant that exists only to hold one getter return.
24
+ - Local, obvious magic values are allowed when they match surrounding code; create constants for
25
+ reuse, stable domain/config/protocol semantics, or established project convention.
26
+ - Every method and field in a new core Java class, and every added or materially modified method
27
+ or field in an existing core Java class, must have meaningful Javadoc; comment complex logic
28
+ where intent or constraints are not obvious.
18
29
  - Treat acceptance criteria, test points, contracts, and risks in the card as required inputs.
19
30
  - Run the exact targeted checks requested by the card and report their real outcome.
20
31
  - Preserve each existing file's original encoding; never silently convert.
@@ -14,7 +14,12 @@ Stance:
14
14
  - correctness -> does the implementation match the dev-spec requirement? edge cases,
15
15
  null/empty handling, races, off-by-one.
16
16
  - compliance -> does the code obey the RULES sections in the card? naming, format, comment
17
- language, error handling.
17
+ language, error handling, and the evidenced Local Baseline.
18
+ - Do not request defensive null checks, abstraction, constant extraction, or legacy-wide comment
19
+ cleanup solely as generic best practice. Flag unjustified local-style deviations, speculative
20
+ layers, fragmented one-use micro-methods, constants created only for a getter return, and
21
+ missing Javadoc on any method/field in a new core Java class or any added/materially modified
22
+ method/field in an existing core Java class.
18
23
  - error means a demonstrated acceptance, contract, security, or build failure. Use warning
19
24
  for a credible risk and info for non-blocking maintainability advice.
20
25
 
@@ -85,6 +85,11 @@ initialization standard. Check each item:
85
85
  and non-empty?
86
86
  - **Project profile**: `project.yaml` exists with `mode` and `test` fields (ec-init owns it;
87
87
  `config.yaml` is CLI-owned — not ec-init's concern)?
88
+ - **TDD runtime contract**: CLI-owned `config.yaml` has schema 5 TDD defaults and both
89
+ `.easy-coding/tools/easy_coding_java_coverage.py` and
90
+ `.easy-coding/tools/easy_coding_tdd_readiness.py` exist? Missing fields or tools mean
91
+ `easy-coding upgrade` is required; ec-init must not repair them directly. Project-specific
92
+ JaCoCo/GitLab readiness remains owned by `ec-tdd-init`, not `ec-init`.
88
93
  - **Platform hook config freshness**: for each installed platform in `.easy-coding/config.yaml`,
89
94
  read the platform hook config and verify managed Easy Coding hook commands use the portable
90
95
  relative hook launcher bound to this project root's `project.id`. If `project.id` is missing,
@@ -142,7 +147,14 @@ agent must be able to see what was generated and on what evidence.
142
147
  - Naming conventions actually in use (scan representative files)
143
148
  - Comment language: if more than 70% of existing comments are Chinese, the rule is
144
149
  "comments in Chinese"; same logic for English; mixed → follow each file's dominant language
145
- - Error handling style, import ordering, formatter/linter in use (read their configs)
150
+ - Null/empty handling and error-handling style, including where the project intentionally
151
+ relies on upstream contracts instead of adding defensive checks
152
+ - Existing class/method extraction granularity and architecture boundaries; do not turn a
153
+ preference for single responsibility into a generic demand for many one-use helpers
154
+ - Literal and constant conventions, including when local magic values are accepted and when
155
+ a stable domain/config/protocol value is promoted to a named constant
156
+ - Javadoc/doc-comment coverage for core code and the inline-comment style used for complex logic
157
+ - Import ordering and formatter/linter in use (read their configs)
146
158
  Structure as one section per language plus a General section. Every rule must be
147
159
  mechanically checkable — "be clean" is not a rule; "exported functions carry explicit
148
160
  return types" is.
@@ -154,6 +166,10 @@ agent must be able to see what was generated and on what evidence.
154
166
  tests live, naming conventions, coverage expectations, which classes of code this project
155
167
  tests vs skips. Also fill `project.yaml` `test.framework` and `test.command` with commands
156
168
  you verified exist (read package.json scripts or equivalent — do not guess).
169
+ If effective TDD is disabled, do not inspect JaCoCo or GitLab and do not add TDD-specific
170
+ requirements. If it is enabled for Java, additionally document JUnit/JaCoCo commands,
171
+ production/test source roots, XML report paths, the local acceptance gate, and the generated
172
+ GitLab TEST-stage job as non-blocking automation infrastructure.
157
173
  5. **Memory migration probe** — Check for old-format memory files:
158
174
  - `.easy-coding/memory/long/MEMORY.md` exists but lacks `memory_schema: 2` frontmatter
159
175
  - `.easy-coding/memory/long/BUSINESS.md` or `TECHNICAL.md` missing
@@ -182,7 +198,9 @@ agent must be able to see what was generated and on what evidence.
182
198
  - TEST_STRATEGY.md (skeleton for the chosen framework)
183
199
  3. **Skip ABSTRACT.md** — no architecture exists yet. Note in init_log:
184
200
  "ABSTRACT pending; ec-memory backfills after the first substantive task." (ec-memory
185
- detects the missing file during MEMORY and generates it from the then-current code.)
201
+ detects the missing file during MEMORY and uses the explicit `missing-abstract` assessment
202
+ exception to generate it from the then-current code. This one-time backfill does not enable
203
+ routine per-task architecture updates.)
186
204
  4. Memory migration probe and memory init, same as iterative steps 5-7.
187
205
  5. Recommend: design first with `{{skill_trigger}}ec-brainstorming`, then build via
188
206
  `{{skill_trigger}}ec-workflow`.
@@ -49,12 +49,24 @@ automatic edges. A validated read-only `doc` / `analysis` / `report` task also a
49
49
  from IMPLEMENT after its full deliverable is shown, without REVIEW, VERIFICATION, MEMORY, or
50
50
  task memory. Approval mode controls non-mechanical edge waiting: approve confirms each edge,
51
51
  guard confirms two critical gates, confirm waits only at ANALYSIS -> IMPLEMENT, and auto
52
- advances every legal edge after mechanical gates.
52
+ advances every legal edge after mechanical gates. After green VERIFICATION, Harness freezes an
53
+ acceptance checkpoint. A later code diff temporarily pauses every mode so the exact digest can be
54
+ accepted; unchanged `confirm`/`auto` tasks remain automatic.
53
55
  Workflow mode is independently configured as adaptive/fast/standard/strict; ANALYSIS freezes
54
56
  adaptive to a concrete mode, and every new code task still enters REVIEW. REVIEW evidence is
55
57
  bound to the final implementation fingerprint, VERIFICATION evidence is bound to implementation
56
- and config fingerprints, and MEMORY keeps the conditional long-memory threshold gate. The active task
57
- pointer lives in `sessions/{agent}-{session-id}.json` (with an agent-prefixed PPID fallback only
58
+ and config fingerprints, and an accepted post-checkpoint diff records its authorization plus
59
+ carry-forward/targeted/waived policy without forcing a second REVIEW. MEMORY keeps the conditional
60
+ long-memory threshold gate.
61
+
62
+ Java TDD is a third independent, default-off control managed by `ec-config`. Session overrides
63
+ project configuration; ANALYSIS freezes enabled state and the 1..100 changed-line threshold
64
+ (default 90) on entry to IMPLEMENT. Disabled TDD changes no ordinary workflow test depth. Enabled
65
+ TDD adds lifecycle evidence, a TDD review dimension, passed local unit-test evidence, and a local
66
+ JaCoCo diff gate. `ec-tdd-init` still generates the equivalent GitLab TEST-stage job, but remote
67
+ pipeline execution and status are not Harness acceptance dependencies.
68
+
69
+ The active task pointer lives in `sessions/{agent}-{session-id}.json` (with an agent-prefixed PPID fallback only
58
70
  when a hook payload has no logical session ID);
59
71
  when the task reaches `COMPLETE` or `CLOSED`, the state API clears `current_task` so the
60
72
  session returns to Ready. Each task's stage persists in its `task.json`. Hooks inject the
@@ -70,35 +82,45 @@ stage in `task.json`; no data is lost. Each task folder is self-contained.
70
82
  Each task is a folder. `task.json` is metadata, including the current stage, workflow proposal,
71
83
  frozen concrete mode, and any `pending_transition`; `dev-spec.md` is the human-readable plan;
72
84
  `execution.jsonl` is an append-only plan-and-log (one `plan` record, then `dispatch`/`result`
73
- /`review`/`verify`/`handoff` records). Because plan and log live on disk, not in an agent's
85
+ /`review`/`verify`/`acceptance`/`handoff` records). Because plan and log live on disk, not in an agent's
74
86
  context window, a task survives session end and agent switches with zero information loss.
75
87
 
76
88
  ## Canonical Spec integration
77
89
 
78
- An `easy-dev-spec/v1` Canonical Spec is a read-only design source, not progress storage.
90
+ An `easy-dev-spec/v1` Canonical Spec separates frozen static design from a shared execution ledger.
79
91
  `inspect-dev-spec` validates the document with the protocol implementation pinned from
80
92
  `easy-dev-spec@7eb9b64`; after explicit task selection, `select-dev-spec-scope` returns one
81
93
  deterministic producer-compatible closure per repository, and `create-task-from-spec` creates one
82
- Harness task with the source ID/revision/SHA, selected task IDs, portable repository bindings,
94
+ Harness task with source locator mode, ID/design revision and digest, document digest, execution
95
+ revision, selected task IDs, repository bindings,
83
96
  baseline classifications, and dependency evidence.
84
97
 
85
98
  ANALYSIS derives local `dev-spec.md`, `execution.jsonl`, and `test-strategy.md` for the selected
86
99
  consumption closure. Canonical-backed units keep repository, source task/steps, files, symbols,
87
100
  and test commands. Hard dependencies shape the Unit DAG, READY contracts can run in parallel,
88
- and integration dependencies block end-to-end completion until evidence is recorded. The source
89
- Canonical Spec is never rewritten with Harness runtime state.
101
+ and integration dependencies block end-to-end completion until evidence is recorded. Harness
102
+ keeps detailed evidence locally and projects cross-application Task/Step/dependency outcomes into
103
+ `EDS:EXECUTION` through one CAS/idempotent writer. Static changes use revision + READY +
104
+ `sync-spec-design`; agents never hand-edit the machine ledger. Explicit external locators are
105
+ allowed and rebind only by exact Canonical identity. Source tasks stay `implemented` after local
106
+ checks and become `verified` only when VERIFICATION -> MEMORY is applied under explicit or
107
+ standing approval-mode authorization; the shared event includes the acceptance digest.
90
108
 
91
109
  ## Memory system
92
110
 
93
111
  Short memory: one schema-v2 file per task, sliding window (max 10, keep 5). Long memory:
94
112
  three files (index + business + technical), distilled from out-of-window short memories with
95
- explicit conflict resolution. ABSTRACT.md is backfilled/updated when memory distillation
96
- detects an architecture change.
113
+ explicit conflict resolution. Daily tasks only produce facts. When distillation runs, MEMORY
114
+ performs a separate, default-no-op architecture assessment and updates only affected ABSTRACT
115
+ sections when frozen evidence proves the architecture cognition is stale. A missing ABSTRACT
116
+ after the first substantive startup task is the only non-distillation backfill exception.
97
117
 
98
118
  ## Project knowledge — four layers
99
119
 
100
120
  Identity (SOUL, rarely changes) · Constraints (RULES, stable) · Cognition (ABSTRACT, updated
101
- on architecture change) · Memory (short + long, updated every task). ec-workflow always reads
121
+ only after evidence-backed architecture assessment) · Memory (short every task, long only on
122
+ distillation). Stable convention changes become RULES candidates in technical memory, never
123
+ silent RULES edits. ec-workflow always reads
102
124
  SOUL + RULES + recent short memory; ec-analysis loads ABSTRACT and matching long memory on
103
125
  demand.
104
126
 
@@ -14,7 +14,7 @@ What lives in each platform directory and how the three platforms differ.
14
14
  | Sub-agent defs | `.claude/agents/*.md` | `.codex/agents/*.toml` | `.qoder/agents/*.md` |
15
15
  | CN variant | — | — | `.qodercn/` |
16
16
 
17
- Each skill is installed as `{skills-dir}/ec-{name}/SKILL.md`. The 12 skills are
17
+ Each skill is installed as `{skills-dir}/ec-{name}/SKILL.md`. The 15 skills are
18
18
  platform-agnostic — one template, resolved per platform at write time. The agent's native
19
19
  discovery surfaces them under `/ec-` or `$ec-`.
20
20
 
@@ -21,13 +21,25 @@ Communicate with the user in the user's language.
21
21
  4. Inspect concrete code paths and tests. Expand context only when evidence reveals another
22
22
  dependency or risk.
23
23
 
24
- For a task with `task.json.spec_source`, re-run `inspect-dev-spec` against the stored source and
25
- every stored `task.repo_paths` repository binding. The schema, spec ID, revision, and SHA-256
26
- must still match. Then call the read-only selector for the exact stored selection:
24
+ Apply a progressive cost budget while doing this work. A likely Fast task reads only the nearest
25
+ comparable implementation, its direct contracts, and targeted tests. Standard reads the affected
26
+ module closure. Expand into cross-module or repository-wide context only after concrete evidence
27
+ shows the compound high-risk and complexity signals required for Strict. Do not scan unrelated
28
+ repositories, the full Spec, broad Git history, or every architecture section merely to prove
29
+ that a bounded task might be complicated.
30
+
31
+ For a task with `task.json.spec_source`, re-run `inspect-dev-spec` against the stored source, exact
32
+ `selected_spec_tasks`, and only their stored `task.repo_paths` bindings. Schema, Spec ID, design
33
+ revision, and `design_sha256` must still match. A changed `document_sha256` with the same design is
34
+ normal shared progress; refresh `execution_revision` without invalidating plan/review/verify
35
+ evidence. An execution revision rollback is blocking. Then call the selector once for the exact
36
+ selection:
27
37
 
28
38
  ```bash
29
39
  {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py inspect-dev-spec \
30
- --spec <stored-source> --repo-path <repo-id>=<stored-path> [--repo-path <repo-id>=<stored-path>]...
40
+ --spec <stored-source> \
41
+ --spec-task <selected-task-id> [--spec-task <selected-task-id>]... \
42
+ [--repo-path <repo-id>=<stored-path>]...
31
43
 
32
44
  {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py select-dev-spec-scope \
33
45
  --spec <stored-source> --spec-task <selected-task-id> [--spec-task <selected-task-id>]...
@@ -36,19 +48,66 @@ must still match. Then call the read-only selector for the exact stored selectio
36
48
  Load only the returned per-repository consumption closures: manifest/global context, selected
37
49
  task and repository sections, related contracts, direct dependency summaries, selected
38
50
  changes/steps/tests, and relevant integration rows. Never replace the selector with a whole-file
39
- read. `scope-drifted` requires current-code conflict analysis before confirmation;
40
- `baseline-unavailable` or unresolved repository identity remains blocked in ANALYSIS.
51
+ read. Treat the Canonical closure as frozen design, not as a prompt to design the task again:
52
+
53
+ - `exact` and `scope-unchanged` use the fast projection path. Confirm the selected paths, symbols,
54
+ and test entry points, then map the closure into Units, `test-strategy.md`, and the derived
55
+ `dev-spec.md` in one pass. Do not reselect interfaces, fields, task boundaries, Steps, or Tests,
56
+ and do not ask questions already answered by the source Spec.
57
+ - `scope-drifted` reads and analyzes only changed files and symbols in the selected task scope.
58
+ Escalate to a static design revision only when that evidence changes a frozen contract or task
59
+ boundary; unrelated repository or completed-task changes are background, not current drift.
60
+ - `baseline-unavailable` or unresolved selected-repository identity remains blocked in ANALYSIS.
61
+
62
+ Use shared execution dependency status directly. Do not inspect another local Harness task or Git
63
+ history to re-prove a completed hard dependency, and do not repeat dependency or baseline
64
+ explanations after the selected inspection has recorded them.
65
+
66
+ ## Local implementation baseline
67
+
68
+ For every code unit, inspect the nearest same-module, same-role implementation before planning.
69
+ Record a concise `local_baseline` covering only evidenced conventions that affect this change:
70
+ naming and control flow, null/empty and error handling, layering and dependency direction, object
71
+ modeling, method extraction granularity, literal/constant usage, and comments/Javadoc. Prefer the
72
+ closest comparable code over a repository-wide average. Explicit requirements, correctness,
73
+ security, and project hard rules still take precedence; otherwise do not replace safe local
74
+ conventions with generic best practices.
75
+
76
+ Do not ask the user to choose a style already answered consistently by comparable code. Ask only
77
+ when local evidence conflicts or a deviation can change the contract, risk, or acceptance result.
41
78
 
42
79
  ## Analysis artifacts
43
80
 
44
81
  Copy `.easy-coding/templates/dev-spec-skeleton.md` first, then replace every `[[EC_TODO:...]]`.
45
- Keep every mandatory section. `### Workflow Mode` is required.
82
+ Keep every mandatory section. The `### 决策闭环` (Decision Closure) and `### Workflow Mode`
83
+ sections are required. The decision section must contain exactly one standalone
84
+ `decision_status: closed` marker, and no other `decision_status` marker may appear elsewhere in
85
+ the document. Record every material question and its resolved conclusion in that section, or
86
+ record that no extra decision was needed.
87
+
88
+ ## Decision closure before implementation
89
+
90
+ Treat uncertainty that can change the technical route, public or internal contract, data model,
91
+ state flow, edit scope, compatibility behavior, or acceptance criteria as a material open
92
+ question. While any such question remains:
93
+
94
+ 1. stay in ANALYSIS and ask the user focused questions, preferably one decision at a time;
95
+ 2. do not present a final analysis summary, propose the final Workflow Mode, request
96
+ ANALYSIS -> IMPLEMENT, or suggest that implementation can begin;
97
+ 3. update the Dev-Spec with each confirmed answer and its evidence;
98
+ 4. use `decision_status: open` while the artifact is still being developed, then replace it with
99
+ the single `decision_status: closed` marker only after every material question is resolved.
100
+
101
+ Risks, integration work that is intentionally deferred by a frozen Spec, and environmental
102
+ verification limits are not automatically open questions. Describe them as risks or explicit
103
+ acceptance boundaries. Never use `closed` to hide a decision that still needs the user.
46
104
 
47
105
  Execution plan records use:
48
106
 
49
107
  ```json
50
108
  {
51
109
  "type": "plan",
110
+ "spec_design_sha256": "<Canonical design digest; omit for ordinary tasks>",
52
111
  "strategy": "single|sequential|parallel",
53
112
  "units": [{
54
113
  "id": "U1",
@@ -62,6 +121,7 @@ Execution plan records use:
62
121
  "test_points": ["targeted check"],
63
122
  "contracts": ["input/output/invariant or none"],
64
123
  "risks": ["known risk or none"],
124
+ "local_baseline": ["evidenced local convention and source path"],
65
125
  "repo_id": "R1",
66
126
  "source_task_id": "R1-T1",
67
127
  "source_step_ids": ["S1"],
@@ -78,21 +138,70 @@ units together must cover every source step exactly once. Map selected hard depe
78
138
  `parallel_groups`.
79
139
 
80
140
  Canonical-backed `dev-spec.md`, `execution.jsonl`, and `test-strategy.md` are runtime-derived
81
- evidence, not a second maintained Spec. Record the source path/ID/revision/SHA, selected tasks
141
+ evidence, not a second maintained Spec. Record the source path/path mode/ID/design revision and
142
+ digest, current document digest/execution revision/writeback status, selected tasks
82
143
  and repositories, baseline/conflict result, Unit mapping, source test mapping, and pending
83
144
  integration edges.
84
145
 
146
+ The required skeleton is a mechanical artifact schema. For a Canonical-backed task it is filled
147
+ from the selected closure and current-code delta; it must never become a second round of Spec
148
+ authoring.
149
+
85
150
  Every source test command remains mandatory. Additional commands from the current repository are
86
151
  allowed only when `test-strategy.md` records why the Canonical command alone is insufficient.
87
152
  For every selected source test, `test-strategy.md` must spell out its Test ID, source task ID,
88
153
  owning Unit ID, repository-relative test file, and exact Canonical command; the state gate checks
89
154
  these markers mechanically.
90
155
 
91
- Prefer one coherent unit over artificial file-level splitting. Use parallel only for truly
92
- independent write scopes. Better unit contracts reduce later REVIEW rework.
156
+ Prefer one coherent unit over artificial file-level splitting. Do not split a class or method by
157
+ line count, or create many one-use helpers, merely to make the plan look modular. Extract only a
158
+ clear semantic boundary, reuse point, or independently testable responsibility. Use parallel only
159
+ for truly independent write scopes. Better unit contracts reduce later REVIEW rework.
93
160
 
94
161
  Code tasks require `test-strategy.md`; explicit `doc`, `analysis`, and `report` tasks do not.
95
162
 
163
+ ## Optional Java TDD analysis
164
+
165
+ Read `effective_tdd_enabled` and `effective_tdd_coverage_threshold` from the state snapshot.
166
+ For a `type=tdd-init` task, treat frozen TDD as off even if the project/session requests it. That
167
+ task is the sole exception allowed to inspect and plan build/CI coverage infrastructure while TDD
168
+ is off. Its scope is infrastructure only: never plan historical business-test backfill or a
169
+ repository-wide coverage target, and explicitly record `coverage scope: changed production lines`.
170
+
171
+ When TDD is disabled, stop here: do not inspect GitLab CI or JaCoCo, do not add TDD fields or
172
+ extra tests, and do not strengthen the selected Workflow Mode's ordinary acceptance depth. This
173
+ zero-cost rule applies to ordinary tasks, not the explicit `tdd-init` infrastructure task above.
174
+
175
+ When TDD is enabled for a Java code task, make `test-strategy.md` record:
176
+
177
+ - detected Java/JUnit build system, exact unit-test command, production/test source roots, and
178
+ JaCoCo XML paths;
179
+ - immutable Git baseline SHA and the configured changed-production-line threshold; design tests
180
+ toward 100% while treating the threshold as the mechanical minimum;
181
+ - feature/bug RED -> GREEN -> REFACTOR evidence, or for pure refactors a pre-change
182
+ characterization GREEN -> post-change GREEN sequence without inventing a RED failure;
183
+ - the local unit-test command and local changed-line acceptance command. Record that
184
+ `ec-tdd-init` generated the GitLab TEST-stage job, but remote execution, pipeline identity, and
185
+ status are non-blocking and never require an intermediate commit or push. Include these exact,
186
+ language-independent contract markers: `local_test_gate: required` and
187
+ `remote_ci_acceptance: non-blocking`.
188
+ - current `tdd_readiness_status=ready`; if missing or drifted, stop before IMPLEMENT and route to
189
+ `ec-tdd-init`. Never plan to initialize CI inside an already-enabled TDD feature task.
190
+
191
+ The state API mechanically freezes current Git `HEAD` per repository into `task.tdd_baselines`
192
+ when ANALYSIS advances to IMPLEMENT. Plan the local command with that exact SHA and the frozen
193
+ threshold. The generated GitLab job remains parameterized for infrastructure parity, but the
194
+ Harness acceptance plan never waits for remote CI. Never use a mutable `HEAD` fallback at
195
+ verification time. Non-Canonical TDD is limited to one Git repository; multi-repository TDD must
196
+ use Canonical repository bindings.
197
+
198
+ Also append a `### TDD Mode` section to `dev-spec.md` with enabled state, frozen threshold,
199
+ baseline, local unit-test gate, local coverage gate, generated GitLab job as non-blocking
200
+ infrastructure, and lifecycle evidence. Do not add this section when TDD is disabled.
201
+
202
+ If the task is not a Java project, explain that Java-only TDD cannot be activated and obtain a
203
+ mode decision before advancing. The CLI never installs JaCoCo or edits CI automatically.
204
+
96
205
  ## Workflow mode calculation
97
206
 
98
207
  Resolve configured mode from the state snapshot:
@@ -110,19 +219,30 @@ Use its `minimum_mode` and `reasons` as the proposal floor. You may raise this r
110
219
  uncertainty or user preference requires more rigor, but never lower or replace it with a
111
220
  self-reported floor. The state API rechecks the floor when the proposal is saved and frozen.
112
221
 
113
- The calculation classifies:
114
-
115
- - `fast`: one low-risk unit, local behavior, no public contract/schema/security/concurrency or
116
- migration impact, targeted test available.
117
- - `standard`: ordinary multi-file feature/fix, bounded contract impact, existing patterns and
118
- impacted tests available.
119
- - `strict`: state machine, configuration/schema migration, security/payment/data-loss risk,
120
- public or cross-repository contract, broad concurrency, platform generators, or uncertain
121
- blast radius.
222
+ The calculation is intentionally Standard-centered:
223
+
224
+ - `fast`: one coherent, non-parallel unit in one actually modified repository, at most five
225
+ changed files, no explicit high-risk signal, and no public or cross-repository contract impact.
226
+ Small parameter changes, bounded field/mapping edits, and a few ordinary model files should
227
+ normally remain Fast.
228
+ - `standard`: the default for ordinary business work. Multiple units/files, bounded compatibility
229
+ work, actual but contained multi-repository changes, broad low-risk work, and bounded high-risk
230
+ work remain Standard.
231
+ - `strict`: requires both an explicit high-risk signal and concrete complexity/blast-radius
232
+ evidence. Complexity means actual multi-repository edits, at least four units, at least ten
233
+ changed files, or a public/cross-repository contract. Parallel execution is a Standard signal
234
+ by itself. Generic domain words in a risk description, title, file path, Spec repository
235
+ catalog, or unselected task are never sufficient evidence of high risk.
236
+
237
+ Repository count comes only from repositories that own files in current plan units. Canonical
238
+ Spec metadata, unselected tasks, dependency summaries, unused `repo_paths`, and supermodule child
239
+ registrations do not raise the mode. A real multi-repository change is a Standard signal by
240
+ itself and reaches Strict only when an explicit high-risk signal is also present.
122
241
 
123
242
  If configuration is concrete, it is also a floor. The selected mode may be raised by the user
124
- but never placed below either floor. Explain the decision and state-specific effects in the
125
- dev-spec.
243
+ but never placed below either floor. The Agent must not raise an adaptive proposal to Strict from
244
+ vague uncertainty or a domain keyword; cite both the explicit risk and the concrete complexity
245
+ signal. Explain the decision and state-specific effects in the dev-spec.
126
246
 
127
247
  Persist the proposal before requesting ANALYSIS -> IMPLEMENT:
128
248
 
@@ -141,14 +261,22 @@ while still in ANALYSIS.
141
261
 
142
262
  ## User presentation and transition
143
263
 
144
- Before the boundary, present:
264
+ After decision closure and before the boundary, present a concise session summary instead of
265
+ pasting the full `dev-spec.md`. The summary must contain:
145
266
 
146
- - proposed scope and units;
147
- - acceptance and test strategy;
267
+ - the core solution and affected scope/units;
268
+ - acceptance and test-strategy highlights;
148
269
  - configured, minimum, and selected workflow modes with reasons;
149
- - how IMPLEMENT, REVIEW, VERIFICATION, and MEMORY will run;
270
+ - the material risks and explicit acceptance boundaries;
150
271
  - explicit user ability to request a higher mode or a permitted lower mode.
151
272
 
273
+ End the summary with the absolute path to
274
+ `.easy-coding/tasks/<task-id>/dev-spec.md`. When the current client supports local-file Markdown
275
+ links, render `[View full Dev-Spec](</absolute/path/to/dev-spec.md>)`; otherwise print the
276
+ copyable absolute path. Do not dump the full artifact merely because the client cannot link it.
277
+ If the user asks to inspect the full plan, open or read that stored file on demand using the
278
+ current Agent's supported file capability.
279
+
152
280
  Then request or auto-apply ANALYSIS -> IMPLEMENT according to `effective_approval_mode`.
153
281
  The state API atomically freezes the proposal when the transition is applied. `approval_mode`
154
282
  controls waiting; it never changes the selected execution depth.
@@ -159,6 +287,14 @@ controls waiting; it never changes the selected execution depth.
159
287
  - No unresolved skeleton placeholders.
160
288
  - No code task with an empty change scope.
161
289
  - No unit without acceptance criteria, test points, contracts, and risks.
290
+ - No final summary, workflow proposal, or transition while a material decision is unresolved.
291
+ - No transition without exactly one `decision_status: closed` marker in `dev-spec.md`.
162
292
  - No transition without a valid workflow proposal.
163
- - No Canonical-backed transition with changed source SHA, unresolved repository identity,
293
+ - No Canonical-backed transition with changed design revision/digest, a backward execution
294
+ revision, pending/conflicted writeback, unresolved repository identity,
164
295
  incomplete selected-task coverage, or an open Unit/Step/File/Symbol/Test traceability gap.
296
+
297
+ If evidence requires changing Canonical task boundaries, contracts, files, symbols, Steps, Tests,
298
+ or dependencies, remain/return to ANALYSIS, update the original static design with revision +1,
299
+ restore READY, and call `sync-spec-design --affected-task ...`. This invalidates the old local
300
+ plan. Never substitute edits to the derived `dev-spec.md`, and never edit `EDS:EXECUTION` by hand.
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: ec-config
3
+ description: Inspect and configure Easy Coding project/session Approval, Workflow, and Java TDD modes.
4
+ ---
5
+
6
+ # ec-config — mode configuration
7
+
8
+ Communicate in the user's language. A bare invocation is read-only: show the configuration panel
9
+ and available actions. Never mutate project or session settings without an explicit user choice.
10
+
11
+ ## Configuration panel
12
+
13
+ Call `snapshot` and show project, session, effective, and frozen task values for:
14
+
15
+ - `approval_mode`;
16
+ - `workflow_mode`;
17
+ - `tdd_enabled` and `tdd_coverage_threshold`.
18
+
19
+ Use the returned fields directly, including `project_tdd_enabled`, `session_tdd_enabled`,
20
+ `effective_tdd_enabled`, their threshold counterparts, `task_tdd_enabled`, and the task's
21
+ per-repository `task_tdd_baselines` frozen state. When `tdd_readiness_status=not_checked` because
22
+ TDD is off, explicitly run the read-only readiness command below before showing readiness:
23
+
24
+ ```bash
25
+ python3 .easy-coding/tools/easy_coding_tdd_readiness.py --cwd . check
26
+ ```
27
+
28
+ This explicit configuration-panel check is the only disabled-mode readiness scan; ordinary hooks
29
+ must not inspect build or CI files while TDD is off.
30
+
31
+ Explain precedence as `session override > project config > defaults`. Defaults are Approval
32
+ `guard`, Workflow `adaptive`, TDD disabled, and TDD changed-line coverage threshold 90%. An active
33
+ task freezes its effective TDD values when ANALYSIS advances to IMPLEMENT; later project/session
34
+ changes affect future tasks and ANALYSIS only.
35
+
36
+ Approval semantics stay independent from verification depth: `approve` waits at each
37
+ non-mechanical edge, `guard` waits at ANALYSIS -> IMPLEMENT and VERIFICATION -> MEMORY, `confirm`
38
+ waits only for the plan, and `auto` advances legal green edges immediately. Every mode temporarily
39
+ pauses only when code changes after the frozen VERIFICATION checkpoint, because the user must see
40
+ and accept that exact new diff; this exception does not convert `auto` into `guard`.
41
+
42
+ ## Project configuration
43
+
44
+ Use `easy-coding config` for project settings. The CLI confirms one atomic update of Approval,
45
+ Workflow, TDD, and (when enabled) the threshold. The threshold must be an integer from 1 to 100.
46
+ Enabling TDD is rejected atomically unless `ec-tdd-init` readiness is currently `ready`.
47
+
48
+ ## Session configuration
49
+
50
+ After explicit user selection, use the current logical session file:
51
+
52
+ ```bash
53
+ # approval
54
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py set-approval-mode --mode approve|guard|confirm|auto --agent <agent-id> --session-file <P>
55
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py clear-approval-mode --agent <agent-id> --session-file <P>
56
+
57
+ # workflow
58
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py set-workflow-mode --mode adaptive|fast|standard|strict --agent <agent-id> --session-file <P>
59
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py clear-workflow-mode --agent <agent-id> --session-file <P>
60
+
61
+ # TDD; omitting threshold preserves an existing session threshold, otherwise project/default 90 applies
62
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py set-tdd --enabled true|false [--threshold 1..100] --agent <agent-id> --session-file <P>
63
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py clear-tdd --agent <agent-id> --session-file <P>
64
+ ```
65
+
66
+ Turning TDD off must preserve the existing Fast/Standard/Strict test depth exactly: do not inspect
67
+ CI, request JaCoCo, add TDD artifacts, run coverage commands, or strengthen acceptance criteria.
68
+ When TDD is on, explain that it applies only to Java code tasks and activates RED/GREEN/REFACTOR,
69
+ TDD review, a passed local unit-test gate, and local changed-line JaCoCo coverage. `ec-tdd-init`
70
+ still generates the GitLab TEST-stage job, but Harness does not wait for or record remote pipeline
71
+ results as acceptance evidence.
72
+
73
+ Before any project/session enable action, require `tdd_readiness_status=ready`. If it is not ready,
74
+ offer only `ec-tdd-init` or cancellation; never offer or persist "enable now, initialize later".
75
+ Readiness means infrastructure can measure future changed production lines. It does not certify
76
+ repository-wide coverage and does not require tests for unchanged historical code.
@@ -62,7 +62,13 @@ with `.easy-coding/sessions/` always excluded. The CLI already added it to `.git
62
62
  - Do not commit `spec/dev/` unless the user explicitly asks.
63
63
  - Do not omit managed `easy-coding upgrade` changes merely because they were created outside
64
64
  the current agent turn.
65
- - Never modify or stage the source Canonical Spec merely to record Harness execution progress.
65
+ - Shared Canonical execution writeback and Git delivery are independent facts. Do not stage or
66
+ commit a project-external Spec automatically. For a Spec inside a Git repository, include it
67
+ only when the user's requested commit scope and normal repository rules include it; never claim
68
+ shared writeback merely because Git succeeded, or Git delivery merely because writeback
69
+ succeeded.
70
+ - Never hand-edit `EDS:EXECUTION`. Static Spec changes are valid only through design revision +
71
+ READY + `sync-spec-design`; runtime progress uses the shared writer commands.
66
72
  - In a supermodule task launched from the parent root, parent `.easy-coding/` belongs to the
67
73
  parent git. Child `.easy-coding/memory/` changes created by memory archive belong to the
68
74
  owning child git and must be committed before the parent gitlink update.