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

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-coding-harness",
3
- "version": "0.9.1",
3
+ "version": "0.10.0-beta.1",
4
4
  "description": "CLI scaffold for installing Easy Coding harness files into agent-native directories.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -85,6 +85,9 @@ 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 4 TDD defaults and
89
+ `.easy-coding/tools/easy_coding_java_coverage.py` exists? Missing fields or tool mean
90
+ `easy-coding upgrade` is required; ec-init must not repair them directly.
88
91
  - **Platform hook config freshness**: for each installed platform in `.easy-coding/config.yaml`,
89
92
  read the platform hook config and verify managed Easy Coding hook commands use the portable
90
93
  relative hook launcher bound to this project root's `project.id`. If `project.id` is missing,
@@ -154,6 +157,9 @@ agent must be able to see what was generated and on what evidence.
154
157
  tests live, naming conventions, coverage expectations, which classes of code this project
155
158
  tests vs skips. Also fill `project.yaml` `test.framework` and `test.command` with commands
156
159
  you verified exist (read package.json scripts or equivalent — do not guess).
160
+ If effective TDD is disabled, do not inspect JaCoCo or GitLab and do not add TDD-specific
161
+ requirements. If it is enabled for Java, additionally document JUnit/JaCoCo commands,
162
+ production/test source roots, XML report paths, and the existing GitLab TEST-stage gate.
157
163
  5. **Memory migration probe** — Check for old-format memory files:
158
164
  - `.easy-coding/memory/long/MEMORY.md` exists but lacks `memory_schema: 2` frontmatter
159
165
  - `.easy-coding/memory/long/BUSINESS.md` or `TECHNICAL.md` missing
@@ -53,8 +53,15 @@ advances every legal edge after mechanical gates.
53
53
  Workflow mode is independently configured as adaptive/fast/standard/strict; ANALYSIS freezes
54
54
  adaptive to a concrete mode, and every new code task still enters REVIEW. REVIEW evidence is
55
55
  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
56
+ and config fingerprints, and MEMORY keeps the conditional long-memory threshold gate.
57
+
58
+ Java TDD is a third independent, default-off control managed by `ec-config`. Session overrides
59
+ project configuration; ANALYSIS freezes enabled state and the 1..100 changed-line threshold
60
+ (default 90) on entry to IMPLEMENT. Disabled TDD changes no ordinary workflow test depth. Enabled
61
+ TDD adds lifecycle evidence, a TDD review dimension, and the same JaCoCo diff gate locally and in
62
+ GitLab TEST-stage CI.
63
+
64
+ The active task pointer lives in `sessions/{agent}-{session-id}.json` (with an agent-prefixed PPID fallback only
58
65
  when a hook payload has no logical session ID);
59
66
  when the task reaches `COMPLETE` or `CLOSED`, the state API clears `current_task` so the
60
67
  session returns to Ready. Each task's stage persists in its `task.json`. Hooks inject the
@@ -73,6 +80,21 @@ frozen concrete mode, and any `pending_transition`; `dev-spec.md` is the human-r
73
80
  /`review`/`verify`/`handoff` records). Because plan and log live on disk, not in an agent's
74
81
  context window, a task survives session end and agent switches with zero information loss.
75
82
 
83
+ ## Canonical Spec integration
84
+
85
+ An `easy-dev-spec/v1` Canonical Spec is a read-only design source, not progress storage.
86
+ `inspect-dev-spec` validates the document with the protocol implementation pinned from
87
+ `easy-dev-spec@7eb9b64`; after explicit task selection, `select-dev-spec-scope` returns one
88
+ deterministic producer-compatible closure per repository, and `create-task-from-spec` creates one
89
+ Harness task with the source ID/revision/SHA, selected task IDs, portable repository bindings,
90
+ baseline classifications, and dependency evidence.
91
+
92
+ ANALYSIS derives local `dev-spec.md`, `execution.jsonl`, and `test-strategy.md` for the selected
93
+ consumption closure. Canonical-backed units keep repository, source task/steps, files, symbols,
94
+ and test commands. Hard dependencies shape the Unit DAG, READY contracts can run in parallel,
95
+ and integration dependencies block end-to-end completion until evidence is recorded. The source
96
+ Canonical Spec is never rewritten with Harness runtime state.
97
+
76
98
  ## Memory system
