easy-coding-harness 1.1.0-beta.1 → 1.1.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-coding-harness",
3
- "version": "1.1.0-beta.1",
3
+ "version": "1.1.0-beta.2",
4
4
  "description": "CLI scaffold for installing Easy Coding harness files into agent-native directories.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -6,7 +6,8 @@ description: ANALYSIS-stage skill. Produces the confirmed dev-spec, execution pl
6
6
  # ec-analysis — progressive analysis and mode selection
7
7
 
8
8
  This stage is read-only for project source. Its outputs are task artifacts only:
9
- `dev-spec.md`, `execution.jsonl` plan, and `test-strategy.md` for code tasks.
9
+ `dev-spec.md`, `execution.jsonl` plan, and `test-strategy.md` when required by the concrete mode.
10
+ Compact Fast keeps checks in the existing plan.
10
11
 
11
12
  Communicate with the user in the user's language.
12
13
 
@@ -24,7 +25,8 @@ Communicate with the user in the user's language.
24
25
  Load context only for the current change and its direct dependencies. Reuse existing findings;
25
26
  without new evidence, do not repeat discovery or expand into unrelated modules.
26
27
 
27
- For a task with `task.json.spec_source`, use `resume-spec-context` against the stored source, exact
28
+ For a task with `task.json.spec_source`, reuse the returned/current-session consumption closure.
29
+ Only if missing or changed, use `resume-spec-context` against the stored source, exact
28
30
  `selected_spec_tasks`, and only their stored `task.repo_paths` bindings. Schema, Spec ID, design
29
31
  revision, and `design_sha256` must still match. A changed `document_sha256` with the same design is
30
32
  normal shared progress; refresh `execution_revision` without invalidating plan/QUALITY
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ec-config
3
- description: Inspect and configure Easy Coding project/session Approval, Workflow, and Java unit test strategies.
3
+ description: Inspect and configure Easy Coding project/session Approval, cooperation, and Java unit test strategies across session, local and project scopes.
4
4
  ---
5
5
 
6
6
  # ec-config — mode configuration
@@ -10,15 +10,17 @@ and available actions. Never mutate project or session settings without an expli
10
10
 
11
11
  ## Configuration panel
12
12
 
13
- Call `snapshot` and show project, session, effective, and frozen task values for `approval_mode`,
13
+ Call `snapshot` and show project, session, effective, and frozen task values for `approval_mode`, `cooperate_mode`,
14
14
  the mechanically calculated workflow mode (read-only), `unit_test_mode`, and `ut_coverage_threshold`.
15
+ Show `behavior_sources`, `local_behavior`, and `effective_cooperate_mode` alongside the current
16
+ task cooperation/continuation so a receiving Agent can distinguish its defaults from accepted work.
15
17
  Use `project_unit_test_mode`, `session_unit_test_mode`, `effective_unit_test_mode`, their threshold
16
18
  counterparts, `task_unit_test_mode`, `task_tdd_baselines`, and `unit_test_readiness_status` directly.
17
19
  When readiness is `not_checked`, report it as not checked; do not scan infrastructure merely to
18
20
  populate the panel. Inspect readiness when the user requests it or selects UT/TDD.
19
21
 
20
- Precedence is `session override > project config > defaults`. Defaults are Approval `guard`,
21
- Workflow `adaptive`, unit test strategy `none`, and shared changed-line coverage threshold 90%.
22
+ Precedence is `session override > ~/.easy-coding/config.yaml > project config > defaults`, per field. Defaults are Approval `guard`,
23
+ Workflow `adaptive`, cooperation `default`, unit test strategy `none`, and shared changed-line coverage threshold 90%.
22
24
  The strategies are:
23
25
 
24
26
  - `none`: ordinary task-required verification, with no additional coverage gate.
@@ -36,6 +38,32 @@ non-mechanical edge, `guard` waits at ANALYSIS -> IMPLEMENT and QUALITY -> MEMOR
36
38
  waits only for the plan, and `auto` advances legal green edges immediately. A new code diff after
37
39
  the QUALITY checkpoint requires acceptance of that exact diff without changing the approval mode.
38
40
 
