@hassangameryt/freeflow 0.7.2 → 0.8.0
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 +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.cursor-plugin/plugin.json +1 -1
- package/NOTICE +14 -0
- package/README.md +151 -136
- package/capabilities/cognitive-routing/SKILL.md +110 -96
- package/capabilities/cognitive-routing/references/both-mode.md +36 -0
- package/capabilities/cognitive-routing/references/executor-mode.md +48 -0
- package/capabilities/cognitive-routing/references/helper-mode.md +47 -0
- package/capabilities/compaction/SKILL.md +49 -0
- package/capabilities/compaction/references/summary-format.md +239 -0
- package/command-surface.json +4 -0
- package/gemini-extension.json +1 -1
- package/hooks/shared/runtime-context.mjs +28 -30
- package/licenses/Apache-2.0.txt +55 -0
- package/package.json +22 -9
- package/pi-extension/README.md +41 -0
- package/pi-extension/dist/cognitive-routing/assembler.js +393 -0
- package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/config.js +40 -21
- package/pi-extension/dist/cognitive-routing/economics.js +45 -0
- package/pi-extension/dist/cognitive-routing/event-schema.js +388 -0
- package/pi-extension/dist/cognitive-routing/event-store.js +280 -0
- package/pi-extension/dist/cognitive-routing/gate.js +241 -0
- package/pi-extension/dist/cognitive-routing/handlers.js +899 -0
- package/pi-extension/dist/cognitive-routing/handoffs.js +350 -0
- package/pi-extension/dist/cognitive-routing/model-control.js +467 -0
- package/pi-extension/dist/cognitive-routing/projection.js +503 -0
- package/pi-extension/dist/cognitive-routing/provenance.js +81 -0
- package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/render.js +31 -10
- package/pi-extension/dist/cognitive-routing/runtime.js +396 -0
- package/pi-extension/dist/cognitive-routing/schemas.js +209 -0
- package/pi-extension/dist/cognitive-routing/session.js +221 -0
- package/pi-extension/dist/cognitive-routing/sources.js +291 -0
- package/pi-extension/dist/cognitive-routing/state.js +487 -0
- package/pi-extension/dist/cognitive-routing/status.js +80 -0
- package/pi-extension/dist/cognitive-routing/tools.js +60 -0
- package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/types.js +10 -12
- package/pi-extension/dist/compaction/carry.js +191 -0
- package/pi-extension/dist/compaction/config.js +22 -0
- package/pi-extension/dist/compaction/controller.js +471 -0
- package/pi-extension/dist/compaction/harness.js +77 -0
- package/pi-extension/dist/compaction/results.js +158 -0
- package/pi-extension/dist/compaction/thresholds.js +35 -0
- package/pi-extension/dist/compaction/tool.js +57 -0
- package/pi-extension/dist/host/branch.js +13 -0
- package/pi-extension/dist/host/canonical.js +12 -0
- package/pi-extension/dist/host/catalog.js +77 -0
- package/pi-extension/dist/host/config.js +374 -0
- package/pi-extension/dist/host/projection-tags.js +60 -0
- package/pi-extension/dist/host/prompts.js +82 -0
- package/pi-extension/dist/{session-sources → host}/read-only-session.js +112 -1
- package/pi-extension/dist/host/request-history.js +298 -0
- package/pi-extension/dist/host/runtime-state.js +189 -0
- package/pi-extension/dist/host/settings/freeflow-command.js +1570 -0
- package/pi-extension/dist/{settings/settings-tui.js → host/settings/settings-view.js} +186 -73
- package/pi-extension/dist/host/staging.js +28 -0
- package/pi-extension/dist/host/status.js +101 -0
- package/pi-extension/dist/index.js +441 -170
- package/pi-extension/dist/provider-support/cache/anchor.js +21 -0
- package/pi-extension/dist/provider-support/cache/anthropic.js +102 -0
- package/pi-extension/dist/provider-support/cache/health.js +73 -0
- package/pi-extension/dist/provider-support/cache/index.js +58 -0
- package/pi-extension/dist/provider-support/cache/keepalive.js +210 -0
- package/pi-extension/dist/provider-support/cache/monitor.js +17 -0
- package/pi-extension/dist/provider-support/cache/openai-responses.js +48 -0
- package/pi-extension/dist/provider-support/effort.js +13 -0
- package/pi-extension/dist/provider-support/index.js +45 -0
- package/pi-extension/dist/provider-support/openai/adapter.js +127 -0
- package/pi-extension/dist/provider-support/openai/history.js +127 -0
- package/pi-extension/dist/provider-support/openai/index.js +15 -0
- package/pi-extension/dist/provider-support/openai/session-state.js +105 -0
- package/pi-extension/dist/provider-support/routes.js +17 -0
- package/pi-extension/dist/tool-execution/apply-patch/grammar.js +23 -0
- package/pi-extension/dist/tool-execution/apply-patch/match.js +38 -0
- package/pi-extension/dist/tool-execution/apply-patch/parser.js +177 -0
- package/pi-extension/dist/tool-execution/apply-patch/plan.js +201 -0
- package/pi-extension/dist/tool-execution/apply-patch/tool.js +84 -0
- package/pi-extension/dist/tool-execution/background.js +238 -0
- package/pi-extension/dist/tool-execution/bash-guard.js +23 -0
- package/pi-extension/dist/tool-execution/config.js +22 -0
- package/pi-extension/dist/tool-execution/edit-messages.js +120 -0
- package/pi-extension/dist/tool-execution/file-state.js +138 -0
- package/pi-extension/dist/tool-execution/file-tracking.js +143 -0
- package/pi-extension/dist/tool-execution/prompt.js +54 -0
- package/pi-extension/dist/tool-execution/tools.js +16 -0
- package/pi-extension/freeflow/README.md +9 -0
- package/plugin.json +1 -1
- package/runtime/prompts/cognitive-routing.md +4 -4
- package/runtime/prompts/core.md +22 -75
- package/runtime/prompts/interaction-contract.md +15 -8
- package/runtime/prompts/tool-execution.md +38 -0
- package/runtime/prompts/working-method.md +108 -0
- package/skills/action-selection/SKILL.md +39 -47
- package/skills/action-selection/references/trajectory-stalls.md +2 -0
- package/skills/bypass/SKILL.md +2 -2
- package/skills/commit-work/SKILL.md +31 -83
- package/skills/commit-work/references/git-state-edges.md +1 -1
- package/skills/commit-work/references/simple-push.md +2 -0
- package/skills/commit-work/references/staging-decisions.md +1 -1
- package/skills/decision-gate/SKILL.md +31 -50
- package/skills/design-for-depth/SKILL.md +44 -53
- package/skills/design-for-depth/references/design-pressure-signals.md +46 -144
- package/skills/design-for-depth/references/implementation-decisions.md +4 -4
- package/skills/design-for-depth/references/interface-design-loop.md +5 -36
- package/skills/design-for-depth/references/module-and-dependency-design.md +2 -32
- package/skills/design-for-depth/references/state-and-failure-boundaries.md +2 -13
- package/skills/diagnose-failure/SKILL.md +39 -24
- package/skills/diagnose-failure/references/diagnostic-loop-catalog.md +2 -0
- package/skills/diagnose-failure/references/flaky-and-performance-diagnosis.md +2 -2
- package/skills/discuss/SKILL.md +37 -13
- package/skills/discuss/references/discussion-continuity.md +7 -27
- package/skills/evaluate-skill/SKILL.md +49 -80
- package/skills/evaluate-skill/references/evaluation-definition-schema.md +35 -5
- package/skills/evaluate-skill/references/evaluation-design.md +14 -14
- package/skills/evaluate-skill/references/execution-and-evidence.md +26 -5
- package/skills/evaluate-skill/references/review-and-revision.md +3 -1
- package/skills/evaluate-skill/scripts/lib/definitions.mjs +49 -8
- package/skills/evaluate-skill/scripts/lib/pi.mjs +14 -7
- package/skills/evaluate-skill/scripts/lib/review.mjs +196 -0
- package/skills/evaluate-skill/scripts/lib/runner.mjs +45 -8
- package/skills/evaluate-skill/scripts/lib/sandbox.mjs +2 -0
- package/skills/evaluate-skill/scripts/lib/trials.mjs +103 -0
- package/skills/evaluate-skill/scripts/lib/view.mjs +67 -1
- package/skills/evaluate-skill/scripts/pi-command-tool.mjs +144 -0
- package/skills/evaluate-skill/scripts/pi-guard.mjs +30 -13
- package/skills/evaluate-skill/scripts/skill-eval.mjs +114 -34
- package/skills/execute-work/SKILL.md +41 -9
- package/skills/execute-work/references/code-practices.md +2 -0
- package/skills/execute-work/references/execute-work-edges.md +11 -1
- package/skills/handoff/SKILL.md +1 -1
- package/skills/handoff/references/handoff-templates.md +1 -1
- package/skills/review-artifact/SKILL.md +42 -41
- package/skills/review-artifact/references/adjudicate-artifact-review.md +1 -1
- package/skills/review-artifact/references/independent-artifact-reviewer-contract.md +1 -1
- package/skills/review-work/SKILL.md +38 -32
- package/skills/review-work/references/adjudicate-work-review.md +1 -1
- package/skills/review-work/references/independent-work-reviewer-contract.md +1 -1
- package/skills/review-work/references/security-risk-lens.md +2 -4
- package/skills/setup-freeflow/SKILL.md +3 -1
- package/skills/setup-freeflow/references/activation-contract.md +7 -13
- package/skills/setup-freeflow/references/host-setup.md +3 -3
- package/skills/track-work/SKILL.md +113 -161
- package/skills/track-work/references/working-record-format.md +189 -350
- package/skills/track-work/scripts/lib/document.mjs +62 -6
- package/skills/track-work/scripts/lib/format.mjs +16 -1
- package/skills/track-work/scripts/lib/store.mjs +9 -8
- package/skills/track-work/scripts/lib/transitions.mjs +79 -4
- package/skills/track-work/scripts/working-record.mjs +34 -12
- package/skills/verify-work/SKILL.md +29 -20
- package/skills/verify-work/references/browser-runtime-evidence.md +1 -5
- package/skills/verify-work/references/integration-evidence.md +2 -0
- package/skills/verify-work/references/performance-evidence.md +3 -1
- package/skills/verify-work/references/test-design.md +3 -1
- package/skills/workflow/SKILL.md +65 -21
- package/skills/workflow/references/domain-skill-composition.md +5 -3
- package/skills/write-docs/SKILL.md +83 -0
- package/skills/write-docs/references/documentation-shapes.md +119 -0
- package/skills/write-docs/scripts/docs-check.mjs +139 -0
- package/skills/write-plan/SKILL.md +40 -40
- package/skills/write-plan/references/plan-shapes.md +1 -1
- package/skills/write-skill/SKILL.md +107 -147
- package/skills/write-skill/references/activation-boundaries.md +2 -0
- package/skills/write-skill/references/agent-first-instructions.md +22 -10
- package/skills/write-skill/references/progressive-disclosure.md +4 -2
- package/skills/write-skill/references/skill-dependency-graphs.md +2 -0
- package/skills/write-skill/scripts/lib/similarity.mjs +56 -0
- package/skills/write-skill/scripts/skill-author.mjs +18 -2
- package/skills/write-spec/SKILL.md +34 -41
- package/skills/write-spec/references/artifact-standards.md +1 -1
- package/skills/write-spec/references/decision-records.md +2 -0
- package/skills/write-spec/references/spec-shapes.md +1 -1
- package/capabilities/context-virtualization/SKILL.md +0 -103
- package/capabilities/conversation-history/SKILL.md +0 -53
- package/hooks/tests/check-host-adapters.test.mjs +0 -82
- package/hooks/tests/check-runtime-context-hook.sh +0 -212
- package/pi-extension/dist/cognitive-routing-v2/projection.js +0 -321
- package/pi-extension/dist/cognitive-routing-v2/runtime.js +0 -1585
- package/pi-extension/dist/cognitive-routing-v2/schemas.js +0 -107
- package/pi-extension/dist/cognitive-routing-v2/state.js +0 -612
- package/pi-extension/dist/cognitive-routing-v2/tools.js +0 -91
- package/pi-extension/dist/context-virtualization/commands.js +0 -89
- package/pi-extension/dist/context-virtualization/projector.js +0 -42
- package/pi-extension/dist/context-virtualization/runtime.js +0 -356
- package/pi-extension/dist/context-virtualization/state.js +0 -57
- package/pi-extension/dist/context-virtualization/types.js +0 -10
- package/pi-extension/dist/conversation-history/passages.js +0 -66
- package/pi-extension/dist/conversation-history/ranking.js +0 -105
- package/pi-extension/dist/conversation-history/runtime.js +0 -226
- package/pi-extension/dist/conversation-history/search.js +0 -56
- package/pi-extension/dist/conversation-history/types.js +0 -1
- package/pi-extension/dist/freeflow-context/resolver.js +0 -120
- package/pi-extension/dist/freeflow-context/runtime.js +0 -80
- package/pi-extension/dist/freeflow-context/source-projector.js +0 -95
- package/pi-extension/dist/freeflow-context/tool.js +0 -313
- package/pi-extension/dist/freeflow-context/types.js +0 -12
- package/pi-extension/dist/freeflow-context/visibility.js +0 -28
- package/pi-extension/dist/integrations/mcp-config.js +0 -29
- package/pi-extension/dist/runtime/runtime-context.js +0 -735
- package/pi-extension/dist/runtime/runtime-identity.js +0 -5
- package/pi-extension/dist/session-sources/events.js +0 -195
- package/pi-extension/dist/session-sources/sources.js +0 -233
- package/pi-extension/dist/settings/settings-ui.js +0 -1160
- package/pi-extension/dist/ui/text-component.js +0 -57
- package/pi-extension/src/cognitive-routing-v2/budget.ts +0 -42
- package/pi-extension/src/cognitive-routing-v2/config.ts +0 -143
- package/pi-extension/src/cognitive-routing-v2/projection.ts +0 -365
- package/pi-extension/src/cognitive-routing-v2/render.ts +0 -256
- package/pi-extension/src/cognitive-routing-v2/runtime.ts +0 -1634
- package/pi-extension/src/cognitive-routing-v2/schemas.ts +0 -109
- package/pi-extension/src/cognitive-routing-v2/state.ts +0 -622
- package/pi-extension/src/cognitive-routing-v2/tools.ts +0 -93
- package/pi-extension/src/cognitive-routing-v2/types.ts +0 -222
- package/pi-extension/src/context-virtualization/commands.ts +0 -111
- package/pi-extension/src/context-virtualization/projector.ts +0 -62
- package/pi-extension/src/context-virtualization/runtime.ts +0 -406
- package/pi-extension/src/context-virtualization/state.ts +0 -79
- package/pi-extension/src/context-virtualization/types.ts +0 -92
- package/pi-extension/src/conversation-history/passages.ts +0 -81
- package/pi-extension/src/conversation-history/ranking.ts +0 -155
- package/pi-extension/src/conversation-history/runtime.ts +0 -250
- package/pi-extension/src/conversation-history/search.ts +0 -79
- package/pi-extension/src/conversation-history/types.ts +0 -31
- package/pi-extension/src/freeflow-context/resolver.ts +0 -139
- package/pi-extension/src/freeflow-context/runtime.ts +0 -100
- package/pi-extension/src/freeflow-context/source-projector.ts +0 -106
- package/pi-extension/src/freeflow-context/tool.ts +0 -365
- package/pi-extension/src/freeflow-context/types.ts +0 -70
- package/pi-extension/src/freeflow-context/visibility.ts +0 -53
- package/pi-extension/src/index.ts +0 -368
- package/pi-extension/src/integrations/mcp-config.ts +0 -32
- package/pi-extension/src/runtime/runtime-context.ts +0 -838
- package/pi-extension/src/runtime/runtime-identity.ts +0 -8
- package/pi-extension/src/session-sources/events.ts +0 -208
- package/pi-extension/src/session-sources/read-only-session.ts +0 -170
- package/pi-extension/src/session-sources/sources.ts +0 -263
- package/pi-extension/src/settings/settings-tui.ts +0 -501
- package/pi-extension/src/settings/settings-ui.ts +0 -1422
- package/pi-extension/src/ui/text-component.ts +0 -66
- package/pi-extension/tests/cognitive-routing-v2/communication.test.js +0 -484
- package/pi-extension/tests/cognitive-routing-v2/compaction-input.test.js +0 -183
- package/pi-extension/tests/cognitive-routing-v2/native.test.js +0 -441
- package/pi-extension/tests/cognitive-routing-v2/performance.test.js +0 -87
- package/pi-extension/tests/cognitive-routing-v2/persistence.test.js +0 -245
- package/pi-extension/tests/cognitive-routing-v2/projection.test.js +0 -241
- package/pi-extension/tests/cognitive-routing-v2/recovery.test.js +0 -236
- package/pi-extension/tests/cognitive-routing-v2/render.test.js +0 -230
- package/pi-extension/tests/cognitive-routing-v2/runtime.test.js +0 -153
- package/pi-extension/tests/cognitive-routing-v2/stabilization.test.js +0 -521
- package/pi-extension/tests/cognitive-routing-v2/state.test.js +0 -275
- package/pi-extension/tests/context-virtualization/extension.test.js +0 -765
- package/pi-extension/tests/context-virtualization/projector.test.js +0 -110
- package/pi-extension/tests/context-virtualization/runtime.test.js +0 -216
- package/pi-extension/tests/conversation-history/runtime.test.js +0 -98
- package/pi-extension/tests/conversation-history/search.test.js +0 -97
- package/pi-extension/tests/fixtures/pi-host.js +0 -4
- package/pi-extension/tests/fixtures/routing-native.js +0 -188
- package/pi-extension/tests/integration/mode-free-core.test.js +0 -219
- package/pi-extension/tests/integration/pi-extension.test.js +0 -968
- package/pi-extension/tests/integration/prompt-architecture.test.js +0 -431
- package/pi-extension/tests/integration/unaffected-regressions.test.js +0 -478
- package/pi-extension/tests/settings/settings-tui.test.js +0 -243
- package/pi-extension/tsconfig.json +0 -16
- package/runtime/prompts/context-virtualization.md +0 -3
- package/runtime/prompts/conversation-history.md +0 -3
- package/skills/design-for-depth/references/software-design-philosophy.md +0 -202
- /package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/budget.js +0 -0
|
@@ -1,170 +1,184 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "cognitive-routing"
|
|
3
|
-
description: "Use when Cognitive Routing is active to
|
|
3
|
+
description: "Use when Cognitive Routing is active to place work across configured profiles, direct bounded assignments, assess evidence, and preserve workflow continuity."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Cognitive Routing
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Cognitive Routing runs one agent in one session across up to three compute profiles, one at a time:
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
- **Coordinator** owns the user, the plan, governing decisions, delegation, assessment, and acceptance.
|
|
11
|
+
- **Helper** and **Executor** are workers. A worker does environment work under an assignment and returns evidence to Coordinator.
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
The runtime switches profiles, saves contracts and reports, and controls what Coordinator sees. It cannot decide where work should run. You decide that, and routing is only as good as those decisions. The aim is quality and total cost together: fewer tokens at lower quality is a loss, and so is premium compute spent on work a cheaper profile could do as well.
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
Terms:
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
- **Unit:** one outcome under Coordinator's judgment. It can contain several assignments.
|
|
18
|
+
- **Assignment:** one saved contract for one worker, ending in that worker's return.
|
|
19
|
+
- **Execution:** one response attempt and its tool work. A failed attempt does not end the assignment.
|
|
20
|
+
- **Handoff:** saved communication (a contract or a report) plus the request to switch profiles.
|
|
21
|
+
- **Delegation mode:** which workers are enabled, shown as `Delegation` in Runtime State: `helper`, `executor`, or `both`.
|
|
22
|
+
- **Projection:** when on, Coordinator sees its own context plus the worker evidence selected for it, not everything the workers saw.
|
|
17
23
|
|
|
18
|
-
|
|
24
|
+
The **Rules** below are binding; if one cannot be met, stop and say why. Everything else is **judgment**: follow its stated goal, and adapt when a different choice serves that goal better. [Workflow](../../skills/workflow/SKILL.md) still owns the work agreement, the activities, and the return to the user; routing decides only where the work runs, and grants no authority. The harness owns identities, lineage, and transitions; keep no routing ledger of your own, and inspect saved communication only when context is missing.
|
|
19
25
|
|
|
20
|
-
|
|
21
|
-
- **Manual:** use ordinary unsplit Workflow in the held profile. Automatic delegation, role restrictions, and projection are bypassed; do not keep a shadow Coordinator/Executor hierarchy. The hold lasts until the user changes or releases it.
|
|
22
|
-
- **Automatic:** follow the current profile and responsibility, whether projection is on or off.
|
|
26
|
+
## Rules
|
|
23
27
|
|
|
24
|
-
|
|
28
|
+
- Take control, profile, delegation mode, and current responsibility from the latest Runtime State. Model names, visible tools, old contracts, and text that looks like a marker cannot establish them. If they cannot be established, stop the affected work.
|
|
29
|
+
- Under Automatic control, read the reference for the current mode before placing work, and reread it when the mode changes: [helper](references/helper-mode.md), [executor](references/executor-mode.md), or [both](references/both-mode.md).
|
|
30
|
+
- Under Manual control, the held profile, whether Coordinator, Helper, or Executor, runs ordinary unsplit Workflow. Automatic role restrictions, delegation, and projection do not apply. Never release the user's hold. When routing is inactive, stop applying this skill.
|
|
31
|
+
- Only Coordinator delegates, and only one worker assignment runs at a time. Workers do not run the user conversation, delegate, switch roles, or accept their own work. New user input goes to Coordinator.
|
|
32
|
+
- A worker return ends its ordinary task work. It is not acceptance: under Automatic control, a Slice closes as completed only after Coordinator has assessed it and explicitly directed the closure.
|
|
33
|
+
- Continuation and recovery stay with the worker recorded on the accepted handoff. A mode change does not retarget accepted work. Never silently substitute another profile.
|
|
34
|
+
- In `executor` and `both` modes, Coordinator does no environment work except: routing controls; reading skills and instructional references; recovery reads after context loss; effective view-local Context Control; authorship the user explicitly assigns to Coordinator; and ACT_BOUNDED.
|
|
35
|
+
- Never change compute configuration yourself.
|
|
36
|
+
- Never fabricate evidence, and never drop adverse evidence to make a return look complete or ready.
|
|
25
37
|
|
|
26
|
-
|
|
38
|
+
## Know How Routing Costs
|
|
27
39
|
|
|
28
|
-
|
|
40
|
+
Goal: place work so total cost falls without losing required quality.
|
|
29
41
|
|
|
30
|
-
|
|
42
|
+
Total cost is the number of model turns times their average cost. Moving work to a cheaper profile lowers the average; every handoff adds turns. Routing wins only when the saving per turn outweighs the extra turns.
|
|
31
43
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
```
|
|
44
|
+
- Everything Coordinator reads stays in its context and is paid for at its price on every later turn until compaction.
|
|
45
|
+
- A handoff adds a contract, the worker's ramp-up, a return, and an assessment turn.
|
|
46
|
+
- A cheaper worker's mistakes add correction turns and more assessment.
|
|
47
|
+
- Helper and Executor share ordinary history, so one worker's gathered context is available to the other without rediscovery.
|
|
48
|
+
- Switching models never reuses the provider cache. Switching between profiles on the same model keeps one cache when their effort matches or the route keeps the cache across effort changes (currently GPT-6 on an OpenAI API key or OpenAI Codex, and Claude models that take per-message effort, such as Opus 5.5 and Sonnet 5.5). Elsewhere, including OpenAI's Sign in with ChatGPT, each effort keeps its own cache: the first switch to an effort rereads the whole context, and later switches reread what was added since that effort last ran, while its cache is still warm.
|
|
49
|
+
- A precise contract narrows the worker's search. This is where most of the saving comes from.
|
|
39
50
|
|
|
40
|
-
|
|
51
|
+
Lower cost never lowers the required quality or evidence. Several cheap corrections can still be economical; repeated misunderstanding, needless handoffs, and unsupported acceptance are not savings.
|
|
41
52
|
|
|
42
|
-
##
|
|
53
|
+
## Decide Where Work Runs
|
|
43
54
|
|
|
44
|
-
|
|
55
|
+
Goal: each result is produced where the total cost is lowest without losing quality.
|
|
45
56
|
|
|
46
|
-
|
|
47
|
-
| --- | --- |
|
|
48
|
-
| User intent or a user-owned choice | Discuss it; do not delegate a guess |
|
|
49
|
-
| Environmental facts or cause | Ask for evidence distinguishing plausible explanations |
|
|
50
|
-
| Implementation mechanism | Choose a bounded investigation or covered experiment before dependent work |
|
|
51
|
-
| Nothing material to the next result | Explain the supported design or correction and delegate execution |
|
|
57
|
+
Delegate when the expected saving in cost or quality exceeds the handoff, the ramp-up, the assessment, and the likely corrections. The kind of difficulty usually suggests the owner:
|
|
52
58
|
|
|
53
|
-
|
|
59
|
+
- missing facts about the environment: a worker observes;
|
|
60
|
+
- an unresolved design or governing choice: Coordinator;
|
|
61
|
+
- settled mechanics: a worker, or a script when the work is deterministic and repeated;
|
|
62
|
+
- a decision the user owns: Coordinator asks, using [Decision Gate](../../skills/decision-gate/SKILL.md); never a worker.
|
|
54
63
|
|
|
55
|
-
|
|
64
|
+
Default: follow your mode reference. Keep a tightly coupled edit, check, and interpret loop with one producer; hand off results that can be separated from it. A separate multi-entry record update qualifies; a one-line update in the middle of your own work does not. A read-only check of the candidate against the Slice's acceptance requirements qualifies even mid-implementation, because it gives Coordinator a different result, not a repeat.
|
|
56
65
|
|
|
57
|
-
|
|
66
|
+
Decide by the responsibility handed over and its consequences, not by whether it reads or writes, whether the output is prose or code, the file type, the line count, the tool count, or the models' names and effort labels. Choosing a worker never substitutes for the user's authorization. Do not require a worker to fail before choosing a stronger owner. If a return shows the responsibility is different from what you assumed, reassess the placement rather than repeat the assignment more forcefully.
|
|
58
67
|
|
|
59
|
-
|
|
68
|
+
Direct Coordinator work needs no invented assignment, projection, or return. Authorship the user assigns to Coordinator means the user asked Coordinator itself to write a particular artifact; a general request such as "write the plan" does not select it, and it authorizes nothing beyond that artifact. Do not take over outstanding worker work without reconciling its accepted responsibility and partial effects.
|
|
60
69
|
|
|
61
|
-
|
|
70
|
+
## Prepare The Route Before Delegating Production
|
|
62
71
|
|
|
63
|
-
|
|
72
|
+
Goal: the implementer starts with what it needs, and nobody gathers in the premium profile what the route could have predicted.
|
|
64
73
|
|
|
65
|
-
|
|
74
|
+
Workflow's route preparation applies. Routing adds:
|
|
66
75
|
|
|
67
|
-
|
|
76
|
+
- Coordinator plans the route and may read skills directly to know which methods the assignments will need.
|
|
77
|
+
- Before implementation, commission the context gathering the predictable steps need, so the implementer starts with it. Who gathers, and how the evidence reaches Coordinator, depends on the mode; see your mode reference.
|
|
78
|
+
- The implementing producer forms the execution forecast described in [Execute Work](../../skills/execute-work/SKILL.md) under Gather Enough Context For This Unit. When a worker implements, Coordinator supplies the governing decisions and the worker forms the forecast; do not write the patch for it.
|
|
68
79
|
|
|
69
|
-
|
|
80
|
+
## Coordinator: Write A Contract That Carries The Decision
|
|
70
81
|
|
|
71
|
-
|
|
82
|
+
Goal: the worker can act correctly on the first attempt without re-deriving what Coordinator already knows.
|
|
72
83
|
|
|
73
|
-
|
|
74
|
-
- established facts, hypotheses, and the supported approach;
|
|
75
|
-
- sources, relationships, ordering, invariants, and known traps;
|
|
76
|
-
- required constraints versus suggested mechanics, local freedom, and excluded effects;
|
|
77
|
-
- evidence needed for assessment and the condition requiring return.
|
|
84
|
+
Put the actual contract in `freeflow_delegate(operation: "assign")`. In `both` mode, set `worker` to `helper` or `executor`; with one enabled worker the tool infers it. Write for what the worker can see, not what you remember:
|
|
78
85
|
|
|
79
|
-
|
|
86
|
+
- the required result, why it matters, and the method to use;
|
|
87
|
+
- established facts, accepted decisions, and open questions;
|
|
88
|
+
- scope, order, constraints, permitted effects, and remaining local freedom;
|
|
89
|
+
- behavior for the cases the request does not mention but the change touches: other entry points, sibling operations, data already written, and work that runs at the same time or on a schedule;
|
|
90
|
+
- the contracts the worker must not choose: names, messages, interfaces, file locations, and dependencies, exactly as they must appear;
|
|
91
|
+
- the evidence you need to assess the result;
|
|
92
|
+
- when to return, including when a premise or governing choice changes.
|
|
80
93
|
|
|
81
|
-
|
|
94
|
+
State each requirement as the outcome for a named thing, without an escape clause such as "unless needed" or "as today". When behavior elsewhere must be preserved, say where the change belongs and what each named caller must still get: "keep what callers rely on today" alone can steer a worker away from a correct fix in shared code.
|
|
82
95
|
|
|
83
|
-
|
|
96
|
+
When unresolved representation, ownership, or failure choices could invalidate the work, settle them first with [Design for Depth](../../skills/design-for-depth/SKILL.md). Your most valuable contribution is framing the problem so the worker finds it straightforward. For a consequential or repeatedly misunderstood property, name the mechanism and why it fits, the plausible wrong approach, and the observation that tells them apart. Give more structure where the worker has shown difficulty and more freedom where the mechanics are settled. A contract that contains the finished patch has moved the work back to Coordinator's price.
|
|
84
97
|
|
|
85
|
-
|
|
98
|
+
A gathering assignment names what must be learned, not a guessed implementation. Request evidence by purpose, since its refs do not exist yet; what you request is a minimum, and workers also return material discoveries and counterevidence. Shared history and provider caching do not convey unspoken direction, and a filename does not mean its content is available to the worker.
|
|
86
99
|
|
|
87
|
-
|
|
100
|
+
Size an assignment to include the work, its local checks, the expected corrections, and preparing the return. Shorten it when an unfamiliar boundary could invalidate much dependent work. Do not supervise every command, and do not delegate the whole objective to avoid later judgment. A negative result can complete a gathering or experimental assignment.
|
|
88
101
|
|
|
89
|
-
|
|
102
|
+
Use `replace` only for quiescent outstanding work whose unit outcome still holds. State why the direction changed, preserve partial effects and uncertainty, and choose the worker again in `both` mode. Do not replace returned work, or close and reopen a unit to escape unfinished responsibility.
|
|
90
103
|
|
|
91
|
-
|
|
104
|
+
## Worker: Execute Within The Contract
|
|
92
105
|
|
|
93
|
-
|
|
106
|
+
Goal: produce the assigned result resourcefully, within scope, and stop at the useful boundary.
|
|
94
107
|
|
|
95
|
-
|
|
108
|
+
Establish the contract, your assigned role, the constraints, and the return condition. Load the producing method and [Action Selection](../../skills/action-selection/SKILL.md) when absent. Follow required direction; choose ordinary mechanics yourself. A useful discovery or an available tool grants no new authority.
|
|
96
109
|
|
|
97
|
-
|
|
110
|
+
Challenge unsupported premises and report better-supported approaches. A governing change, one that alters the accepted outcome, architecture, policy, scope, authority, failure behavior, or required evidence, stops dependent effects until Coordinator decides. An unprescribed filename or helper does not require a return. For an unexplained or repeatedly stalling failure, use [Diagnose Failure](../../skills/diagnose-failure/SKILL.md) within scope or return.
|
|
98
111
|
|
|
99
|
-
|
|
112
|
+
Run routine tools without announcing them; put findings in the report. Questions for the user go to Coordinator in the return.
|
|
100
113
|
|
|
101
|
-
|
|
114
|
+
Verify the actual candidate and self-review through the producing method, using [Verify Work](../../skills/verify-work/SKILL.md) to say what the observations support. Keep failed, stale, incomplete, and inconclusive evidence. If a test changes, say what the old and new versions each establish.
|
|
102
115
|
|
|
103
|
-
|
|
116
|
+
Return when the result is ready, the stop condition is reached, no useful covered work remains, or new user input needs Coordinator. Do not stop after each command, and do not continue into a different responsibility to avoid a handoff. State what remains before the Slice's exit.
|
|
104
117
|
|
|
105
|
-
|
|
106
|
-
2. **Select what assessment needs.** When projection is on, project every completed skill and instructional-reference read, including the bootstrap read. Add the other missing eligible bodies needed to assess the result. Prefer actual tool results for execution claims and substantive assistant text when that text is the object of judgment.
|
|
107
|
-
3. **Read receipts and correct supported problems.** Preserve valid selections. Resolve bad identities or representations where supported; withdraw unavailable or unnecessary requests only with a reason and retain their material limitations. Removing a ref does not resolve a required evidence gap. Do not silently substitute a summary for a promised original or hide adverse evidence to obtain readiness.
|
|
108
|
-
4. **Submit the actual report.** State the result, evidence and limits, corrected assumptions, partial effects, and reason for return in `freeflow_return(operation: "submit")`. Then stop ordinary assignment work.
|
|
118
|
+
## Worker: Prepare Evidence, Then Return
|
|
109
119
|
|
|
110
|
-
|
|
120
|
+
Goal: Coordinator receives what it needs to judge the result and nothing it does not.
|
|
111
121
|
|
|
112
|
-
|
|
122
|
+
Helper and Executor share ordinary history. Reuse each other's sources and observations while keeping who produced them; do not create worker-to-worker projections. With projection on, Coordinator sees only what you select, so select enough original material for judgment, not the execution trail. Prepare evidence once, at the return boundary, not after each tool call.
|
|
113
123
|
|
|
114
|
-
|
|
124
|
+
1. **Reconcile the result.** Compare the contract with the actual work, changed assumptions, partial effects, missing checks, and contrary findings. Make sure captures describe the candidate you are reporting, after any later edits.
|
|
125
|
+
2. **Choose the evidence.** Start with what Coordinator requested and what it already has. Add governing background, material discoveries, and counterevidence it needs. Being eligible is not a reason to select a source, and a nearby result, filename, or shared report is not automatically the evidence for a claim. Unknown authorship stays unknown. When Coordinator already has adequate evidence or the result is self-contained, select nothing new.
|
|
126
|
+
3. **Add the bodies and submit together.** With projection on, add the skill and reference reads that carry the methods Coordinator needs, and the original task-evidence bodies needed for assessment, in one `freeflow_project` add using visible refs directly. Only tool results are evidence; write findings, drafts, and interpretation into the report instead. In the same response, put `freeflow_return(operation: "submit")` last, with the result, evidence and limits, changed assumptions, partial effects, what remains, and why you are returning. Do not wait for the selection receipt: the report is saved even when evidence has problems. Never batch the return with new task work whose outcome the report assumes. Then stop ordinary task work.
|
|
127
|
+
4. **Check the return receipt.** If it reports problems, resolve identity or representation problems with `freeflow_project`, then use payload-free `freeflow_return(operation: "retry")`. Withdraw a request only with a reason; withdrawing does not close a required evidence gap. Do not rerun work to manufacture a selectable receipt.
|
|
115
128
|
|
|
116
|
-
|
|
129
|
+
Use `freeflow_project` inspect only when a ref's identity, eligibility, representation, or selection state is unclear; assignment size alone is not a reason. Once you find the refs you need, add them; the remaining candidates are not a work queue. With projection off, skip the projection tools, not verification or honest reporting.
|
|
117
130
|
|
|
118
|
-
|
|
131
|
+
A required stop takes precedence over another read or test: return an honest `partial` or `blocked` report instead of forcing `completed`. `reportSaved` does not mean delivered or assessed. If the transfer is blocked, ordinary work stays ended; fix only the handoff problem and use payload-free `freeflow_return(operation: "retry")`. Use `submit` again only to deliberately revise the report.
|
|
119
132
|
|
|
120
|
-
|
|
133
|
+
## Coordinator: Assess The Return
|
|
121
134
|
|
|
122
|
-
|
|
135
|
+
Goal: accept only what the evidence supports, and choose the next work from the actual gap.
|
|
123
136
|
|
|
124
|
-
|
|
137
|
+
Assess the report and evidence you received. Ordinary assessment needs neither routine inspection nor an `assess` call; `assess` restores a suspended evidence view after new user input paused it.
|
|
125
138
|
|
|
126
|
-
|
|
139
|
+
For a material claim, compare the accepted property, the observation actually made, the decisive assertions, the candidate's identity, and the result. A confident report or a green suite cannot fill a missing link. Keep unsupported required claims open and stop dependent work. Check the actual state before calling something a defect or crediting a fix.
|
|
127
140
|
|
|
128
|
-
|
|
141
|
+
Assess your own direction too: did the contract leave a consequential decision implicit, over-constrain the mechanism, choose the wrong check, or place the work wrongly? A worker that asked no questions has not shown the contract was sufficient; missing specification shows in the result, as a plausible but different name, location, or behavior. Improve the next contract from the answer.
|
|
129
142
|
|
|
130
|
-
|
|
143
|
+
Before commissioning more work, ask whether it meets an accepted requirement, repairs a demonstrated defect, or only adds an optional guarantee; Workflow owns that test. Then choose from the gap:
|
|
131
144
|
|
|
132
|
-
|
|
145
|
+
- **Supported result:** continue with the next covered work, or accept the outcome.
|
|
146
|
+
- **Evidence omitted but it exists:** recover it (below) before investigating again; absence from your view does not mean the action never happened.
|
|
147
|
+
- **Missing or inadequate observation:** request the observation that decides it, without changing the required property.
|
|
148
|
+
- **Supported defect:** assign the correction and affected checks to the owner its responsibility needs.
|
|
149
|
+
- **Invalidated approach or unclear cause:** revise the direction or commission diagnosis rather than repeat the demand.
|
|
150
|
+
- **User-owned choice:** take it to the user before dependent work.
|
|
133
151
|
|
|
134
|
-
|
|
152
|
+
Repeated failure needs a changed premise, check, contract, working set, or mechanism, not lower acceptance or endless repair. Reuse adequate producer verification; a worker's audit in the same session is not independent review, which remains a separate Workflow choice.
|
|
135
153
|
|
|
136
|
-
|
|
137
|
-
- **Existing evidence omitted:** seek supported selection/delivery correction before new investigation.
|
|
138
|
-
- **Missing or inadequate observation:** request the discriminating evidence, preserving the required property.
|
|
139
|
-
- **Supported defect:** explain the correction and affected checks.
|
|
140
|
-
- **Invalidated approach or unclear cause:** revise the affected direction or investigate; do not repeat the same demand more forcefully.
|
|
141
|
-
- **User-owned choice:** discuss through Workflow or Decision Gate before dependent work.
|
|
142
|
-
- **Outcome complete or deliberately stopped:** close with an honest disposition.
|
|
154
|
+
Before completed Slice closure, state your assessment of the Slice's result and evidence, resolve material contradictions, and confirm its Checkpoints are settled. Then direct the [Track Work](../../skills/track-work/SKILL.md) closure through whichever route your mode allows, preferably folded into work already going to that profile rather than a handoff of its own. A prior "close it if green" instruction cannot stand in for assessing results you have not seen. Workers may record factual progress while the Slice is open; a worker writing the closure returns instead if new evidence contradicts the accepted basis.
|
|
143
155
|
|
|
144
|
-
|
|
156
|
+
Use `freeflow_unit(operation: "close")` when the unit's outcome is supported, or to record an authorized `cancelled` or `deferred` outcome. Closing a unit does not complete a Slice or task, clear history, or authorize a commit or delivery. Continue covered work to the agreed return point.
|
|
145
157
|
|
|
146
|
-
|
|
158
|
+
## Keep Control And Continuity
|
|
147
159
|
|
|
148
|
-
|
|
160
|
+
New natural-language input, including "continue", goes to Coordinator. If it reaches a worker mid-assignment, honor any restriction at once, stop task work, and return the partial state. When the user asks what a worker did, answer from `freeflow_unit` inspection or by asking that worker; absence from your view does not mean the action never happened. Runtime State refreshes are observations, not new direction. Technical retries stay within the accepted assignment; `/freeflow resume` continues unchanged saved work after reconciliation and does not release a Manual hold.
|
|
149
161
|
|
|
150
|
-
|
|
162
|
+
During a Manual hold, preserve any interrupted assignment, partial effects, and pending assessment; keep no shadow delegation. If the held preset cannot do the work, report it and leave the choice to the user. When the user releases the hold, Coordinator reconciles current direction, the mode, outstanding responsibility, and anything done during the hold before routing again.
|
|
151
163
|
|
|
152
|
-
|
|
164
|
+
After context loss, follow the bootstrap in the capability cue, reload the methods and the mode reference, and recover control, mode, contract or report, user direction, partial effects, and stop conditions. When a Working Record exists, Coordinator reads it in full through Track Work, and the artifacts under `What defines this task`, directly, in every mode. Large Recovery sources that only serve execution stay with the worker that needs them. An outstanding worker reconstructs and continues its recorded assignment, and its recovery reads stay within the contract's limits; do not wrap existing responsibility in a new assignment. A summary mentioning a superseded contract does not revive it.
|
|
153
165
|
|
|
154
|
-
|
|
166
|
+
### Recover Missing Evidence For An Assessment
|
|
155
167
|
|
|
156
|
-
|
|
168
|
+
Outstanding assignments use ordinary continuation, not this. For the current returned assessment, Coordinator uses `freeflow_unit(operation: "recover")` with the missing-evidence question, any exact task-file `paths`, and any captured result ids in `results` (a context ref such as `ctx:1a2b3c4d` goes in the request instead; the worker selects it). Recovery belongs to the assignment's recorded worker. Preserve the unit, assignment, original report, outcome, revision, selections, and assessment.
|
|
157
169
|
|
|
158
|
-
|
|
170
|
+
During recovery, the worker may select previously exposed evidence and read only exact admitted task paths, granted captured results, or packaged Freeflow skill and reference files. It must not edit, run commands or tests, broaden discovery, or resume task work. Report stale or unavailable evidence without rerunning anything. Return with `freeflow_return(operation: "supplement")` and stop reading. A `partial` or `blocked` supplement can deliver its communication while the full evidence obligation stays suspended; payload-free `retry` resends an unchanged saved supplement.
|
|
159
171
|
|
|
160
|
-
|
|
172
|
+
A separate recovery assignment fits only when no existing assignment or assessment needs preserving. Coordinator uses `cancel-recovery` when the lookup is no longer needed; the original report and assessment remain. Deliver the supplement or cancel recovery before `assess`; new user input does not settle recovery. Do not simulate recovery by replacing an assignment/report or opening a new unit.
|
|
161
173
|
|
|
162
|
-
|
|
174
|
+
### Keep Useful History
|
|
175
|
+
|
|
176
|
+
Closing, replacing, returning, and pausing change responsibility, not the value of history already admitted. Keep past work distinguishable from the current obligation without removing it. Navigation does not roll back files, processes, or the record; compaction does not justify inventing source bodies or repeating uncertain effects. When Context Control is effective, read its method before managing a view, and keep current direction, contrary findings, and promised originals. Optional cleanup comes after the promised evidence is prepared; if cleanup fails, keep the extra context and continue the handoff.
|
|
163
177
|
|
|
164
|
-
|
|
178
|
+
## ACT_BOUNDED: Inseparable Judgment And Action
|
|
165
179
|
|
|
166
|
-
|
|
180
|
+
In `executor` and `both` modes, Coordinator may do other environment work only when judgment and action cannot be separated and delegating would lose something concrete. Examples: synthesizing a governing artifact when a complete contract would already be the artifact; intervening result by result in sensitive work. Task size, convenience, fewer switches, a failed recovery, or a preference for premium compute do not qualify, and separable production does not become judgment by being relabelled.
|
|
167
181
|
|
|
168
|
-
Before acting, state ACT_BOUNDED with
|
|
182
|
+
Before acting, state ACT_BOUNDED with its scope, expected result, existing authority, stop condition, the inseparable judgment, and what delegation would lose. Stay inside that scope; end on completion, interruption, context loss, changed applicability, or before delegating again. It grants no permission, assignment, or acceptance. Helper-mode Coordinator production needs no ACT_BOUNDED.
|
|
169
183
|
|
|
170
|
-
Stop applying the
|
|
184
|
+
Stop applying the Automatic split when control becomes Manual or routing becomes inactive; preserve unfinished responsibility honestly and follow ordinary Workflow.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Both Mode
|
|
2
|
+
|
|
3
|
+
Judgment for placing work when Runtime State shows `Delegation: both`. The core skill's Rules still apply, including the limit on Coordinator's own environment work.
|
|
4
|
+
|
|
5
|
+
Both mode is the middle ground between quality and cost. Executor does consequential work, including code; Helper does support; Coordinator plans, writes contracts, assesses, and talks to the user. Every assignment names its worker with `worker: "helper"` or `worker: "executor"`.
|
|
6
|
+
|
|
7
|
+
## Choose The Worker Per Assignment
|
|
8
|
+
|
|
9
|
+
Goal: each assignment goes to the cheapest worker that can do it without losing quality.
|
|
10
|
+
|
|
11
|
+
Default: Executor for results whose behavior or failure needs engineering ownership; Helper for gathering, checks, setup, record maintenance, and small settled changes.
|
|
12
|
+
|
|
13
|
+
| Situation | Worker |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| Find the callers, contracts, and conventions the next change will touch. | Helper |
|
|
16
|
+
| Implement the change and its tests. | Executor |
|
|
17
|
+
| A one-line authorization change with security consequences. | Executor: small, but consequential. |
|
|
18
|
+
| A read-only audit that decides whether the design holds. | Executor: no writes, but substantive judgment. |
|
|
19
|
+
| Rerun the validation suite and the formatter after Executor's change. | Helper |
|
|
20
|
+
| Update several record entries after an accepted result. | Helper, or folded into an assignment already going out. |
|
|
21
|
+
|
|
22
|
+
The failure to prevent is misplacement: a consequential change given to Helper because it is short, or Executor spent on pure gathering. Decide by the responsibility and its consequences, not by size or by whether the work writes.
|
|
23
|
+
|
|
24
|
+
These are available routes, not phases. A unit may use only Helper, go straight to Executor, or keep one coherent result with Executor through its checks and corrections.
|
|
25
|
+
|
|
26
|
+
## Reuse What The Other Worker Found
|
|
27
|
+
|
|
28
|
+
Goal: no worker rediscovers what the other already established.
|
|
29
|
+
|
|
30
|
+
Helper and Executor share ordinary history. A typical route: Helper gathers; Executor's contract points at what Helper found instead of asking it to explore; Coordinator receives what it needs through projection. After implementation, Helper can run follow-up checks with Executor's context already present. Recheck a fact only when its freshness matters or its source is no longer available.
|
|
31
|
+
|
|
32
|
+
Executor forms the execution forecast for production work; Coordinator supplies the governing decisions.
|
|
33
|
+
|
|
34
|
+
## Mind The Model Configuration
|
|
35
|
+
|
|
36
|
+
The user may run Coordinator and Executor on the same model at different effort. On routes that keep the provider cache across effort changes (currently GPT-6 on an OpenAI API key or OpenAI Codex), handoffs to Executor then reuse the cache and cost less. Elsewhere, including OpenAI's Sign in with ChatGPT, each effort keeps its own cache, so the first handoff at each effort rereads the whole context and later ones reread what was added since that effort last ran. With different models, every switch rereads the whole context. Either way the configuration is the user's choice; do not change it.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Executor Mode
|
|
2
|
+
|
|
3
|
+
Judgment for placing work when Runtime State shows `Delegation: executor`. The core skill's Rules still apply, including the limit on Coordinator's own environment work.
|
|
4
|
+
|
|
5
|
+
Executor mode is the main cost saver. A cheaper Executor does the environment work: investigation, preparation, artifacts, implementation, checks, and record maintenance. Coordinator plans, writes contracts, assesses, and talks to the user, and executes nothing itself except under ACT_BOUNDED. The saving comes from two places: projection keeps Executor's working trail out of Coordinator's context, and precise contracts keep Executor from searching.
|
|
6
|
+
|
|
7
|
+
## Make The Contract Do The Heavy Thinking
|
|
8
|
+
|
|
9
|
+
Goal: Executor's first attempt is right often enough that the saving outweighs the corrections.
|
|
10
|
+
|
|
11
|
+
Coordinator's judgment reaches the work only through the contract, so the contract carries the decision. Frame the problem so the cheaper model finds it straightforward: the representation to use, the invariant to preserve, the wrong approach that looks right, and the check that tells them apart. For consequential design choices, write that content with the Implementation Decisions method in [Design for Depth](../../../skills/design-for-depth/SKILL.md).
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
Weak: Add caching to the config loader.
|
|
15
|
+
Strong: Cache the parsed config per file path and invalidate when the file's
|
|
16
|
+
modification time changes. Two loads of an unchanged file parse once;
|
|
17
|
+
an edit between loads must be seen. A process-lifetime cache looks
|
|
18
|
+
right and passes a single-load test but serves stale config, so check
|
|
19
|
+
with an edit between two loads.
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
A cheaper model applies an escape clause literally, so write requirements as outcomes for named things ("each caller listed below still gets X"), never "unless…" or "as today", and say where the change belongs.
|
|
23
|
+
|
|
24
|
+
Default: give structure where Executor has shown difficulty or the property is easy to get subtly wrong, and freedom where the mechanics are ordinary. Signals the balance is off:
|
|
25
|
+
|
|
26
|
+
- Executor returns work that misses an unstated decision: the contract left it implicit.
|
|
27
|
+
- The contract is longer than the change and reads like a patch: Coordinator has done the work at premium price, and Executor only transcribes it.
|
|
28
|
+
- The same misunderstanding recurs: change how you represent the problem, not how forcefully you state it.
|
|
29
|
+
|
|
30
|
+
## Gather, Then Produce
|
|
31
|
+
|
|
32
|
+
Goal: Coordinator's contracts rest on evidence without Coordinator doing the reading.
|
|
33
|
+
|
|
34
|
+
Coordinator may first commission evidence or a proposal, interpret what comes back, and then commission production. Executor gathers; projection carries the selected evidence to Coordinator; the next contract uses it to narrow Executor's search. Do not add a gathering pass when Executor already has an adequate basis, and do not pre-solve every detail before any evidence exists.
|
|
35
|
+
|
|
36
|
+
Executor forms the execution forecast for production work. Coordinator supplies the governing decisions it rests on.
|
|
37
|
+
|
|
38
|
+
## Ask For Evidence That Decides
|
|
39
|
+
|
|
40
|
+
Goal: Coordinator can assess from what projection delivers, without asking for the whole trail.
|
|
41
|
+
|
|
42
|
+
Request evidence by the claim it must support: the decisive test output, the changed interface, the contradicting observation. Requesting everything moves Executor's trail into Coordinator's context and cancels the saving; requesting too little forces a recovery round. When a return lacks evidence that exists, recover it rather than re-running the work.
|
|
43
|
+
|
|
44
|
+
## What Coordinator Does Not Do Here
|
|
45
|
+
|
|
46
|
+
Coordinator writes an artifact itself only when the user explicitly assigns it (see the core skill). Record maintenance goes to Executor, folded into an assignment already going out rather than sent as a handoff of its own. Recovery after context loss is the exception the core skill names: Coordinator reads the Working Record and the artifacts that define the task directly.
|
|
47
|
+
|
|
48
|
+
The failures to prevent are weak contracts that cause correction cycles, over-specified contracts that move the work back to Coordinator's price, and weak evidence that forces reassessment.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Helper Mode
|
|
2
|
+
|
|
3
|
+
Judgment for placing work when Runtime State shows `Delegation: helper`. The core skill's Rules still apply.
|
|
4
|
+
|
|
5
|
+
Helper mode is for the best output quality. Coordinator implements; Helper takes everything that does not need Coordinator-level reasoning. There is no Executor to invoke or simulate.
|
|
6
|
+
|
|
7
|
+
## Delegate By Default
|
|
8
|
+
|
|
9
|
+
Goal: Coordinator's premium compute goes to the work that needs it, and nothing else.
|
|
10
|
+
|
|
11
|
+
Default: delegate a step unless it needs Coordinator-level reasoning. Keep that category narrow:
|
|
12
|
+
|
|
13
|
+
- governing decisions and design;
|
|
14
|
+
- substantive implementation, meaning changes whose behavior or failure needs engineering ownership;
|
|
15
|
+
- the conversation with the user.
|
|
16
|
+
|
|
17
|
+
Helper takes the rest: gathering sources and skills, investigating bounded questions, preparing authorized setup, running existing checks and validations, separate record maintenance, and straightforward settled changes that are local, reversible, and easy to check. Helper can reason, compare evidence, spot contradictions, and choose local mechanics; it is not limited to copying facts.
|
|
18
|
+
|
|
19
|
+
The failure to prevent is under-delegation: classifying every step as Coordinator-level, so Coordinator does all the gathering, checking, and bookkeeping itself and the mode saves nothing.
|
|
20
|
+
|
|
21
|
+
## Do Not Split What Belongs Together
|
|
22
|
+
|
|
23
|
+
Goal: handoffs save more than they cost.
|
|
24
|
+
|
|
25
|
+
Keep a tightly coupled edit, check, and interpret loop with Coordinator. Moving each check to Helper adds a contract, a ramp-up, and a return, and forces Helper to rebuild the context Coordinator already holds.
|
|
26
|
+
|
|
27
|
+
Hand off results that stand on their own:
|
|
28
|
+
|
|
29
|
+
| Situation | Placement |
|
|
30
|
+
| --- | --- |
|
|
31
|
+
| Before implementing, the sources, callers, and conventions for the planned change need gathering. | Helper gathers; Coordinator implements from the result. |
|
|
32
|
+
| Mid-implementation, Coordinator wants to know which acceptance requirements the candidate meets, which lack a check, and which test edits changed coverage. | Helper runs a read-only cross-check against the Slice's acceptance requirements and returns without patching. |
|
|
33
|
+
| After a feature lands, several record entries, a validation run, and a formatting pass are due. | Helper, as one assignment. |
|
|
34
|
+
| Coordinator just ran a failing test and knows the fix. | Coordinator fixes and reruns; no handoff. |
|
|
35
|
+
| One line of the Working Record needs updating in the middle of Coordinator's own work. | Coordinator updates it; a handoff would cost more than the edit. |
|
|
36
|
+
|
|
37
|
+
If Helper reaches substantive work outside its assignment, it returns findings and partial state, and Coordinator takes the next decision.
|
|
38
|
+
|
|
39
|
+
## Route Preparation
|
|
40
|
+
|
|
41
|
+
Helper gathers; Coordinator implements. Gathered evidence must reach Coordinator: with projection on, Helper selects it at return; with projection off, Coordinator sees Helper's work in ordinary history. Coordinator forms the execution forecast itself.
|
|
42
|
+
|
|
43
|
+
## Coordinator's Own Production
|
|
44
|
+
|
|
45
|
+
Coordinator's direct implementation passes through no handoff, and handoffs are part of how routing keeps long work on course. Rely on Execute Work's forecast and on Workflow's check before each continuation: does the next change meet a requirement, repair a demonstrated defect, or only add an optional guarantee? Do not invent assignments for your own work to recreate that boundary, and use no ACT_BOUNDED; direct production is what this mode is for.
|
|
46
|
+
|
|
47
|
+
Coordinator may update the Working Record directly as part of its own work. When closing a Slice, fold the writeback into Helper work already going out, or do it directly when it is one small update.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "compaction"
|
|
3
|
+
description: "Use when Freeflow says compaction is due or the user asks to compact: prepare what the conversation needs to continue, then compact with freeflow_compact."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Compaction
|
|
7
|
+
|
|
8
|
+
Compaction replaces the conversation with what you write, and starts a new cycle: the stretch of conversation until the next compaction. The next cycle starts from your summary, the Working Record and what it points to, the carried context, and the lines Freeflow adds itself; everything else leaves your context, this skill included. Most drift after compaction comes from a summary that lost something the next step needed.
|
|
9
|
+
|
|
10
|
+
The summary works like a Working Record ([Track Work](../../skills/track-work/SKILL.md)) for one cycle. Ask Track Work's question: if context were lost now, what would the next context need that it could not recover from the Working Record, its defining artifacts, the workspace, or the carried context? Write that, and nothing more. Concise is not lossy: keep a detail when removing it could change the next action.
|
|
11
|
+
|
|
12
|
+
## Rules
|
|
13
|
+
|
|
14
|
+
The Rules are binding; if one cannot be met, stop and say why. The rest of this skill is judgment: follow its goal, and adapt when a different choice serves it better.
|
|
15
|
+
|
|
16
|
+
- With a Working Record, update it first (Track Work, "Prepare For A Context Boundary"), then write the summary, so the two agree. Name the record's path in the summary: Freeflow never names one, and recovery starts from it.
|
|
17
|
+
- Compaction is a context boundary, not a Slice transition or a Checkpoint. Do not rush, close, or pause a Slice to compact, claim an unfinished check passed, or guess the outcome of a running operation.
|
|
18
|
+
- Never write a requested, reported, or expected result as observed. Name every partial or uncommitted change, unverified result, running command, and obligation still waiting on its trigger.
|
|
19
|
+
- Keep exact: paths, identifiers, commands, error text, numbers, and the user's words wherever wording matters. Never paraphrase a decision or a constraint.
|
|
20
|
+
- Material that exists only in the conversation, such as a pasted file or a long message, leaves with it. With a Working Record, save it under the task's `sources/` and point to it; without one, quote what matters in the summary.
|
|
21
|
+
- Under Cognitive Routing with projection, the Coordinator does not compact: its view leaves out what workers did. Delegate an assignment whose contract says to compact with `freeflow_compact` and then return with `freeflow_return`, plus any other work it covers: after compacting, the worker sees the contract again but not its own `freeflow_compact` call. A worker's summary covers the whole session: the user's requests, the Coordinator's decisions, and the state of other work.
|
|
22
|
+
|
|
23
|
+
## When to compact
|
|
24
|
+
|
|
25
|
+
Goal: compact where stopping loses nothing that is not written down. That is a safe point: a finished step whose result you know, such as a check you ran and read, a complete set of edits, or a written report. Halfway through an edit set, with a command still running, or partway through a batch of reads you need together is not one.
|
|
26
|
+
|
|
27
|
+
- At Freeflow's first notice ("compaction is due soon"): if you are at a safe point, compact now. If your work ends within a step or two, with a final answer or a worker's return, finish it instead. Otherwise finish the current step, start nothing large, then compact.
|
|
28
|
+
- At "compact now", or when the user asks: the end of your current step is the safe point. If the step cannot end soon, write its partial state into the record or summary and compact. Under Cognitive Routing a worker compacts before returning: the Coordinator and the next assignment continue the same history, so a return does not stop its growth.
|
|
29
|
+
|
|
30
|
+
## The summary
|
|
31
|
+
|
|
32
|
+
The previous cycle's summary is at the top of your context. Fold what still holds into the new one; drop what is done or no longer matters. Write state, not a story: what is true now, not the order things happened in. Leave out what the Working Record holds and what Freeflow states itself: the cycle, the routing profile, running background commands, and the files read and changed.
|
|
33
|
+
|
|
34
|
+
Read [Summary Format](references/summary-format.md) before writing, and use the shape that matches the work:
|
|
35
|
+
|
|
36
|
+
- **With a Working Record**, the record holds the task. The record-backed shape (`Task`, `Now`, `In flight`, `Next steps`) lets a fresh context continue the current step correctly on its own; the record lets it continue the task.
|
|
37
|
+
- **Without one**, the summary is the record for this cycle, in the record-shaped shape: the record's own headings.
|
|
38
|
+
|
|
39
|
+
Compaction never creates a record; whether a task needs one is decided at its start or when facts change its scope.
|
|
40
|
+
|
|
41
|
+
The limit is about 8,000 tokens. Most summaries need far less. If `freeflow_compact` refuses the call, fix what it names and call it again.
|
|
42
|
+
|
|
43
|
+
## What to carry
|
|
44
|
+
|
|
45
|
+
The notice gives the budget. Freeflow carries the newest results of your work in progress itself (under Cognitive Routing, those of your current assignment; otherwise, those of this cycle), filling whatever budget your picks leave, and lists the rest by ref. Pick only what that misses and the next step needs in full: older output you are working from (by routing ref, such as `ctx:1a2b3c4d`, when Cognitive Routing is on; otherwise by the id in the notice's list) and files you are changing (line ranges for large files), which are read fresh at compaction. Leave out what is cheap to re-read or already in the summary or record. The user's latest messages are carried for you. When the notice says context reuse is off, pick nothing.
|
|
46
|
+
|
|
47
|
+
## After compaction
|
|
48
|
+
|
|
49
|
+
This skill leaves your context with the rest of the conversation. Freeflow's recovery message, right after the carried context, says how to recover; follow it.
|