77
99
 
78
100
  Short memory: one schema-v2 file per task, sliding window (max 10, keep 5). Long memory:
@@ -93,9 +115,10 @@ demand.
93
115
  continues. All platform-agnostic artifacts (dev-spec, execution.jsonl, task.json, memory)
94
116
  make cross-agent handoff lossless. `task.json.last_agent` records the last owner so a new
95
117
  agent knows a task was handed off rather than self-interrupted.
96
- Owner identities use platform namespaces. Codex collaboration paths such as `/root` and
97
- `/root/...` normalize to `codex`, so internal Codex delegation is not mistaken for a cross-agent
98
- handoff; existing task files with those paths remain compatible without migration.
118
+ Owner identities use platform namespaces. Codex root identities such as `root`, `/root`, and
119
+ their collaboration subpaths normalize to `codex`, so internal Codex delegation is not mistaken
120
+ for a cross-agent handoff; existing task files with those identities remain compatible without
121
+ migration.
99
122
 
100
123
  Handoff is target-less. The leaving agent writes a `handoff` record with `from`, `stage`,
101
124
  `summary`, and `timestamp`, then releases its session pointer. It does not know or record the
@@ -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 14 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,6 +21,24 @@ 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:
27
+
28
+ ```bash
29
+ {{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>]...
31
+
32
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py select-dev-spec-scope \
33
+ --spec <stored-source> --spec-task <selected-task-id> [--spec-task <selected-task-id>]...
34
+ ```
35
+
36
+ Load only the returned per-repository consumption closures: manifest/global context, selected
37
+ task and repository sections, related contracts, direct dependency summaries, selected
38
+ 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.
41
+
24
42
  ## Analysis artifacts
25
43
 
26
44
  Copy `.easy-coding/templates/dev-spec-skeleton.md` first, then replace every `[[EC_TODO:...]]`.
@@ -43,16 +61,68 @@ Execution plan records use:
43
61
  "acceptance_criteria": ["observable result"],
44
62
  "test_points": ["targeted check"],
45
63
  "contracts": ["input/output/invariant or none"],
46
- "risks": ["known risk or none"]
64
+ "risks": ["known risk or none"],
65
+ "repo_id": "R1",
66
+ "source_task_id": "R1-T1",
67
+ "source_step_ids": ["S1"],
68
+ "symbols": ["Class#method"],
69
+ "test_commands": ["exact source test command", "optional local command"]
47
70
  }]
48
71
  }
49
72
  ```
50
73
 
74
+ The five source fields are mandatory only for Canonical-backed code units. Default to one unit
75
+ per selected Spec task. A split may cover only one `repo_id` and one `source_task_id`, and all
76
+ units together must cover every source step exactly once. Map selected hard dependencies into
77
+ `depends_on`, contract dependencies into `contracts`, and dependency levels into
78
+ `parallel_groups`.
79
+
80
+ 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
82
+ and repositories, baseline/conflict result, Unit mapping, source test mapping, and pending
83
+ integration edges.
84
+
85
+ Every source test command remains mandatory. Additional commands from the current repository are
86
+ allowed only when `test-strategy.md` records why the Canonical command alone is insufficient.
87
+ For every selected source test, `test-strategy.md` must spell out its Test ID, source task ID,
88
+ owning Unit ID, repository-relative test file, and exact Canonical command; the state gate checks
89
+ these markers mechanically.
90
+
51
91
  Prefer one coherent unit over artificial file-level splitting. Use parallel only for truly
52
92
  independent write scopes. Better unit contracts reduce later REVIEW rework.
53
93
 
54
94
  Code tasks require `test-strategy.md`; explicit `doc`, `analysis`, and `report` tasks do not.
55
95
 
96
+ ## Optional Java TDD analysis
97
+
98
+ Read `effective_tdd_enabled` and `effective_tdd_coverage_threshold` from the state snapshot.
99
+ When TDD is disabled, stop here: do not inspect GitLab CI or JaCoCo, do not add TDD fields or
100
+ extra tests, and do not strengthen the selected Workflow Mode's ordinary acceptance depth.
101
+
102
+ When TDD is enabled for a Java code task, make `test-strategy.md` record:
103
+
104
+ - detected Java/JUnit build system, exact unit-test command, production/test source roots, and
105
+ JaCoCo XML paths;
106
+ - immutable Git baseline SHA and the configured changed-production-line threshold; design tests
107
+ toward 100% while treating the threshold as the mechanical minimum;
108
+ - feature/bug RED -> GREEN -> REFACTOR evidence, or for pure refactors a pre-change
109
+ characterization GREEN -> post-change GREEN sequence without inventing a RED failure;
110
+ - `.gitlab-ci.yml` and included configuration, the TEST-stage job, JUnit/JaCoCo artifacts, and an
111
+ equivalent changed-line gate. Reuse a gate only when its threshold is at least the configured
112
+ value; otherwise include the CI change in the confirmed implementation scope.
113
+
114
+ The state API mechanically freezes current Git `HEAD` per repository into `task.tdd_baselines`
115
+ when ANALYSIS advances to IMPLEMENT. Plan both local and GitLab commands with that exact SHA and
116
+ the frozen threshold; never use a mutable `HEAD` fallback at verification time. Non-Canonical TDD
117
+ is limited to one Git repository; multi-repository TDD must use Canonical repository bindings.
118
+
119
+ Also append a `### TDD Mode` section to `dev-spec.md` with enabled state, frozen threshold,
120
+ baseline, local gate, GitLab TEST gate, and lifecycle evidence. Do not add this section when TDD
121
+ is disabled.
122
+
123
+ If the task is not a Java project, explain that Java-only TDD cannot be activated and obtain a
124
+ mode decision before advancing. The CLI never installs JaCoCo or edits CI automatically.
125
+
56
126
  ## Workflow mode calculation