41
+ ## Cooperation and configuration scopes
42
+
43
+ `cooperate_mode: default | dispatch` selects stage-boundary handoff or manual implementation/repair
44
+ handoff. In dispatch, the coordinator analyzes, verifies and writes memory; the user may choose
45
+ current-Agent execution for any bounded change. Never launch or schedule another Agent.
46
+ One decision approves the displayed scope and its executor. Dispatch requires this human decision
47
+ even under Auto; Approve consumes it as the same approval, not a second dialog. Existing accepted
48
+ handoffs and frozen UT/TDD contracts survive changes to defaults.
49
+
50
+ The local file is optional. Read-only inspection and init/upgrade never create it. Save only explicit
51
+ keys under `behavior`; resetting a key removes that override. Local settings are preferences across
52
+ projects and platforms, so saving local UT/TDD does not scan or initialize the current project.
53
+ Readiness is checked when a task actually enables that strategy.
54
+
55
+ After the user chooses scope and values, use these commands (the explicit choice authorizes `--yes`):
56
+
57
+ ```bash
58
+ easy-coding config --scope local --cooperate-mode dispatch --yes
59
+ easy-coding config --scope project --cooperate-mode default --yes
60
+ easy-coding config --scope local --reset cooperate_mode --yes
61
+ ```
62
+
63
+ The same scopes support `--approval-mode`, `--unit-test-mode`, and `--ut-coverage-threshold`.
64
+ For a session, call `set-cooperate-mode --mode default|dispatch` or `clear-cooperate-mode`
65
+ with the current state API, agent and session file. Bare `ec-config` remains read-only.
66
+
39
67
  ## Project configuration
40
68
 
41
69
  Use `easy-coding config`. The CLI confirms an atomic update of Approval, unit test strategy, and
