@hassangameryt/freeflow 0.6.0 → 0.7.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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +3 -2
- package/.codex-plugin/plugin.json +5 -6
- package/.cursor-plugin/plugin.json +25 -0
- package/README.md +66 -56
- package/capabilities/cognitive-routing/SKILL.md +288 -130
- package/com.github.copilot/hooks/hooks.json +11 -0
- package/command-surface.json +0 -24
- package/gemini-extension.json +5 -0
- package/hooks/adapters/claude-session-start.mjs +16 -0
- package/hooks/adapters/codex-session-start.mjs +16 -0
- package/hooks/adapters/copilot-session-start.mjs +13 -0
- package/hooks/adapters/cursor-session-start.mjs +13 -0
- package/hooks/adapters/gemini-session-start.mjs +15 -0
- package/hooks/claude/hooks.json +18 -0
- package/hooks/codex/hooks.json +18 -0
- package/hooks/cursor/hooks.json +9 -0
- package/hooks/freeflow-runtime-context.mjs +3 -650
- package/hooks/hooks.json +4 -30
- package/hooks/shared/runtime-context.mjs +210 -0
- package/hooks/tests/check-host-adapters.test.mjs +82 -0
- package/hooks/tests/check-runtime-context-hook.sh +140 -320
- package/package.json +20 -4
- package/pi-extension/dist/cognitive-routing/commands.js +3 -3
- package/pi-extension/dist/cognitive-routing/config.js +16 -20
- package/pi-extension/dist/cognitive-routing/controller.js +478 -48
- package/pi-extension/dist/cognitive-routing/history.js +12 -0
- package/pi-extension/dist/cognitive-routing/host.js +74 -12
- package/pi-extension/dist/cognitive-routing/pi-routing-session.js +414 -0
- package/pi-extension/dist/cognitive-routing/pi-session-control.js +320 -0
- package/pi-extension/dist/cognitive-routing/tool.js +1 -0
- package/pi-extension/dist/cognitive-routing/types.js +1 -1
- package/pi-extension/dist/index.js +236 -219
- package/pi-extension/dist/runtime/runtime-context.js +126 -286
- package/pi-extension/dist/settings/settings-ui.js +52 -336
- package/pi-extension/src/cognitive-routing/commands.ts +15 -5
- package/pi-extension/src/cognitive-routing/config.ts +16 -20
- package/pi-extension/src/cognitive-routing/controller.ts +561 -51
- package/pi-extension/src/cognitive-routing/history.ts +12 -0
- package/pi-extension/src/cognitive-routing/host.ts +110 -16
- package/pi-extension/src/cognitive-routing/pi-routing-session.ts +538 -0
- package/pi-extension/src/cognitive-routing/pi-session-control.ts +444 -0
- package/pi-extension/src/cognitive-routing/tool.ts +1 -0
- package/pi-extension/src/cognitive-routing/types.ts +1 -1
- package/pi-extension/src/index.ts +249 -239
- package/pi-extension/src/runtime/runtime-context.ts +129 -305
- package/pi-extension/src/settings/settings-ui.ts +53 -371
- package/pi-extension/tests/cognitive-routing/commands.test.js +1 -1
- package/pi-extension/tests/cognitive-routing/controller.test.js +69 -40
- package/pi-extension/tests/cognitive-routing/extension-lifecycle.test.js +128 -57
- package/pi-extension/tests/cognitive-routing/pi-normal-lifecycle.test.js +434 -0
- package/pi-extension/tests/cognitive-routing/pi-session-control.test.js +174 -0
- package/pi-extension/tests/cognitive-routing/pi-session-history.test.js +91 -0
- package/pi-extension/tests/cognitive-routing/profile-resolution.test.js +47 -4
- package/pi-extension/tests/integration/mode-free-core.test.js +218 -0
- package/pi-extension/tests/integration/pi-extension.test.js +430 -2478
- package/pi-extension/tests/integration/prompt-architecture.test.js +124 -79
- package/pi-extension/tests/integration/unaffected-regressions.test.js +411 -0
- package/plugin.json +33 -0
- package/runtime/prompts/cognitive-routing.md +5 -4
- package/runtime/prompts/conversation-history.md +1 -1
- package/runtime/prompts/core.md +77 -6
- package/runtime/prompts/interaction-contract.md +6 -2
- package/skills/action-selection/SKILL.md +93 -44
- package/skills/action-selection/references/trajectory-stalls.md +71 -0
- package/skills/bypass/SKILL.md +109 -39
- package/skills/commit-work/SKILL.md +94 -55
- package/skills/commit-work/references/git-state-edges.md +94 -0
- package/skills/commit-work/references/simple-push.md +92 -0
- package/skills/commit-work/references/staging-decisions.md +79 -46
- package/skills/decision-gate/SKILL.md +80 -22
- package/skills/design-for-depth/SKILL.md +208 -43
- package/skills/design-for-depth/references/design-pressure-signals.md +108 -240
- package/skills/design-for-depth/references/interface-design-loop.md +77 -97
- package/skills/design-for-depth/references/module-and-dependency-design.md +147 -0
- package/skills/design-for-depth/references/software-design-philosophy.md +127 -173
- package/skills/design-for-depth/references/state-and-failure-boundaries.md +136 -0
- package/skills/diagnose-failure/SKILL.md +198 -52
- package/skills/diagnose-failure/references/diagnostic-loop-catalog.md +19 -5
- package/skills/diagnose-failure/references/flaky-and-performance-diagnosis.md +13 -5
- package/skills/discuss/SKILL.md +118 -76
- package/skills/discuss/references/discussion-continuity.md +84 -32
- package/skills/evaluate-skill/SKILL.md +166 -52
- package/skills/evaluate-skill/references/evaluation-definition-schema.md +2 -2
- package/skills/evaluate-skill/references/evaluation-design.md +56 -30
- package/skills/evaluate-skill/references/execution-and-evidence.md +1 -1
- package/skills/evaluate-skill/references/review-and-revision.md +62 -21
- package/skills/execute-work/SKILL.md +98 -59
- package/skills/execute-work/references/code-practices.md +4 -4
- package/skills/execute-work/references/execute-work-edges.md +42 -22
- package/skills/review-artifact/SKILL.md +132 -71
- package/skills/review-artifact/references/adjudicate-artifact-review.md +101 -0
- package/skills/review-artifact/references/independent-artifact-reviewer-contract.md +52 -41
- package/skills/review-work/SKILL.md +115 -72
- package/skills/review-work/references/adjudicate-work-review.md +97 -0
- package/skills/review-work/references/independent-work-reviewer-contract.md +40 -35
- package/skills/review-work/references/security-risk-lens.md +17 -15
- package/skills/setup-freeflow/SKILL.md +14 -17
- package/skills/setup-freeflow/references/activation-contract.md +24 -30
- package/skills/setup-freeflow/references/host-setup.md +6 -7
- package/skills/simplify-code/SKILL.md +97 -39
- package/skills/simplify-code/references/simplification-patterns.md +1 -1
- package/skills/tdd/SKILL.md +108 -41
- package/skills/tdd/references/test-design.md +1 -1
- package/skills/track-work/SKILL.md +133 -300
- package/skills/track-work/references/working-record-format.md +515 -0
- package/skills/track-work/scripts/lib/document.mjs +713 -0
- package/skills/track-work/scripts/lib/format.mjs +166 -0
- package/skills/track-work/scripts/lib/store.mjs +233 -0
- package/skills/track-work/scripts/lib/transitions.mjs +790 -0
- package/skills/track-work/scripts/lib/views.mjs +27 -430
- package/skills/track-work/scripts/working-record.mjs +292 -98
- package/skills/verify-work/SKILL.md +46 -20
- package/skills/verify-work/references/browser-runtime-evidence.md +1 -1
- package/skills/verify-work/references/integration-evidence.md +1 -7
- package/skills/verify-work/references/performance-evidence.md +1 -1
- package/skills/workflow/SKILL.md +110 -80
- package/skills/workflow/references/domain-skill-composition.md +24 -18
- package/skills/write-skill/SKILL.md +218 -62
- package/skills/write-skill/references/activation-boundaries.md +63 -21
- package/skills/write-skill/references/agent-first-instructions.md +61 -27
- package/skills/write-skill/references/progressive-disclosure.md +91 -41
- package/skills/write-skill/references/skill-dependency-graphs.md +190 -0
- package/runtime/prompts/skills.md +0 -65
- package/skills/mode-contract/SKILL.md +0 -104
- package/skills/track-work/scripts/lib/codec.mjs +0 -570
- package/skills/track-work/scripts/lib/commands.mjs +0 -568
- package/skills/track-work/scripts/lib/contract.mjs +0 -303
- package/skills/track-work/scripts/lib/model.mjs +0 -506
- package/skills/track-work/scripts/lib/operations.mjs +0 -965
- package/skills/track-work/scripts/lib/record-store.mjs +0 -264
- package/skills/track-work/scripts/lib/result.mjs +0 -37
- package/skills/track-work/scripts/lib/rewrites.mjs +0 -740
- package/skills/track-work/scripts/lib/schema.mjs +0 -277
- package/skills/track-work/scripts/lib/source-inventory.mjs +0 -162
- package/skills/track-work/scripts/lib/workspace.mjs +0 -134
|
@@ -1,229 +1,387 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "cognitive-routing"
|
|
3
|
-
description: "Use when Cognitive Routing is active
|
|
3
|
+
description: "Use when Cognitive Routing is active and automatic or manual compute control, profile transitions, delegated execution, direct Reasoning action, or boundary continuity must be interpreted."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Cognitive Routing
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Cognitive Routing is a Reasoning-governed compute-routing model for one active agent in one shared visible context:
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
- **Reasoning** leads material judgment. It interprets intent and evidence, resolves or preserves governing uncertainty, creates execution contracts, and assesses returned results for the current owner.
|
|
11
|
+
- **Standard** is the ordinary workhorse. It reasons about local mechanics, leads complete results when Reasoning yields, and executes decision-complete contracts when Reasoning delegates.
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
In Automatic mode, Reasoning governs route selection and material judgment, but it does not lead every execution route. **Delegate** is the stateful Reasoning-led execution loop; **Yield** transfers whole-result leadership to Standard; and **ACT_BOUNDED** gives Reasoning direct action only within an exceptional declared scope.
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
Both profiles can reason. This is not a thinking-versus-doing split, a Workflow phase model, a second agent, or detached consultation. Standard executes accepted direction and returns contradictions instead of silently changing it.
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
**Cognitive demand** is the capability needed to choose or perform the next action reliably given uncertainty, branching, causal depth, and consequence. It is not task size, tool count, or Workflow phase.
|
|
17
18
|
|
|
18
|
-
A **
|
|
19
|
+
A **material cognitive boundary** is a governing uncertainty or judgment that Standard must not settle while executing. Reasoning may settle enough direction to delegate one unit while retaining responsibility for what its evidence means.
|
|
19
20
|
|
|
20
|
-
**
|
|
21
|
+
A **decision-complete unit** gives Standard enough direction to proceed without choosing a material change to outcome, architecture, policy, failure behavior, scope, authority, or evidence requirements. It applies to Standard’s assigned unit, not necessarily to the whole cognitive boundary.
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
Cognitive Routing changes compute only. It does not change the current owner, authority, permitted effects, evidence requirements, review independence, bounded activity, Slice, or Supported Exit. A profile switch never authorizes action, resolves a user decision, creates task memory, proves a result, or changes ownership.
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
[Workflow](../../skills/workflow/SKILL.md) owns authority, the active method, checkpoints, and Supported Exit. When durable task memory is needed, [Track Work](../../skills/track-work/SKILL.md) records it. Cognitive Routing owns neither.
|
|
26
|
+
|
|
27
|
+
Both profiles inherit the same visible conversation, tool history, current owner, authority envelope, task memory, and evidence. A switch changes compute, not context; do not reconstruct or restate inherited state after switching. Visible transfer records carry only the governing conclusions, execution responsibility, and return conditions needed by the receiving profile.
|
|
28
|
+
|
|
29
|
+
There are two control modes:
|
|
30
|
+
|
|
31
|
+
- **Automatic:** each new user interaction begins in Reasoning, which chooses how covered execution reaches the environment.
|
|
32
|
+
- **Manual:** the user holds Standard or Reasoning, and that profile runs the ordinary unsplit Workflow. Automatic routing does not apply.
|
|
33
|
+
|
|
34
|
+
The existing `freeflow_switch_profile` tool is the only profile-switch mechanism. This skill gives that tool meaning; it does not create another tool.
|
|
25
35
|
|
|
26
36
|
## Read Current State
|
|
27
37
|
|
|
28
|
-
|
|
38
|
+
Use the latest extension-generated `Control` and `Profile`. Earlier profile state, transition results, and natural-language suggestions are history or advice.
|
|
39
|
+
|
|
40
|
+
Runtime State establishes current control and profile, not the model-written Yield, Delegate, or `ACT_BOUNDED` route or execution-boundary state. A Runtime State refresh is host context, not an interruption; it does not end an active route or `ACT_BOUNDED` scope unless the reported state contradicts it.
|
|
29
41
|
|
|
30
|
-
| Runtime state |
|
|
42
|
+
| Runtime state | Required behavior |
|
|
31
43
|
| --- | --- |
|
|
32
|
-
| Automatic ·
|
|
33
|
-
| Automatic ·
|
|
34
|
-
|
|
|
35
|
-
| Manual ·
|
|
44
|
+
| Automatic · Reasoning | Lead analysis, discussion, decisions, assessment, and reporting. Route execution through `YIELD`, `DELEGATE`, or qualifying `ACT_BOUNDED`. |
|
|
45
|
+
| Automatic · Standard during Yield | Lead one complete ordinary bounded result and hand it back. |
|
|
46
|
+
| Automatic · Standard during Delegate | Execute the open contract while Reasoning retains boundary responsibility. |
|
|
47
|
+
| Manual · Standard | Run the ordinary unsplit Workflow; no automatic routing protocol applies. |
|
|
48
|
+
| Manual · Reasoning | Run the ordinary unsplit Workflow; no automatic routing protocol applies. |
|
|
49
|
+
|
|
50
|
+
In Automatic mode, Reasoning owns all substantive user-facing interpretation, questions, decisions, assessment, progress, and final reporting. Its conversational analysis and reporting need no route marker.
|
|
51
|
+
|
|
52
|
+
Automatic Standard never conducts substantive user-facing interaction. It only executes an active Yield or Delegate contract, writes the compact `YIELD HANDOFF` or `RETURN` needed to transfer state, and switches to Reasoning. It must not interpret or answer user messages, ask questions, discuss decisions, assess results, or give progress or final reports. The transfer record is control text, not substantive user interaction.
|
|
53
|
+
|
|
54
|
+
In Automatic mode, begin every new user interaction in Reasoning, even if the preceding route used Standard. At any return condition—including available evidence, completion, a blocker or material question, a contract stop condition, failure, or a fresh user message—Standard finishes only the current atomic environment interaction, preserves partial effects and unverified work, writes the active route’s transfer record, and switches to Reasoning. Reasoning then interprets, assesses, asks, discusses, or reports.
|
|
55
|
+
|
|
56
|
+
Outside an explicit `ACT_BOUNDED` scope, Automatic Reasoning must not perform environment interaction, active evidence generation, mutation, tests, diagnostics, builds, probes, or substantive artifact production. Its only tool call is `freeflow_switch_profile`, which is a control operation.
|
|
57
|
+
|
|
58
|
+
The current owner remains unchanged across profile transitions.
|
|
59
|
+
|
|
60
|
+
## Choose Automatic Execution
|
|
61
|
+
|
|
62
|
+
When covered execution is needed, inspect the current boundary state first. Then route by residual cognitive responsibility—not by task phase, apparent complexity, or tool count.
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
Automatic · Reasoning
|
|
66
|
+
└─ execution is needed
|
|
67
|
+
├─ Boundary OPEN
|
|
68
|
+
│ ├─ DELEGATE the next unit, including work that would otherwise look like Yield
|
|
69
|
+
│ ├─ ACT_BOUNDED if its independent conditions hold
|
|
70
|
+
│ ├─ suspend or route a contradiction, choice, or changed boundary
|
|
71
|
+
│ └─ CLOSE only after the bounded result is supported and reviewed
|
|
72
|
+
└─ Boundary NONE
|
|
73
|
+
├─ YIELD if Standard can own the whole bounded result
|
|
74
|
+
├─ ACT_BOUNDED if its independent conditions hold
|
|
75
|
+
└─ otherwise DELEGATE and open a boundary
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Boundary OPEN
|
|
79
|
+
|
|
80
|
+
Delegate is the continuing execution route while a boundary is `OPEN`. Standard executes decision-complete units and returns through the same boundary; Reasoning interprets the evidence and decides what follows.
|
|
81
|
+
|
|
82
|
+
Do not use literal `YIELD` while a Delegate boundary is open, and do not close the boundary merely to obtain Yield. If a unit would qualify for Yield in isolation, it remains Delegate because Reasoning still owns the boundary.
|
|
83
|
+
|
|
84
|
+
`ACT_BOUNDED` may temporarily operate inside an open Delegate boundary when its own conditions hold. It contributes evidence or effects to that boundary but never contains Delegate and never closes the boundary.
|
|
85
|
+
|
|
86
|
+
### Boundary NONE
|
|
87
|
+
|
|
88
|
+
Use **YIELD** only when Standard can own the whole result end to end: the result is small, exact, local, reversible, low-risk, directly verifiable, and requires no new material Reasoning judgment after execution. Yield creates no boundary.
|
|
89
|
+
|
|
90
|
+
Use **ACT_BOUNDED** only when judgment and environment action are materially inseparable and delegation would materially lose more than premium execution costs. It creates no boundary.
|
|
36
91
|
|
|
37
|
-
|
|
92
|
+
Otherwise use **DELEGATE**. This is the default when Reasoning must interpret returned evidence or govern what follows, including substantial work, unresolved local choices, source inspection, research, exploration, diagnostics, tests, verification, and evidence gathering.
|
|
38
93
|
|
|
39
|
-
|
|
94
|
+
For Delegate, the normal loop is:
|
|
40
95
|
|
|
41
|
-
|
|
96
|
+
```text
|
|
97
|
+
Reasoning frames the question or settled direction
|
|
98
|
+
-> writes a decision-complete contract for one unit
|
|
99
|
+
-> switches to Standard
|
|
100
|
+
-> Standard executes and returns evidence
|
|
101
|
+
-> Reasoning interprets the evidence
|
|
102
|
+
-> more accepted work: delegate again
|
|
103
|
+
-> supported and complete: self-review, then CLOSE
|
|
104
|
+
-> contradiction or material change: diagnose, decide, ask, or return to Workflow
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
One environment call may still require Delegate. A large overall task may Yield one small, exact, ordinary bounded result. Better performance, convenience, fewer transitions, fewer tool calls, or preference for Reasoning never justifies direct access.
|
|
108
|
+
|
|
109
|
+
If uncertain, use `DELEGATE`.
|
|
110
|
+
|
|
111
|
+
A route never widens authority. If outcome, scope, authority, evidence boundary, or stop condition is unsettled, return to Workflow or [Decision Gate](../../skills/decision-gate/SKILL.md) before execution.
|
|
112
|
+
|
|
113
|
+
Examples:
|
|
114
|
+
|
|
115
|
+
- With boundary `NONE`, reading an exact package version and reporting it may Yield.
|
|
116
|
+
- With boundary `NONE`, reading a configuration file so Reasoning can choose an architecture requires Delegate.
|
|
117
|
+
- With boundary `OPEN`, even an exact package-version read remains Delegate and returns through the open boundary.
|
|
118
|
+
- A sensitive intervention whose next action depends on interpreting each prior effect may qualify for `ACT_BOUNDED`.
|
|
119
|
+
|
|
120
|
+
## Switching Profiles
|
|
121
|
+
|
|
122
|
+
Every automatic profile transition uses:
|
|
123
|
+
|
|
124
|
+
```text
|
|
125
|
+
freeflow_switch_profile(
|
|
126
|
+
target="reasoning" | "standard",
|
|
127
|
+
reason="one-sentence audit label"
|
|
128
|
+
)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Write the applicable Yield brief, Delegate contract, handoff, or return before switching. The switch must be the only tool call in that assistant response. Shared context carries existing evidence; visible routing text carries only the meaning the receiving profile needs.
|
|
132
|
+
|
|
133
|
+
Do not switch after every tool call or during an atomic environment interaction when avoidable. Keep Standard active until its contract reaches a return condition.
|
|
134
|
+
|
|
135
|
+
## Reasoning Execution Boundaries
|
|
136
|
+
|
|
137
|
+
A **Reasoning execution boundary** is the visible protocol that keeps one material cognitive boundary coherent while Standard executes. Yield and `ACT_BOUNDED` do not create one. Reasoning owns the execution boundary; the current owner owns the bounded activity.
|
|
138
|
+
|
|
139
|
+
A Slice may contain zero, one, or many sequential boundaries. At most one boundary is `OPEN` at a time. Keep boundary state separate from its operation:
|
|
42
140
|
|
|
43
141
|
```text
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
-> Reasoning makes the governing judgment and contract explicit
|
|
47
|
-
-> DELEGATE bounded execution to Standard
|
|
48
|
-
-> Standard executes the current owner's method and gathers required evidence
|
|
49
|
-
-> RETURN evidence to Reasoning
|
|
50
|
-
-> Reasoning resumes the current owner and assesses what the return supports
|
|
51
|
-
-> supported: self-review
|
|
52
|
-
-> complete: CLOSE + HANDOFF
|
|
53
|
-
-> more accepted work: DELEGATE again
|
|
54
|
-
-> clear local defect: issue remediation contract and DELEGATE
|
|
55
|
-
-> failed, inconclusive, repeated, route-changing, or unauthorized: reassess, diagnose, or return to Workflow
|
|
142
|
+
Boundary state: NONE | OPEN
|
|
143
|
+
Boundary operation: NEW | REOPEN | CLOSE
|
|
56
144
|
```
|
|
57
145
|
|
|
58
|
-
|
|
146
|
+
- `NEW` opens the first delegated boundary for one bounded outcome.
|
|
147
|
+
- `REOPEN` is an authorized continuation of the same previously closed outcome, requiring fresh authority and either invalidating evidence or changed intent.
|
|
148
|
+
- `RETURN` is a transfer record that gives execution evidence back to Reasoning while leaving the boundary `OPEN`; it is not a boundary operation.
|
|
149
|
+
- `CLOSE` returns the boundary to `NONE`.
|
|
150
|
+
|
|
151
|
+
Opening, returning through, reopening, or closing a boundary never selects, extends, settles, or closes the wider Slice. A boundary cannot continue across distinct bounded activities.
|
|
152
|
+
|
|
153
|
+
## Standard’s Contract
|
|
59
154
|
|
|
60
|
-
|
|
155
|
+
During Yield or Delegate, Standard executes the current owner’s method under the applicable direction. It may reason about local mechanics, choose repository-consistent reversible details, use [Action Selection](../../skills/action-selection/SKILL.md), and apply appropriate methods such as [TDD](../../skills/tdd/SKILL.md) or [Simplify Code](../../skills/simplify-code/SKILL.md). It may gather required evidence, verify, and perform ordinary self-review through [Review Work](../../skills/review-work/SKILL.md).
|
|
61
156
|
|
|
62
|
-
|
|
157
|
+
Standard must return rather than settle or silently reinterpret a material change to outcome, architecture, policy, failure behavior, scope, authority, evidence boundary, or governing direction. It must return when:
|
|
158
|
+
|
|
159
|
+
- the contract’s result or required evidence is available;
|
|
160
|
+
- scoped execution or verification ends;
|
|
161
|
+
- the Yield result is no longer exact or local, or broad exploration or material Reasoning judgment becomes necessary;
|
|
162
|
+
- a blocker, material question, contradiction, or user-owned choice appears;
|
|
163
|
+
- execution, verification, or evidence fails or becomes inconclusive;
|
|
164
|
+
- scope, architecture, policy, failure behavior, authority, or evidence requirements materially change;
|
|
165
|
+
- the contract’s stop condition is reached;
|
|
166
|
+
- no covered action can advance the result;
|
|
167
|
+
- any fresh user message arrives, including interruption, cancellation, or direction change.
|
|
168
|
+
|
|
169
|
+
At a return condition, finish only the current atomic environment interaction, preserve partial effects and unverified work, write the active route’s transfer record, and switch to Reasoning. A fresh user message is never interpreted or answered by Automatic Standard.
|
|
170
|
+
|
|
171
|
+
## Yield To Standard
|
|
172
|
+
|
|
173
|
+
Yield is a one-off leadership transfer for one complete ordinary bounded result. Use it only while:
|
|
174
|
+
|
|
175
|
+
```text
|
|
176
|
+
Boundary state: NONE
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Before switching, write an adaptive brief beginning with literal `YIELD`. Make clear what Standard owns, the constraints and evidence, and when it must hand back. One line is enough when the result is obvious. Then switch to Standard using the shared transition rule.
|
|
180
|
+
|
|
181
|
+
While Yield is active, Standard runs the ordinary unsplit Workflow for the yielded result and continues only while the original result and authority remain coherent. It hands back when the common return conditions apply, including when the result is supported and complete.
|
|
63
182
|
|
|
64
183
|
Write:
|
|
65
184
|
|
|
66
185
|
```text
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
Current owner:
|
|
73
|
-
Known constraints and evidence:
|
|
74
|
-
Judgment or contract needed:
|
|
186
|
+
YIELD HANDOFF
|
|
187
|
+
Result:
|
|
188
|
+
Evidence and limits:
|
|
189
|
+
Blocker, partial effects, or changed boundary, if any:
|
|
190
|
+
Handoff condition reached:
|
|
75
191
|
```
|
|
76
192
|
|
|
77
|
-
|
|
193
|
+
Then switch to Reasoning. `YIELD HANDOFF` is a profile transfer, not Delegate `RETURN` and not the separate point-in-time Handoff method. Reasoning accepts and reports a supported result or routes a changed issue through Workflow, Decision Gate, [Diagnose Failure](../../skills/diagnose-failure/SKILL.md), or another owner. Do not repeat Standard’s full self-review unless the handoff is contradictory or insufficient.
|
|
194
|
+
|
|
195
|
+
## Delegate To Standard
|
|
196
|
+
|
|
197
|
+
Use Delegate when Reasoning must retain cognitive leadership for execution evidence or what follows from it. Delegated observation, inspection, research, diagnostics, verification, and evidence gathering remain Standard execution even when mechanically small.
|
|
78
198
|
|
|
79
|
-
|
|
199
|
+
A decision-complete contract is the smallest instruction that leaves Standard with no unresolved material judgment for its assigned unit. Use shared context rather than replaying it. Include only what applies:
|
|
80
200
|
|
|
81
|
-
|
|
201
|
+
- bounded outcome;
|
|
202
|
+
- supported judgment, constraints, and invariants;
|
|
203
|
+
- scope and necessary ordering;
|
|
204
|
+
- reversible local choices Standard may make;
|
|
205
|
+
- required evidence or verification;
|
|
206
|
+
- conditions that require return.
|
|
82
207
|
|
|
83
|
-
Reasoning
|
|
208
|
+
Reasoning may first delegate evidence gathering for a boundary it has not yet settled. Standard investigates the question and returns evidence; it does not settle the boundary.
|
|
209
|
+
|
|
210
|
+
### Open And Execute
|
|
211
|
+
|
|
212
|
+
For the first transfer, write:
|
|
84
213
|
|
|
85
214
|
```text
|
|
86
|
-
|
|
215
|
+
DELEGATE
|
|
216
|
+
Boundary operation: NEW | REOPEN
|
|
87
217
|
Boundary state: OPEN
|
|
88
|
-
Bounded outcome:
|
|
89
|
-
Supported judgment and invariants:
|
|
90
|
-
Execution outcome:
|
|
91
|
-
Scope and necessary ordering:
|
|
92
|
-
Reversible local choices Standard may make:
|
|
93
|
-
Evidence required:
|
|
94
|
-
Stop and return when:
|
|
95
218
|
```
|
|
96
219
|
|
|
97
|
-
|
|
220
|
+
Use `NEW` for the first boundary. Use `REOPEN` only for the authorized continuation of the same previously closed outcome described above. When a boundary remains `OPEN` after `RETURN`, begin the next transfer with `DELEGATE` and omit `NEW` or `REOPEN`.
|
|
98
221
|
|
|
99
|
-
|
|
222
|
+
After the marker, give Standard the contract and switch to Standard. The switch must be the only tool call in that assistant response.
|
|
100
223
|
|
|
101
|
-
Action Selection
|
|
224
|
+
Action Selection and any direct fast-path interaction remain inside the current delegation and do not create another execution boundary.
|
|
102
225
|
|
|
103
|
-
Return
|
|
226
|
+
### Return
|
|
227
|
+
|
|
228
|
+
When a return condition occurs, write:
|
|
104
229
|
|
|
105
230
|
```text
|
|
106
|
-
|
|
231
|
+
RETURN
|
|
107
232
|
Boundary state: OPEN
|
|
108
|
-
|
|
109
|
-
|
|
233
|
+
|
|
234
|
+
Execution result:
|
|
235
|
+
Evidence and verification:
|
|
110
236
|
Contradictions, limits, or residual effects:
|
|
111
237
|
Return condition reached:
|
|
112
238
|
```
|
|
113
239
|
|
|
114
|
-
Then switch to Reasoning.
|
|
240
|
+
Then switch back to Reasoning. `RETURN` resumes the same open boundary; it is neither `NEW`, `REOPEN`, nor `CLOSE`. One delegated boundary may contain several Standard interactions and delegation iterations.
|
|
241
|
+
|
|
242
|
+
### Assess, Continue, Or Close
|
|
115
243
|
|
|
116
|
-
|
|
244
|
+
After `RETURN`, Reasoning resumes the current owner’s method and determines what the evidence supports. Use [Verify Work](../../skills/verify-work/SKILL.md) when a claim needs explicit classification at its required evidence boundary. Once evidence supports the affected result, perform same-agent self-review through the current owner.
|
|
117
245
|
|
|
118
|
-
|
|
246
|
+
Self-review is Reasoning’s judgment over an evidence-supported state, not environment execution. If it needs another read, test, diagnostic, or command, Delegate the smallest evidence unit and resume after `RETURN`. A selected independent review remains a separate Workflow route; profile transitions do not create or complete independent review.
|
|
119
247
|
|
|
120
|
-
|
|
248
|
+
Route the returned result as follows:
|
|
121
249
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
250
|
+
| Result | Next action | Boundary |
|
|
251
|
+
| --- | --- | --- |
|
|
252
|
+
| Supported and complete | Self-review, then close and report or continue through Workflow. | Close to `NONE`. |
|
|
253
|
+
| Supported with more accepted work | Delegate the next unit. | Remains `OPEN`. |
|
|
254
|
+
| One clear local defect | Delegate correction and affected verification through this boundary. | Remains `OPEN`. |
|
|
255
|
+
| Missing mechanical evidence | Delegate the smallest additional check. | Remains `OPEN`. |
|
|
256
|
+
| Unclear or repeated failure | Use [Diagnose Failure](../../skills/diagnose-failure/SKILL.md) or Workflow. | Open and suspended. |
|
|
257
|
+
| User-owned choice or source conflict | Use Decision Gate. | Open and suspended. |
|
|
258
|
+
| Changed intent, scope, authority, or source truth | Use Workflow. | Open and suspended until reconciled. |
|
|
259
|
+
| Distinct result or separately controlled work | Close or route the change through Workflow. | No silent continuation. |
|
|
129
260
|
|
|
130
|
-
|
|
261
|
+
A clear correction does not require a new boundary. Adapt the existing contract while preserving the original result and evidence. Do not create an automatic review-fix-review loop. If correction fails, repeats, or exposes shared-state consequences, use Diagnose Failure or Workflow.
|
|
131
262
|
|
|
132
|
-
|
|
263
|
+
Before reporting completion or choosing another execution route, explicitly write `CLOSE` and `Boundary state: NONE`. Otherwise the boundary remains `OPEN`.
|
|
264
|
+
|
|
265
|
+
When supported evidence and self-review settle the result, write:
|
|
133
266
|
|
|
134
267
|
```text
|
|
135
|
-
|
|
136
|
-
Boundary state:
|
|
137
|
-
Current owner:
|
|
268
|
+
CLOSE
|
|
269
|
+
Boundary state: NONE
|
|
270
|
+
Current owner: unchanged
|
|
271
|
+
|
|
138
272
|
Supported bounded result:
|
|
139
273
|
Important evidence, assumptions, and limits:
|
|
140
|
-
|
|
274
|
+
Next route:
|
|
141
275
|
REOPEN only if:
|
|
142
276
|
```
|
|
143
277
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
A reopen condition protects the conclusion from invalidating evidence; it does not preserve shadow Reasoning ownership. Ordinary reporting, cleanup, or a distinct bounded activity does not reopen the boundary.
|
|
278
|
+
Closing leaves Reasoning active. It may report, continue conversationally, or later choose `YIELD`, `DELEGATE` with `NEW`, or qualifying `ACT_BOUNDED` for another covered execution need.
|
|
147
279
|
|
|
148
|
-
|
|
280
|
+
Do not close an unsupported, inconclusive, blocked, contradictory, or route-changing result merely to clear the boundary.
|
|
149
281
|
|
|
150
|
-
|
|
282
|
+
## Act Bounded
|
|
151
283
|
|
|
152
|
-
|
|
284
|
+
`ACT_BOUNDED` is the only direct execution route for Automatic Reasoning. It creates no execution boundary, changes no owner, and grants no authority.
|
|
153
285
|
|
|
154
|
-
|
|
155
|
-
Reasoning observation: inspect <scope> to determine <question>; stop when <evidence boundary> is established.
|
|
156
|
-
```
|
|
286
|
+
Use it only when both are true:
|
|
157
287
|
|
|
158
|
-
|
|
288
|
+
1. judgment and environment action are materially inseparable; and
|
|
289
|
+
2. shared-context delegation would cause material loss beyond premium execution cost.
|
|
159
290
|
|
|
160
|
-
|
|
291
|
+
Before acting, write:
|
|
161
292
|
|
|
162
293
|
```text
|
|
163
|
-
|
|
294
|
+
ACT_BOUNDED
|
|
295
|
+
Scope and expected result:
|
|
164
296
|
Why judgment and action are inseparable:
|
|
165
|
-
|
|
166
|
-
|
|
297
|
+
Why delegation would materially lose:
|
|
298
|
+
Existing authority:
|
|
167
299
|
Stop and reassess when:
|
|
168
300
|
```
|
|
169
301
|
|
|
170
|
-
|
|
302
|
+
While the scope remains valid, Reasoning may use the related environment tools and perform only the bounded execution required by the result. Do not repeat the marker per call.
|
|
171
303
|
|
|
172
|
-
|
|
304
|
+
It may begin whenever Reasoning controls execution, with or without an open Delegate boundary, but never while Standard is executing Yield or Delegate. It may contribute evidence to an open boundary without closing it.
|
|
173
305
|
|
|
174
|
-
|
|
306
|
+
The scope ends at its stop condition, interruption, context loss, material scope change, authority change, or loss of eligibility. Return changed authority, ownership, direction, or evidence boundaries to Workflow.
|
|
175
307
|
|
|
176
|
-
|
|
308
|
+
Difficult artifact synthesis, consequential result-by-result intervention, or sensitive evolving judgment may qualify. Ordinary inspection, research, edits, tests, builds, verification, documentation, cleanup, convenience, and transition avoidance do not.
|
|
177
309
|
|
|
178
|
-
|
|
179
|
-
Yield to Standard
|
|
180
|
-
Boundary state: NONE
|
|
181
|
-
Standard owns:
|
|
182
|
-
```
|
|
310
|
+
If uncertain, `DELEGATE`.
|
|
183
311
|
|
|
184
|
-
|
|
312
|
+
## Manual Control
|
|
185
313
|
|
|
186
|
-
|
|
314
|
+
The user owns Manual versus Automatic control and the held profile. A manual hold survives turns, compaction, session resume, and reload until the user changes or releases it. If the held profile cannot continue reliably, state the blocker and exact user control needed; do not switch automatically.
|
|
187
315
|
|
|
188
|
-
|
|
316
|
+
Under Manual · Standard, Standard runs the ordinary unsplit Workflow, including user-facing interaction. Action Selection, TDD, Simplify Code, verification, review, diagnosis, and domain guidance remain available normally.
|
|
189
317
|
|
|
190
|
-
|
|
318
|
+
Under Manual · Reasoning, Reasoning runs the ordinary unsplit Workflow. The Automatic direct-environment restriction does not apply. Do not simulate Yield, Delegate, `YIELD HANDOFF`, `RETURN`, or `ACT_BOUNDED` merely because this skill is enabled.
|
|
191
319
|
|
|
192
|
-
|
|
320
|
+
A user control change takes effect at the next safe route boundary, never during an atomic environment interaction. Preserve supported results and visible contracts. If an automatic Delegate boundary is active, suspend it rather than silently abandoning it; the held manual profile then runs ordinary Workflow.
|
|
193
321
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
322
|
+
When the user releases Manual control, begin the next Automatic interaction in Reasoning and reconcile any suspended boundary before execution.
|
|
323
|
+
|
|
324
|
+
A control change changes compute only. It does not authorize work, resolve a user decision, close a boundary, or widen scope.
|
|
325
|
+
|
|
326
|
+
## Interruptions, Failed Switches, And Recovery
|
|
327
|
+
|
|
328
|
+
A failed transition preserves the supported route and never authorizes a workaround:
|
|
329
|
+
|
|
330
|
+
- failed Yield switch to Standard: remain in Reasoning; Standard does not begin;
|
|
331
|
+
- failed Delegate switch to Standard: the boundary remains `OPEN`; Standard does not begin;
|
|
332
|
+
- failed `YIELD HANDOFF` switch to Reasoning: Standard stops after the safe handoff point;
|
|
333
|
+
- failed `RETURN` switch to Reasoning: Standard stops and cannot resolve or close the open boundary;
|
|
334
|
+
- failed switch from Manual to Automatic: remain under the held manual profile.
|
|
335
|
+
|
|
336
|
+
Reasoning must not perform direct execution to bypass a failed transition. A fresh `ACT_BOUNDED` scope still requires its independent eligibility conditions.
|
|
200
337
|
|
|
201
|
-
|
|
338
|
+
If interruption prevents the transfer marker and Reasoning regains control, treat Yield as incomplete and Delegate as still `OPEN`; never infer completion from a profile change. If cancellation may have left partial effects, preserve them and route inspection through Standard. Once recovery is complete, a fresh `ACT_BOUNDED` scope may be used only if it independently qualifies.
|
|
202
339
|
|
|
203
|
-
|
|
340
|
+
After interruption, compaction, context loss, resume, reload, or uncertain continuity, recover before further task execution:
|
|
204
341
|
|
|
205
|
-
-
|
|
206
|
-
-
|
|
207
|
-
-
|
|
208
|
-
-
|
|
342
|
+
- latest extension-generated Control and Profile;
|
|
343
|
+
- current owner and bounded activity;
|
|
344
|
+
- active Yield or Delegate route;
|
|
345
|
+
- model-written boundary operation and state, when one exists;
|
|
346
|
+
- latest contract, handoff, or return;
|
|
347
|
+
- live authority, evidence, partial effects, unverified work, and stop condition.
|
|
209
348
|
|
|
210
|
-
|
|
349
|
+
Complete recovery before selecting another route. A fresh `ACT_BOUNDED` scope cannot begin until recovery is complete. During recovery, Automatic Reasoning has no direct environment access; route required inspection through Yield or Delegate. After recovery, a new ACT scope still needs independent qualification.
|
|
211
350
|
|
|
212
|
-
|
|
351
|
+
Do not infer:
|
|
352
|
+
|
|
353
|
+
- an open boundary from `Profile: standard`;
|
|
354
|
+
- Yield merely because no boundary is visible;
|
|
355
|
+
- completion from a profile change;
|
|
356
|
+
- authority from a prior contract;
|
|
357
|
+
- live state from task memory.
|
|
358
|
+
|
|
359
|
+
A Working Record may preserve task context but never becomes routing state or authority.
|
|
360
|
+
|
|
361
|
+
An open boundary may survive turns, compaction, resume, reload, delegated execution, and evidence-driven re-entry while its original outcome remains coherent. A stale contract never overrides contradictory live evidence. If route identity, continuity, authority, ownership, or boundary state is unclear, stop and return the uncertainty to Workflow.
|
|
213
362
|
|
|
214
363
|
## Stop
|
|
215
364
|
|
|
216
|
-
|
|
365
|
+
End the current automatic route when:
|
|
366
|
+
|
|
367
|
+
- `YIELD HANDOFF` safely returns a yielded result or changed boundary;
|
|
368
|
+
- Reasoning closes a Delegate boundary;
|
|
369
|
+
- an `ACT_BOUNDED` scope reaches its stop condition;
|
|
370
|
+
- no execution-bearing bounded activity is authorized;
|
|
371
|
+
- Workflow reaches a Supported Exit.
|
|
372
|
+
|
|
373
|
+
Automatic routing remains available for another covered execution need. When Cognitive Routing is inactive or control is Manual, this automatic protocol does not apply.
|
|
217
374
|
|
|
218
375
|
Do not:
|
|
219
376
|
|
|
220
|
-
- let Automatic
|
|
221
|
-
-
|
|
222
|
-
-
|
|
223
|
-
-
|
|
224
|
-
-
|
|
225
|
-
- create
|
|
226
|
-
- keep
|
|
377
|
+
- let Automatic Reasoning perform direct execution outside `ACT_BOUNDED`;
|
|
378
|
+
- let Automatic Standard begin execution without an active contract or conduct substantive user-facing interaction outside transfer control text;
|
|
379
|
+
- let Standard settle unresolved material judgment or decide whether Reasoning is needed;
|
|
380
|
+
- turn a profile into a new owner or treat profile capability as authority;
|
|
381
|
+
- treat Yield as an open boundary or `RETURN` as boundary closure;
|
|
382
|
+
- create a boundary per tool call, correction, or self-review;
|
|
383
|
+
- keep a boundary across distinct bounded activities;
|
|
384
|
+
- close an unsupported boundary to avoid resolving it;
|
|
385
|
+
- use `ACT_BOUNDED` for ordinary work, convenience, or transition avoidance;
|
|
227
386
|
- continue an unclear or repeated correction loop;
|
|
228
|
-
- hide transfer meaning in private reasoning
|
|
229
|
-
- treat profile capability as action authority.
|
|
387
|
+
- hide transfer meaning in private reasoning.
|
package/command-surface.json
CHANGED
|
@@ -5,30 +5,6 @@
|
|
|
5
5
|
"codex": "skill-mention",
|
|
6
6
|
"pi": "registered-command"
|
|
7
7
|
},
|
|
8
|
-
"sessionModeControls": {
|
|
9
|
-
"claude": "/freeflow:mode-contract <mode|reset>",
|
|
10
|
-
"codex": "$mode-contract <mode|reset>",
|
|
11
|
-
"pi": "/freeflow mode <mode|reset>",
|
|
12
|
-
"naturalLanguage": true
|
|
13
|
-
},
|
|
14
|
-
"modeCommands": [
|
|
15
|
-
{
|
|
16
|
-
"command": "/freeflow mode conversation",
|
|
17
|
-
"routesTo": "mode-contract"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"command": "/freeflow mode workflow",
|
|
21
|
-
"routesTo": "mode-contract"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"command": "/freeflow mode strict-workflow",
|
|
25
|
-
"routesTo": "mode-contract"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"command": "/freeflow mode reset",
|
|
29
|
-
"routesTo": "mode-contract"
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
8
|
"directSkillCalls": [
|
|
33
9
|
{
|
|
34
10
|
"command": "/discuss",
|