57
127
 
58
128
  Resolve configured mode from the state snapshot:
@@ -120,3 +190,5 @@ controls waiting; it never changes the selected execution depth.
120
190
  - No code task with an empty change scope.
121
191
  - No unit without acceptance criteria, test points, contracts, and risks.
122
192
  - No transition without a valid workflow proposal.
193
+ - No Canonical-backed transition with changed source SHA, unresolved repository identity,
194
+ incomplete selected-task coverage, or an open Unit/Step/File/Symbol/Test traceability gap.
@@ -0,0 +1,54 @@
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.
22
+
23
+ Explain precedence as `session override > project config > defaults`. Defaults are Approval
24
+ `guard`, Workflow `adaptive`, TDD disabled, and TDD changed-line coverage threshold 90%. An active
25
+ task freezes its effective TDD values when ANALYSIS advances to IMPLEMENT; later project/session
26
+ changes affect future tasks and ANALYSIS only.
27
+
28
+ ## Project configuration
29
+
30
+ Use `easy-coding config` for project settings. The CLI confirms one atomic update of Approval,
31
+ Workflow, TDD, and (when enabled) the threshold. The threshold must be an integer from 1 to 100.
32
+
33
+ ## Session configuration
34
+
35
+ After explicit user selection, use the current logical session file:
36
+
37
+ ```bash
38
+ # approval
39
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py set-approval-mode --mode approve|guard|confirm|auto --agent <agent-id> --session-file <P>
40
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py clear-approval-mode --agent <agent-id> --session-file <P>
41
+
42
+ # workflow
43
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py set-workflow-mode --mode adaptive|fast|standard|strict --agent <agent-id> --session-file <P>
44
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py clear-workflow-mode --agent <agent-id> --session-file <P>
45
+
46
+ # TDD; omitting threshold preserves an existing session threshold, otherwise project/default 90 applies
47
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py set-tdd --enabled true|false [--threshold 1..100] --agent <agent-id> --session-file <P>
48
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py clear-tdd --agent <agent-id> --session-file <P>
49
+ ```
50
+
51
+ Turning TDD off must preserve the existing Fast/Standard/Strict test depth exactly: do not inspect
52
+ CI, request JaCoCo, add TDD artifacts, run coverage commands, or strengthen acceptance criteria.
53
+ When TDD is on, explain that it applies only to Java code tasks and activates RED/GREEN/REFACTOR,
54
+ TDD review, local changed-line JaCoCo coverage, and GitLab TEST-stage gate planning.
@@ -44,6 +44,9 @@ with `.easy-coding/sessions/` always excluded. The CLI already added it to `.git
44
44
  `repo_paths`), the commit/push covers every involved repo. Read `repo_paths` from the
45
45
  current task state to locate each checkout, check changes, and commit/push them as one
46
46
  coherent change set — do not leave a sub-repo behind.
47
+ For Canonical-backed tasks, this set is exactly the repositories referenced by
48
+ `selected_spec_tasks` and resolved in `spec_repositories`; unselected Spec repositories stay
49
+ out of scope.
47
50
  5. **Supermodule two-step commits.** If the current repo has `.gitmodules`, or the current
48
51
  task touches a git submodule path, treat each submodule as an independent git boundary:
49
52
  commit and push child repos first, then commit and push the parent gitlink update. If a
@@ -59,6 +62,7 @@ with `.easy-coding/sessions/` always excluded. The CLI already added it to `.git
59
62
  - Do not commit `spec/dev/` unless the user explicitly asks.