@@ -49,7 +77,7 @@ After explicit user selection, use the current logical session file:
49
77
  {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py set-approval-mode --mode approve|guard|confirm|auto --agent <agent-id> --session-file <P>
50
78
  {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py clear-approval-mode --agent <agent-id> --session-file <P>
51
79
 
52
- # Omitting threshold preserves the session threshold or inherits project/default 90.
80
+ # Omitting threshold preserves the session threshold or inherits local/project/default 90.
53
81
  {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py set-unit-test-mode --mode none|ut|tdd [--threshold 1..100] --agent <agent-id> --session-file <P>
54
82
  {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py clear-unit-test-mode --agent <agent-id> --session-file <P>
55
83
  ```
@@ -7,10 +7,10 @@ description: IMPLEMENT-stage skill. Executes the confirmed plan with workflow-mo
7
7
 
8
8
  Use only after ANALYSIS has frozen `task.json.workflow_mode` to `fast`, `standard`, or
9
9
  `strict`. Read `dev-spec.md`, the latest `plan` record in `execution.jsonl`, relevant RULES
10
- and ABSTRACT sections, and `test-strategy.md` for code tasks.
10
+ and ABSTRACT sections. Read `test-strategy.md` when required; compact Fast uses plan checks.
11
11
 
12
12
  For a Canonical-backed task, consume the ready `spec_context.consumption` returned on creation
13
- or claim. On session resume or after design sync, call `resume-spec-context --agent <agent-id>
13
+ or claim. Reuse unchanged context on the same session; only if context is missing or design changed, call `resume-spec-context --agent <agent-id>
14
14
  --session-file <P>`. The bound source and selected changes/steps/tests govern the implementation;
15
15
  handoff summaries and derived plans cannot substitute for this context. A blocked context or
16
16
  pending `spec_change` stops implementation until the original source is repaired/synchronized.
@@ -221,3 +221,11 @@ conversation overhead while keeping work observable.
221
221
  an existing core Java class, has Javadoc unless it qualifies for the documented-interface
222
222
  implementation exception.
223
223
  - [ ] The task enters QUALITY, regardless of workflow mode.
224
+
225
+ ## Manual implementation handoff
226
+
227
+ When `continuation.next_action=implement`, execute only its approved Units. Reuse the original plan,
228
+ commands and results. Honor `stop_after:IMPLEMENT`: record completion and hand back with
229
+ `next_action:quality`, then stop. The receiving coordinator handles the existing stage boundary
230
+ once under the approval policy; the executor never starts quality work by inertia. Users may
231
+ instead choose current-Agent execution. No platform is permanently assigned either role.
@@ -6,15 +6,17 @@ description: QUALITY-stage skill. Freezes one candidate, runs independent Review
6
6
  # ec-quality — one candidate, two read-only gates
7
7
 
8
8
  Use only while the current task is in `QUALITY`. Communicate in the user's language. QUALITY
9
- does not modify source, tests, configuration, plans, or task scope.
9
+ keeps Review and Verification read-only while permitting approved bounded repairs between checks.
10
+ Ordinary fixes stay in QUALITY; changed requirements/contracts or a replaced implementation plan
11
+ return to ANALYSIS/IMPLEMENT. Bug severity or line count alone does not decide the route.
10
12
 
11
13
  ## Candidate freeze
12
14
 
13
15
  For Canonical-backed tasks, load the current session's bound selection through `resume-spec-context`
14
- when resuming. Pass that original consumption closure to both gates and compare selected contracts,
16
+ only when the current session lacks that context or the design changed. Pass that original consumption closure to both gates and compare selected contracts,
15
17
  changes, Steps and Tests against the candidate. Pending `spec_change` blocks QUALITY acceptance
16
18
  until the source revision is synchronized. Bounded corrections refresh only their affected Unit
17
- mappings and continue IMPLEMENT; substantive expansion returns to ANALYSIS.
19
+ mappings and retain the current stage; substantive expansion returns to ANALYSIS.
18
20
 
19
21
  Call `evidence-fingerprints` once to obtain the runtime-owned attempt and candidate. The runtime
20
22
  owns signatures and prior-evidence references. Never calculate historical fingerprints, import
@@ -59,7 +61,8 @@ meaningless remaining check when a concrete blocker is found. Aggregate the repa
59
61
 
60
62
  ### Standard
61
63
 
62
- - Dispatch one independent reviewer.
64
+ - Use one independent reviewer. A coordinator who did not author the candidate can provide this
65
+ review after another Agent implemented it; do not launch a duplicate reviewer merely for form.
63
66
  - Run affected lint/typecheck/test plus every must-test command from `test-strategy.md`.
64
67
  - Run Review and Verification in parallel when their inputs are already frozen.
65
68
 
@@ -108,7 +111,7 @@ blocking record also carries a `failure_classes` array; do not defer classificat
108
111
 
109
112
  ## Verification Gate
110
113
 
111
- Run only the commands selected by the mode and `test-strategy.md`. Record real exit status and
114
+ Run only commands selected by the mode and the existing plan/test strategy. Record real exit status and
112
115
  current implementation/config fingerprints plus the active `quality_attempt` using the existing
113
116
  `type:"verify"` contract. Do not run a command inside Review Gate, and do not fix a failure inside
114
117
  Verification Gate. A failed applicable check also carries its structured `failure_classes` array.
@@ -129,7 +132,7 @@ Wait for both gates, then aggregate all blocking results once. Classify each ite
129
132
 
130
133
  If code or tests need edits, create one concise Repair Bundle containing every in-scope blocking
131
134
  item, affected files, required verification, and evidence that may be reused. After both Gates are
132
- terminal, finalize the decision before transitioning once to IMPLEMENT:
135
+ terminal, finalize the decision, then prepare the bounded repair while remaining in QUALITY:
133
136
 
134
137
  ```bash
135
138
  {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py finalize-quality \
@@ -152,10 +155,39 @@ review/verify record first, then write each affected source task `blocked` throu
152
155
  use the exact idempotency key `<H>:<S>:<F>:quality-<A>:blocked`. Add one failed evidence object for
153
156
  each affected Gate kind with ref
154
157
  `execution.jsonl#quality-attempt=<A>;implementation=<F>;source-task=<S>;kind=review|verify`.
155
- Only after every blocked writeback is acknowledged may the task return to IMPLEMENT; the state API
156
- rejects a writeback from another run, attempt, fingerprint, or evidence window. Entering IMPLEMENT
157
- reopens only those blocked source tasks as a new `in_progress` attempt, while unaffected implemented
158
- tasks keep their shared conclusion.
158
+ After blocked writeback is acknowledged, start the approved repair. The runtime reopens only those
159
+ source tasks with a repair-specific idempotency key, keeping local status QUALITY and unaffected
160
+ source progress. Record affected Step/result completion and source `implemented` before completing
161
+ the repair. Reuse the existing writer and ledger, never copy a second implementation plan.
162
+
163
+ Use `begin-correction --file <existing-unit-file> --summary <bundle>` to prepare one `quality_repair`.
164
+ In dispatch mode, present this complete bundle once with choices: current Agent, another Agent,
165
+ or defer/revise. This human dispatch decision remains under every approval mode; Approve shares
166
+ the same decision. The user may explicitly authorize current-Agent execution. Default mode uses
167
+ its existing approval policy for local repair, with no handoff inside the stage.
168
+
169
+ ```bash
170
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py start-quality-repair \
171
+ --repair-id <id> --executor current|other [--confirmed] --agent <agent-id> --session-file <P>
172
+ ```
173
+
174
+ Pass `--confirmed` only for a real user decision on this bundle. For other-Agent execution the call
175
+ also writes the handoff. The recipient claims the task and directly repairs the approved files;
176
+ it must not ask again or return to IMPLEMENT. Bounded code and necessary tests follow the existing
177
+ unit test strategy, including TDD lifecycle checks only when TDD is frozen. The recipient finishes:
178
+
179
+ ```bash
180
+ {{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py complete-quality-repair \
181
+ --repair-id <id> --agent <agent-id> --session-file <P>
182
+ ```
183
+
184
+ This returns other-Agent repairs to the coordinator for delta review/verification. No quality gate
185
+ may pass while the repair is pending. Scope/contract changes must be resolved rather than silently
186
+ included in the accepted bundle. Repeated starts/completions reuse the existing repair ID.
187
+
188
+ `prepare-check --record` also accepts an array. `record-check --result` accepts an array of
189
+ `{prepared_id,result}` to register the results of those prepared checks. Each check keeps its own
190
+ inputs and real result; batching shares runtime reads, not unrelated evidence.
159
191
 
160
192
  After repair, choose the minimum honest evidence refresh:
161
193
 
@@ -22,7 +22,7 @@ Call the state API snapshot and show:
22
22
  pending confirmed Spec change.
23
23
 
24
24
  Mode inspection and configuration belongs to `ec-config`. If the user asks to change Approval,
25
- Workflow, unit test strategy, or the shared coverage threshold, route there and do not mutate those fields here.
25
+ Workflow, cooperation, unit test strategy, or the shared coverage threshold, route there and do not mutate those fields here.
26
26
 
27
27
  ## Task actions
28
28
 
@@ -38,8 +38,8 @@ When creating from a Canonical Spec, call `inspect-dev-spec --manifest-only`, di
38
38
  task and dependency selection, then call `create-task-from-spec` only after explicit user
39
39
  selection. Multiple selected Spec tasks still create one Harness task. Do not call
40
40
  `select-dev-spec-scope` during discovery. Creation and claim return the selected consumption
41
- closure; consume it before stage work. On a resumed session, use `resume-spec-context` with
42
- the current agent/session. A blocked context allows repair/rebind/sync, but blocks advancement.
41
+ closure; consume it before stage work. On the same session, reuse unchanged context; call `resume-spec-context` only if context is missing
42
+ or invalidated. A new session must consume its selected closure. A blocked context allows repair/rebind/sync, but blocks advancement.
43
43
  Initialize missing shared execution before creation. Support `rebind-spec-source` only when the
44
44
  new file matches schema + spec_id + design revision + design_sha256 and does not roll execution
45
45
  revision backward. A pending writeback is repaired with `reconcile-spec-execution`, never by
@@ -49,3 +49,10 @@ action is cleared with `status:error`; correct its input instead of replaying it
49
49
  Confirmed requirement changes use `begin-spec-change` before editing the original source.
50
50
  Its summary and affected tasks survive handoff. Finish revision + READY + `sync-spec-design`,
51
51
  then reload context and refresh the plan in ANALYSIS. Do not clear a pending change manually.
52
+
53
+ ## Scoped continuation
54
+
55
+ Display the task coordinator, continuation action/stop point and current repair bundle. A claim
56
+ returns the existing approved work; do not request a second scope approval. The main Agent is not
57
+ replaced by the coding executor. Handoff summaries reference existing plan Units and execution
58
+ indices; never copy a new Spec or reconstruct old verification results.
@@ -12,8 +12,9 @@ user's language.
12
12
 
13
13
  ```text
14
14
  INIT --auto--> ANALYSIS -> IMPLEMENT -> QUALITY -> MEMORY --auto--> COMPLETE
15
- ^ ^ |
16
- +--replan---+ +---repair-----+
15
+ ^ |
16
+ +---- scope/contract replan -----+
17
+ QUALITY -- bounded repair --> QUALITY
17
18
 
18
19
  any active stage --explicit user abort--> CLOSED
19
20
  ```
@@ -27,18 +28,19 @@ Pure conversation, explanation, analysis, and read-only review stay Ready and cr
27
28
  - `approval_mode = approve|guard|confirm|auto` controls whether a legal transition waits for a
28
29
  user. `confirm` waits only at ANALYSIS -> IMPLEMENT; after that, green QUALITY, MEMORY, and
29
30
  COMPLETE transitions advance automatically. `auto` advances every legal green
30
- edge. The only additional pause is an exceptional code diff detected after the frozen
31
+ edge. Dispatch keeps its explicit scope/executor decision; another pause is an exceptional code diff detected after the frozen
31
32
  QUALITY acceptance checkpoint; accepting that exact diff does not change the mode.
32
33
  - `workflow_mode = adaptive|fast|standard|strict` controls execution cost and assurance depth.
33
34
  - `unit_test_mode` independently selects `none`, `ut`, or `tdd`. It defaults to `none`;
34
35
  `ut_coverage_threshold` defaults to 90 and accepts integers from 1 to 100.
35
36
 
36
- Approval and unit test strategy retain session-over-project precedence. Execution depth is always the
37
+ Approval, cooperation and unit test settings use session > local > project > defaults, per field.
38
+ Local preferences live in optional `~/.easy-coding/config.yaml`; reads never create it. Execution depth is always the
37
39
  mechanically calculated minimum for the current change. Do not recommend, select a higher mode,
38
40
  or inherit an old task mode. Persist it once with `propose-workflow-mode --agent <agent-id>
39
41
  --session-file <P>`; the runtime calculates and freezes the value.
40
42
 
41
- Unit test strategy uses the same session-over-project precedence and freezes its mode and
43
+ Unit test strategy uses the same three-scope precedence and freezes its mode and
42
44
  `ut_coverage_threshold` on ANALYSIS -> IMPLEMENT. UT and TDD share passed local unit tests and
43
45
  changed-line coverage, and reuse `ec-tdd-init` readiness. Only TDD requires test-first lifecycle
44
46
  and its review dimension. UT keeps ordinary review and compact Fast planning. The `tdd-init`
@@ -126,7 +128,7 @@ or `qoder`. Never use a display or source-author attribution such as `Codex with
126
128
  `type=tdd-init` code task only after scope confirmation. Do not reinterpret it as an ordinary
127
129
  TDD-enabled feature task and do not require readiness before creating it.
128
130
  5. Match the user's intent against `current_task` and the active task list before resuming.
129
- If the user names or clearly matches another task, confirm the switch and call
131
+ If the user explicitly selects another task, that selection authorizes the switch; call
130
132
  `claim-task --task-id <id> --agent <agent-id> --session-file <P>`. Do not execute task A
131
133
  under task B's request.
132
134
  - With no explicit repository-mutation request, stay Ready and answer normally. Ambiguous
@@ -139,7 +141,23 @@ or `qoder`. Never use a display or source-author attribution such as `Codex with
139
141
  6. Resume the matched/current task, then load only state-relevant assets. Do not read five full
140
142
  memories at every startup; ANALYSIS searches memory metadata and opens relevant entries on
141
143
  demand.
142
- 7. If another Agent last owned the task, summarize the stored handoff before continuing.
144
+ 7. Honor the returned `continuation` before generic stage dispatch. Summarize the existing handoff,
145
+ consume its approved scope and references, and stop at `stop_after`. Never create a new task,
146
+ replan, or ask again to approve already accepted work merely because the Agent changed.
147
+ `cooperation.coordinator` stays the main Agent/session while `last_agent` tracks the executor.
148
+ A repeated claim of the same active task does not require another claim record.
149
+
150
+ ## Manual dispatch
151
+
152
+ `cooperate_mode=default` preserves handoff at stage boundaries. `dispatch` also supports handing
153
+ a QUALITY repair to another Agent without changing stage. The user manually switches Agents.
154
+ At an implementation decision, offer current-Agent execution, handoff, or defer/change once.
155
+ "Confirm and hand off" consumes the existing pending stage approval before writing a handoff;
156
+ "handoff for analysis" alone does not approve implementation. Do not ask again on claim.
157
+ Use `handoff-task --continuation` with `next_action`, existing `unit_ids`, optional `evidence_refs`,
158
+ and `stop_after`. Implement-only handoff uses `next_action:implement, stop_after:IMPLEMENT`;
159
+ on completion return `next_action:quality` to the coordinator. QUALITY repairs follow ec-quality.
160
+ The user can authorize the coordinator to fix a small change directly in either mode.
143
161
 
144
162
  ## Stage dispatch
145
163
 
@@ -158,7 +176,8 @@ clears the pending action so the corrected action can proceed; never overwrite a
158
176
  pending action.
159
177
 
160
178
  Creation and claim return `spec_context.consumption` for the stored selection. Consume it before
161
- dispatching a stage. After session resume or design sync, call `resume-spec-context --agent
179
+ dispatching a stage. Reuse a matching current-session receipt (`spec_context.reused:true`) and context already loaded.
180
+ If context was lost, the session is new, or design changed, call `resume-spec-context --agent
162
181
  <agent-id> --session-file <P>` and consume its returned closure. A blocked context requires
163
182
  source repair or design sync; never continue from a handoff summary alone. If `spec_change` is
164
183
  pending, resume that confirmed change on the bound original file before implementation/QUALITY.
@@ -211,8 +230,9 @@ acceptance-diff choice and returns to the stage required by the state API.
211
230
  For an explicitly confirmed rollback, scope reduction, or bounded correction of an active task,
212
231
  call `begin-correction --file <existing-task-file> ... --summary <confirmed-change>
213
232
  [--risk <actual-new-risk>] --agent <agent-id> --session-file <P>`. The runtime preserves the plan,
214
- unaffected Units and evidence, consumes old QUALITY state, and enters IMPLEMENT at the mechanical
215
- minimum for these files. Do not reconstruct the original task or its documents. Synchronize only
233
+ unaffected Units and evidence. In QUALITY it prepares an in-stage repair bundle; use
234
+ `start-quality-repair` and `complete-quality-repair` without a stage transition. Other active stages
235
+ use IMPLEMENT at the mechanical minimum for these files. Do not reconstruct the original task or its documents. Synchronize only
216
236
  conflicting source Spec clauses once when needed; then continue the correction. Never restore an
217
237
  entire file over unrelated user edits. A new feature or expanded contract still needs ANALYSIS.
218
238
 
@@ -12,7 +12,7 @@ Start every work reply with the single Markdown blockquote status line injected
12
12
  then a blank line. Do not render the machine breadcrumbs to the user.
13
13
 
14
14
  `{approval-mode}` is the effective approval mode and `{workflow-mode}` is the configured or
15
- task-frozen execution mode; session overrides take precedence over project settings.
15
+ task-frozen execution mode; behavior settings resolve per field: session > optional local ~/.easy-coding/config.yaml > project > defaults.
16
16
  When effective/frozen unit_test_mode is `ut` or `tdd`, insert `· **UT**` or `· **TDD**`
17
17
  immediately after Workflow. For `none`, omit this segment and preserve the status-line format.
18
18
 
@@ -43,17 +43,18 @@ First run `ec-init`; daily work goes through `ec-workflow`.
43
43
 
44
44
  ## Workflow discipline
45
45
 
46
- - Approval mode is session override > project `behavior.approval_mode` > `guard`; workflow mode
46
+ - Approval mode is session override > local ~/.easy-coding/config.yaml > project `behavior.approval_mode` > `guard`; workflow mode
47
47
  is the mechanical minimum for the current actual change. Approval controls waiting;
48
48
  workflow controls execution depth. Do not recommend or inflate the calculated mode.
49
49
  Confirm approval waits only at ANALYSIS -> IMPLEMENT, then advances green later stages
50
- automatically; Auto advances all legal green edges. A new code diff after the QUALITY
51
- checkpoint is the only exceptional pause across all modes: show the exact diff, bind acceptance
50
+ automatically; Auto advances all legal green edges. Dispatch retains the explicit scope/executor
51
+ decision, merged with any required approval. A new code diff after the QUALITY
52
+ checkpoint also pauses across all modes: show the exact diff, bind acceptance
52
53
  to its digest, and continue without rereview when the user accepts.
53
54
  Every mutation task runs QUALITY; no mode changes scope, delivery form, or evidence gates.
54
- - Unit test strategy is session override > project `behavior.unit_test_mode` > `none`.
55
+ - Unit test strategy is session override > local ~/.easy-coding/config.yaml > project `behavior.unit_test_mode` > `none`.
55
56
  Values are `none`, `ut`, and `tdd`; both enabled strategies share `ut_coverage_threshold`
56
- (session > project > 90, integer 1..100). ANALYSIS -> IMPLEMENT freezes strategy, threshold,
57
+ (session > local > project > 90, integer 1..100). ANALYSIS -> IMPLEMENT freezes strategy, threshold,
57
58
  and repository baselines. `none` adds no coverage work and retains ordinary task verification.
58
59
  UT requires passed local unit tests and changed-production-line coverage, without test-first
59
60
  ordering, RED/GREEN artifacts, or a separate TDD review. TDD additionally requires its lifecycle
@@ -113,7 +114,7 @@ First run `ec-init`; daily work goes through `ec-workflow`.
113
114
  Runtime progress must use the shared writer with CAS/idempotency and reconciliation; static
114
115
  confirmed design changes first use `begin-spec-change`, then revision + READY + `sync-spec-design`.
115
116
  Creation/claim returns selected source context; session resume and design sync require
116
- `resume-spec-context` before work. Pending changes block implementation/acceptance across agents.
117
+ `resume-spec-context` only when current-session context is missing or design changed; otherwise reuse it. Pending changes block implementation/acceptance across agents.
117
118
  Preserve the original writer actor while retaining the current owner during reconciliation.
118
119
  Never hand-edit `EDS:EXECUTION`.
119
120
  Selected source tasks remain `implemented` through local QUALITY and become `verified`
@@ -166,3 +167,19 @@ speculative fallback/retry/compatibility logic, or defensive copying.
166
167
 
167
168
  Add project-specific instructions below this line. The generated region above is managed by
168
169
  easy-coding-harness and is replaced on `easy-coding upgrade`.
170
+
171
+ ## Cooperation and bounded QUALITY repair
172
+
173
+ `cooperate_mode: default | dispatch` is independent of approval and unit-test strategy, with
174
+ session > optional local `~/.easy-coding/config.yaml` > project > default precedence. Reads never
175
+ create local config; ec-config changes only explicitly selected fields and can restore inheritance.
176
+ Default preserves stage-boundary handoff. Dispatch supports manual implementation and QUALITY
177
+ repair handoff; the user can always select current-Agent execution. Preserve the task coordinator,
178
+ use existing plan/evidence references and stop at the handoff's `stop_after`. Never launch another Agent.
179
+ Dispatch requires one user decision on scope and executor, even under Auto; combine any approval
180
+ with that same decision and never ask again on claim. Ordinary repairs stay in QUALITY using
181
+ begin-correction, start-quality-repair and complete-quality-repair. Only changed requirements,
182
+ contracts or a replaced main implementation plan justify returning to ANALYSIS/IMPLEMENT.
183
+ Review and verification remain read-only checks; approved repairs happen between them. Reuse
184
+ unaffected evidence, review the repair delta and run affected checks only. Do not rebuild the plan
185
+ or repeat completed checks because of handoff, stage labels or descriptive check-name changes.
@@ -12,7 +12,7 @@ Start every work reply with the single Markdown blockquote status line injected
12
12
  then a blank line. Do not render the machine breadcrumbs to the user.
13
13
 
14
14
  `{approval-mode}` is the effective approval mode and `{workflow-mode}` is the configured or
15
- task-frozen execution mode; session overrides take precedence over project settings.
15
+ task-frozen execution mode; behavior settings resolve per field: session > optional local ~/.easy-coding/config.yaml > project > defaults.
16
16
  When effective/frozen unit_test_mode is `ut` or `tdd`, insert `· **UT**` or `· **TDD**`
17
17
  immediately after Workflow. For `none`, omit this segment and preserve the status-line format.
18
18
 
@@ -41,17 +41,18 @@ First run `/ec-init`; daily work goes through `/ec-workflow`.
41
41
 
42
42
  ## Workflow discipline
43
43
 
44
- - Approval mode is session override > project `behavior.approval_mode` > `guard`; workflow mode
44
+ - Approval mode is session override > local ~/.easy-coding/config.yaml > project `behavior.approval_mode` > `guard`; workflow mode
45
45
  is the mechanical minimum for the current actual change. Approval controls waiting;
46
46
  workflow controls execution depth. Do not recommend or inflate the calculated mode.
47
47
  Confirm approval waits only at ANALYSIS -> IMPLEMENT, then advances green later stages
48
- automatically; Auto advances all legal green edges. A new code diff after the QUALITY
49
- checkpoint is the only exceptional pause across all modes: show the exact diff, bind acceptance
48
+ automatically; Auto advances all legal green edges. Dispatch retains the explicit scope/executor
49
+ decision, merged with any required approval. A new code diff after the QUALITY
50
+ checkpoint also pauses across all modes: show the exact diff, bind acceptance
50
51
  to its digest, and continue without rereview when the user accepts.
51
52
  Every mutation task runs QUALITY; no mode changes scope, delivery form, or evidence gates.
52
- - Unit test strategy is session override > project `behavior.unit_test_mode` > `none`.
53
+ - Unit test strategy is session override > local ~/.easy-coding/config.yaml > project `behavior.unit_test_mode` > `none`.
53
54
  Values are `none`, `ut`, and `tdd`; both enabled strategies share `ut_coverage_threshold`
54
- (session > project > 90, integer 1..100). ANALYSIS -> IMPLEMENT freezes strategy, threshold,
55
+ (session > local > project > 90, integer 1..100). ANALYSIS -> IMPLEMENT freezes strategy, threshold,
55
56
  and repository baselines. `none` adds no coverage work and retains ordinary task verification.
56
57
  UT requires passed local unit tests and changed-production-line coverage, without test-first
57
58
  ordering, RED/GREEN artifacts, or a separate TDD review. TDD additionally requires its lifecycle
@@ -111,7 +112,7 @@ First run `/ec-init`; daily work goes through `/ec-workflow`.
111
112
  Runtime progress must use the shared writer with CAS/idempotency and reconciliation; static
112
113
  confirmed design changes first use `begin-spec-change`, then revision + READY + `sync-spec-design`.
113
114
  Creation/claim returns selected source context; session resume and design sync require
114
- `resume-spec-context` before work. Pending changes block implementation/acceptance across agents.
115
+ `resume-spec-context` only when current-session context is missing or design changed; otherwise reuse it. Pending changes block implementation/acceptance across agents.
115
116
  Preserve the original writer actor while retaining the current owner during reconciliation.
116
117
  Never hand-edit `EDS:EXECUTION`.
117
118
  Selected source tasks remain `implemented` through local QUALITY and become `verified`
@@ -161,3 +162,19 @@ speculative fallback/retry/compatibility logic, or defensive copying.
161
162
 
162
163
  Add project-specific instructions below this line. The generated region above is managed by
163
164
  easy-coding-harness and is replaced on `easy-coding upgrade`.
165
+
166
+ ## Cooperation and bounded QUALITY repair
167
+
168
+ `cooperate_mode: default | dispatch` is independent of approval and unit-test strategy, with
169
+ session > optional local `~/.easy-coding/config.yaml` > project > default precedence. Reads never
170
+ create local config; ec-config changes only explicitly selected fields and can restore inheritance.
171
+ Default preserves stage-boundary handoff. Dispatch supports manual implementation and QUALITY
172
+ repair handoff; the user can always select current-Agent execution. Preserve the task coordinator,
173
+ use existing plan/evidence references and stop at the handoff's `stop_after`. Never launch another Agent.
174
+ Dispatch requires one user decision on scope and executor, even under Auto; combine any approval
175
+ with that same decision and never ask again on claim. Ordinary repairs stay in QUALITY using
176
+ begin-correction, start-quality-repair and complete-quality-repair. Only changed requirements,
177
+ contracts or a replaced main implementation plan justify returning to ANALYSIS/IMPLEMENT.
178
+ Review and verification remain read-only checks; approved repairs happen between them. Reuse
179
+ unaffected evidence, review the repair delta and run affected checks only. Do not rebuild the plan
180
+ or repeat completed checks because of handoff, stage labels or descriptive check-name changes.
@@ -40,6 +40,24 @@ def memo(key, compute):
40
40
  return cache[key]
41
41
 
42
42
 
43
+ def invalidate_memo(key):
44
+ cache = _operation.get()
45
+ if cache is not None:
46
+ cache.pop(key, None)
47
+
48
+
49
+ def cached_memo(key):
50
+ cache = _operation.get()
51
+ return cache.get(key) if cache is not None else None
52
+
53
+
54
+ def command_identity(command):
55
+ # Shell 展开和重定向受引号影响;只归一化普通 argv 命令,避免错误复用。
56
+ if re.search(r"[\$`\\\n;|&<>*?\[\]{}~#]", command):
57
+ return command
58
+ return tuple(shlex.split(command))
59
+
60
+
43
61
  def digest(value):
44
62
  return hashlib.sha256(json.dumps(value, sort_keys=True, ensure_ascii=False,
45
63
  separators=(",", ":")).encode()).hexdigest()