60
63
  - Do not omit managed `easy-coding upgrade` changes merely because they were created outside
61
64
  the current agent turn.
65
+ - Never modify or stage the source Canonical Spec merely to record Harness execution progress.
62
66
  - In a supermodule task launched from the parent root, parent `.easy-coding/` belongs to the
63
67
  parent git. Child `.easy-coding/memory/` changes created by memory archive belong to the
64
68
  owning child git and must be committed before the parent gitlink update.
@@ -9,6 +9,16 @@ Use only after ANALYSIS has frozen `task.json.workflow_mode` to `fast`, `standar
9
9
  `strict`. Read `dev-spec.md`, the latest `plan` record in `execution.jsonl`, relevant RULES
10
10
  and ABSTRACT sections, and `test-strategy.md` for code tasks.
11
11
 
12
+ If frozen `task.tdd_enabled` is not `true`, preserve the existing shift-left behavior exactly;
13
+ do not load the Java coverage tool, require RED/GREEN/REFACTOR, inspect CI, or run extra test
14
+ commands. TDD is an independent opt-in mode, not an implicit consequence of strict workflow.
15
+
16
+ When frozen TDD is enabled, every feature/bug unit must capture a meaningful failing unit test
17
+ before production code (RED), the smallest passing implementation (GREEN), and a green refactor.
18
+ Pure refactors instead capture a passing characterization test before the change and rerun it
19
+ afterward. Never fake RED evidence. Keep tests deterministic, boundary-focused, and minimally
20
+ mocked, and design changed production code toward 100% unit coverage.
21
+
12
22
  Communicate with the user in the user's language.
13
23
 
14
24
  ## Non-negotiable gates
@@ -59,7 +69,13 @@ Sub-agents never dispatch other sub-agents or read `.easy-coding` workflow asset
59
69
  # Task Card
60
70
  ## Identity Easy Coding implementation unit
61
71
  ## Workflow Mode {fast|standard|strict}
72
+ ## TDD {off | on, frozen changed-line threshold N%}
62
73
  ## Task {unit description}
74
+ ## Source Spec {spec_id@revision + sha256 | NONE}
75
+ ## Source Task {source_task_id | NONE}
76
+ ## Repository {repo_id + resolved repository root | current project}
77
+ ## Source Steps {source_step_ids | NONE}
78
+ ## Symbols {symbols | confirmed local symbols}
63
79
  ## Editable Scope {unit.files | NONE — read-only}
64
80
  ## Acceptance {unit.acceptance_criteria}
65
81
  ## Test Points {unit.test_points and exact targeted commands}
@@ -68,17 +84,23 @@ Sub-agents never dispatch other sub-agents or read `.easy-coding` workflow asset
68
84
  ## Coding Rules {pre-digested RULES sections}
69
85
  ## Architecture {pre-digested ABSTRACT sections}
70
86
  ## Output
71
- changed_files[], summary, deliverable|null, issues[], needs_attention[]
87
+ status:"completed", repo_id|null, source_task_id|null, changed_files[], summary,
88
+ deliverable|null, issues:[], needs_attention:[]
72
89
  ```
73
90
 
74
91
  ## Dispatch and result loop
75
92
 
76
- 1. Append a `dispatch` record before work begins.
93
+ 1. Append a `dispatch` record before work begins. Canonical-backed records include `repo_id` and
94
+ `source_task_id`; resolve every file relative to `task.repo_paths[repo_id]` before dispatch.
77
95
  2. Execute according to dependency order and selected owner.
78
96
  3. Run targeted unit tests and self-audit scope, contracts, TODOs, and introduced warnings.
79
- 4. Append one `result` record. Include unresolved issues rather than hiding them.
97
+ 4. Append one `result` record. Only a successful unit uses `status:"completed"`; include
98
+ unresolved issues rather than hiding them, and do not advance while `issues` or
99
+ `needs_attention` is non-empty.
80
100
  5. If a result changes a cross-unit contract, stop dependent units and return to ANALYSIS.
81
101
  6. For parallel units, detect overlapping writes before advancing.
102
+ 7. If implementation needs a file, symbol, repository, or source step outside the mapped
103
+ Canonical change set, stop and return to ANALYSIS instead of expanding scope implicitly.
82
104
 
83
105
  Do not emit a progress message for every trivial edit. Report at unit boundaries to reduce
84
106
  conversation overhead while keeping work observable.
@@ -28,6 +28,10 @@ Name it `{memory_id}_{YYYYMMDD}_{smart_name}.md` and set
28
28
  `.easy-coding/memory/short/`, then register it with
29
29
  `memory-short-complete`. Never invent test results or commit hashes.
30
30
 
31
+ When frozen TDD is enabled, add its threshold, lifecycle evidence, local changed-line result,
32
+ and remote CI status to the short memory's execution evidence. When TDD is off, omit TDD fields
33
+ entirely so ordinary tasks incur no additional memory work.
34
+
31
35
  Ask the state API for `memory-instruction`. Distill only when it returns `action:distill`;
32
36
  otherwise record `no-op`. Long memory receives reusable facts only, not file dumps, transient
33
37
  logs, routine command output, or speculation.
@@ -14,6 +14,19 @@ Every new code task enters REVIEW. Read-only tasks do not. Obtain the current fi
14
14
  Review the final diff against `dev-spec.md`, RULES, unit acceptance criteria, tests, contracts,
15
15
  and obvious security risks. Every finding cites `file:line`.
16
16
 
17
+ For Canonical-backed tasks, group evidence by `repo_id` and `source_task_id`. Every selected
18
+ Spec task needs an implementation result and source test evidence; file references remain
19
+ repo-relative within the owning repository. Missing or expanded source change/step coverage is
20
+ a blocking correctness finding. Every Canonical review record includes its `repo_id` and
21
+ `source_task_id`; emit at least one current-fingerprint record per selected task and required
22
+ review dimension. A global record without source ownership cannot satisfy the gate.
23
+
24
+ When frozen TDD is enabled, add a passed review dimension named exactly `tdd` for each source
25
+ task. Review whether RED/GREEN/REFACTOR (or characterization GREEN for pure refactors) is genuine,
26
+ tests exercise changed behavior and boundaries, mocks do not merely mirror implementation, and
27
+ the local/CI changed-line coverage gates share the frozen threshold. When TDD is off, do not add
28
+ this dimension or raise the ordinary review depth.
29
+
17
30
  ## Depth by workflow mode
18
31
 
19
32
  - `fast`: main Agent performs one final-diff self-review across correctness, scope, tests, and
@@ -67,6 +80,8 @@ Fast and Standard normally use `combined`; Strict uses at least two distinct dim
67
80
  "reviewer": "main-or-independent-agent",
68
81
  "implementation_fingerprint": "<state-api value>",
69
82
  "timestamp": "<ISO-8601>",
83
+ "repo_id": "<canonical repo-id; omit for non-Canonical tasks>",
84
+ "source_task_id": "<canonical task-id; omit for non-Canonical tasks>",
70
85
  "findings": []
71
86
  }
72
87
  ```
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  name: ec-task-management
3
- description: View and manage Easy Coding tasks plus project/session approval and workflow-mode settings.
3
+ description: View and manage Easy Coding task lifecycle, ownership, handoff, and closure.
4
4
  ---
5
5
 
6
- # ec-task-management — tasks and session modes
6
+ # ec-task-management — task lifecycle
7
7
 
8
8
  Communicate with the user in the user's language. A bare invocation is read-only: show the
9
9
  panel and available actions, but do not mutate a session without an explicit choice.
@@ -13,40 +13,22 @@ panel and available actions, but do not mutate a session without an explicit cho
13
13
  Call the state API snapshot and show:
14
14
 
15
15
  - current task, stage, last Agent, and pending transition;
16
- - `project_approval_mode`, `session_approval_mode`, `effective_approval_mode`;
17
- - `project_workflow_mode`, `session_workflow_mode`, `configured_workflow_mode`;
18
- - task `concrete_workflow_mode` or ANALYSIS proposal when present;
16
+ - task `concrete_workflow_mode` and frozen TDD state when present;
19
17
  - harness enabled/disabled state;
20
18
  - active and resumable tasks.
19
+ - for Canonical-backed tasks: source Spec ID/revision/SHA, selected task IDs, repository
20
+ bindings/baseline status, and pending dependency evidence.
21
21
 
22
- Explain precedence:
23
-
24
- `session override > project config > approval:guard / workflow:adaptive`
25
-
26
- ## Session settings
27
-
28
- After explicit user selection:
29
-
30
- ```bash
31
- # approval
32
- {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py set-approval-mode --mode approve|guard|confirm|auto --agent <agent-id> --session-file <P>
33
- {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py clear-approval-mode --agent <agent-id> --session-file <P>
34
-
35
- # workflow
36
- {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py set-workflow-mode --mode adaptive|fast|standard|strict --agent <agent-id> --session-file <P>
37
- {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py clear-workflow-mode --agent <agent-id> --session-file <P>
38
- ```
39
-
40
- Changing a session setting affects future ANALYSIS proposals. It does not silently rewrite a
41
- mode already frozen on an active task. During ANALYSIS, regenerate and show the proposal. During
42
- IMPLEMENT or REVIEW, use `raise-workflow-mode` for a justified increase; lowering is forbidden.
43
- From VERIFICATION, return to IMPLEMENT first so the raised mode receives fresh REVIEW evidence.
44
-
45
- Project settings are changed with `easy-coding config`, which edits both dimensions in one
46
- confirmed interaction.
22
+ Mode inspection and configuration belongs to `ec-config`. If the user asks to change Approval,
23
+ Workflow, TDD, or the TDD coverage threshold, route there and do not mutate those fields here.
47
24
 
48
25
  ## Task actions
49
26
 
50
27
  Support listing, creating, selecting, claiming, handing off, and closing tasks through the
51
- state API. Preserve pending transitions when merely changing approval mode. Never infer user
28
+ state API. Preserve pending transitions when inspecting tasks. Never infer user
52
29
  acceptance from opening this panel.
30
+
31
+ When creating from a Canonical Spec, call `inspect-dev-spec`, display the complete task and
32
+ dependency selection, then call `select-dev-spec-scope` and `create-task-from-spec` only after
33
+ explicit user selection. Multiple selected Spec tasks still create one Harness task, while the
34
+ selector returns one deterministic consumption closure per selected repository.
@@ -25,6 +25,27 @@ Read-only tasks never enter this stage. Obtain fresh fingerprints before running
25
25
  - `standard`: run impacted lint/typecheck/test scopes and every must-test item.
26
26
  - `strict`: run the project's full applicable lint, typecheck, test, and build gates.
27
27
 
28
+ These rules remain unchanged when frozen TDD is off: do not discover JaCoCo reports, run the
29
+ coverage tool, inspect GitLab, or add a coverage record.
30
+
31
+ When frozen TDD is on, first run the planned Java unit command and generate JaCoCo XML, then run
32
+ the same deterministic gate intended for GitLab:
33
+
34
+ ```bash
35
+ python3 .easy-coding/tools/easy_coding_java_coverage.py check \
36
+ --base <task.tdd_baselines[repo-id-or-project]> \
37
+ --threshold <task.tdd_coverage_threshold> [--report <jacoco.xml>]...
38
+ ```
39
+
40
+ The tool measures covered added/modified production Java executable lines only. Deleted,
41
+ comment, blank, import, and test-source lines are excluded by diff/JaCoCo intersection. Missing
42
+ or ambiguous source files and reports older than their modified source fail; zero modified
43
+ executable lines is explicit N/A. Always regenerate JaCoCo XML after the final source change.
44
+ Record CI as pending until the remote pipeline actually passes; local green is not remote green.
45
+ Never substitute `HEAD`, a mutable ref, project defaults, or current session settings for the
46
+ task-frozen baseline SHA and threshold. GitLab must invoke the tool with the same two frozen
47
+ values; a session override therefore requires the CI command/variable for this task to match it.
48
+
28
49
  The main Agent may run commands inline. Dispatch verifier sub-agents only when checks are
29
50
  independent and parallel execution materially saves time or isolates specialist environments.
30
51
  Platform spawn rule: {{platform_spawn_instruction}}
@@ -42,11 +63,13 @@ Append one record per executed check:
42
63
  "passed": true,
43
64
  "implementation_fingerprint": "<state-api value>",
44
65
  "config_fingerprint": "<state-api value>",
45
- "timestamp": "<ISO-8601>"
66
+ "timestamp": "<ISO-8601>",
67
+ "repo_id": "<canonical repo-id; omit for non-Canonical tasks>",
68
+ "source_task_id": "<canonical task-id; omit for non-Canonical tasks>"
46
69
  }
47
70
  ```
48
71
 
49
- `check_type` is one of `lint`, `typecheck`, `test`, or `build`. In `strict`, append current
72
+ `check_type` is one of `lint`, `typecheck`, `test`, `build`, or (TDD only) `coverage`. In `strict`, append current
50
73
  evidence for all four types. When a type genuinely does not apply, record `applicable: false`
51
74
  and a non-empty `not_applicable_reason`; it does not count as the required applicable executed
52
75
  check, and must not be represented by an invented successful command.
@@ -56,6 +79,29 @@ do not append a later synthetic pass without rerunning the failed command.
56
79
 
57
80
  ## Coverage and acceptance
58
81
 
82
+ For TDD coverage, copy the tool output into `coverage`: `baseline_sha`, `covered_lines`,
83
+ `total_lines`, `percentage`, frozen `threshold`, `report_paths`, and `report_sha256`. Set
84
+ `applicable:false` plus the tool's reason only for zero executable modified lines. A percentage
85
+ below the frozen threshold fails even when ordinary tests pass.
86
+
87
+ Append two coverage records per repository (and per Canonical source task): one with
88
+ `coverage_scope:"local"`, and one with `coverage_scope:"gitlab"`. The GitLab record may be
89
+ appended only after the remote job succeeds and must also include:
90
+
91
+ ```json
92
+ {
93
+ "ci": {
94
+ "provider": "gitlab",
95
+ "pipeline_url": "https://gitlab.example/.../pipelines/123",
96
+ "job_name": "changed-line-coverage",
97
+ "status": "success"
98
+ }
99
+ }
100
+ ```
101
+
102
+ Both records must preserve the same task-frozen baseline and threshold. A local-only result,
103
+ pending/failed pipeline, missing job identity, or synthetic remote pass cannot satisfy MEMORY.
104
+
59
105
  - Every must-test item has an executed check.
60
106
  - Bug fixes include a regression test when project infrastructure exists.
61
107
  - Present changed scope, commands, results, and unverified items.
@@ -64,5 +110,26 @@ do not append a later synthetic pass without rerunning the failed command.
64
110
  user wait.
65
111
  - A reported in-scope problem returns to IMPLEMENT; out-of-scope work becomes a separate task.
66
112
 
113
+ For Canonical-backed tasks, run each repository's commands from `task.repo_paths[repo_id]` and
114
+ cover every selected task's source test IDs. Report pending integration edges separately from
115
+ local green checks. They do not block local implementation evidence, but the state API blocks
116
+ `VERIFICATION -> MEMORY` until evidence is recorded with `satisfy-spec-dependency`. Never claim
117
+ end-to-end completion while an integration edge remains pending. Every Canonical verify record
118
+ includes the owning `repo_id` and `source_task_id`; duplicate check names in different source
119
+ tasks remain separate evidence records. In `strict`, every involved repository independently
120
+ records all four check types; a repository-specific non-applicable record still needs its reason
121
+ and source ownership.
122
+
123
+ Record the exact integration edge only after its evidence exists:
124
+
125
+ ```bash
126
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py satisfy-spec-dependency \
127
+ --task-id <harness-task-id> \
128
+ --source-task <source-spec-task-id> \
129
+ --spec-task <target-spec-task-id> \
130
+ --evidence "<verifiable evidence>" \
131
+ --agent <agent>
132
+ ```
133
+
67
134
  The state API rejects VERIFICATION -> MEMORY unless all evidence for the current implementation
68
135
  and config fingerprints is green.
@@ -24,18 +24,24 @@ the stage graph. Pre-0.9 in-flight tasks may carry `workflow_mode_legacy:true` f
24
24
  review-evidence compatibility. Only `workflow_mode_legacy_direct_edge:true`, created from old
25
25
  lite semantics or an already-persisted edge, permits one IMPLEMENT -> VERIFICATION transition.
26
26
 
27
- ## Two independent controls
27
+ ## Independent controls
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
31
  MEMORY, and COMPLETE transitions advance automatically.
32
32
  - `workflow_mode = adaptive|fast|standard|strict` controls execution cost and assurance depth.
33
+ - `tdd_enabled` independently activates Java TDD and changed-line coverage. It defaults off;
34
+ `tdd_coverage_threshold` defaults to 90 and accepts integers from 1 to 100.
33
35
 
34
36
  Resolution order for each configured value is session override, then project config, then
35
37
  defaults (`guard`, `adaptive`). ANALYSIS resolves `adaptive` to a concrete mode, presents the
36
38
  selection and reasons, allows the user to change it within the risk floor, and freezes it when
37
39
  ANALYSIS -> IMPLEMENT is applied.
38
40
 
41
+ 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
+
39
45
  `confirm` and `auto` do not hide the proposal: show it in the plan. Confirm waits for that one
40
46
  plan decision; Auto continues immediately. Both remove later waiting, not quality gates.
41
47
 
@@ -52,7 +58,36 @@ plan decision; Auto continues immediately. Both remove later waiting, not qualit
52
58
  - Present with `status != "COMPLETE"`: invoke `{{skill_trigger}}ec-init`, then stop.
53
59
  - `[easy-coding:upgrade-init-pending:X]`: recommend `{{skill_trigger}}ec-init` for vX
54
60
  adaptation, but allow the user to continue; this reminder is not a workflow block.
55
- 3. Match the user's intent against `current_task` and the active task list before resuming.
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
+
70
+ ```bash
71
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py inspect-dev-spec \
72
+ --spec <path> [--repo-path <repo-id>=<path>]...
73
+
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>]...
76
+
77
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py create-task-from-spec \
78
+ --spec <path> --spec-task <task-id> [--spec-task <task-id>]... \
79
+ --task-id <harness-task-id> --type <type> --title <title> \
80
+ --repo-path <repo-id>=<path> [--dependency-evidence <dependency-id>=<evidence>]... \
81
+ --agent <agent-id> --session-file <P>
82
+ ```
83
+
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.
87
+
88
+ When multiple selected tasks depend on the same target, disambiguate creation evidence with
89
+ `<source-task-id>-><dependency-task-id>=<evidence>`.
90
+ 4. Match the user's intent against `current_task` and the active task list before resuming.
56
91
  If the user names or clearly matches another task, confirm the switch and call
57
92
  `claim-task --task-id <id> --agent <agent-id> --session-file <P>`. Do not execute task A
58
93
  under task B's request.
@@ -64,10 +99,10 @@ plan decision; Auto continues immediately. Both remove later waiting, not qualit
64
99
  to the requested deliverable. Feature, bugfix, refactor, performance, and workflow changes
65
100
  are code tasks. Use `doc`, `analysis`, or `report` only when the user explicitly requested
66
101
  a no-code deliverable; never downgrade a code request to the read-only completion path.
67
- 4. Resume the matched/current task, then load only state-relevant assets. Do not read five full
102
+ 5. Resume the matched/current task, then load only state-relevant assets. Do not read five full
68
103
  memories at every startup; ANALYSIS searches memory metadata and opens relevant entries on
69
104
  demand.
70
- 5. If another Agent last owned the task, summarize the stored handoff before continuing.
105
+ 6. If another Agent last owned the task, summarize the stored handoff before continuing.
71
106
 
72
107
  ## Stage dispatch
73
108