@hassangameryt/freeflow 0.6.0 → 0.7.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 +2 -2
- package/.codex-plugin/plugin.json +4 -5
- package/README.md +39 -55
- package/capabilities/cognitive-routing/SKILL.md +288 -130
- package/command-surface.json +0 -24
- package/hooks/freeflow-runtime-context.mjs +42 -477
- package/hooks/hooks.json +1 -26
- package/hooks/tests/check-runtime-context-hook.sh +108 -319
- package/package.json +4 -2
- 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/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,48 +1,106 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: decision-gate
|
|
3
|
-
description: Use when proceeding would silently choose for the user,
|
|
2
|
+
name: "decision-gate"
|
|
3
|
+
description: "Use when proceeding would silently choose a consequential outcome for the user, or when accepted sources conflict in a way that leaves one material choice blocking the next action."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Decision Gate
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Resolve one known blocking decision without making it for the user.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
A **blocking decision** is a choice whose realistic answers materially change the accepted outcome, scope, behavior, risk, persistence, compatibility, evidence boundary, or next safe action.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Decision Gate is not general discussion, factual investigation, or an approval checkpoint for routine work. It begins only when one blocking choice or source conflict is clear enough to resolve with one direct question.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
The [Interaction Contract](../../runtime/prompts/interaction-contract.md) governs whether the user is asking, proposing, deciding, or authorizing action. [Workflow](../workflow/SKILL.md) owns authority and routing.
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
- the request conflicts with existing code, tests, docs, policies, requirements, or established behavior;
|
|
18
|
-
- the proposed action would materially change what was requested or agreed, including its evidence quality, risk, cost, persistence, or user-visible result;
|
|
19
|
-
- new evidence exposes one known user choice or source conflict that must be resolved before proceeding.
|
|
16
|
+
## Enter With One Decision
|
|
20
17
|
|
|
21
|
-
|
|
18
|
+
Use Decision Gate only when:
|
|
22
19
|
|
|
23
|
-
|
|
20
|
+
- the requested or accepted path is known;
|
|
21
|
+
- one unresolved choice or material source conflict can be stated precisely;
|
|
22
|
+
- available evidence and established source precedence do not already settle it;
|
|
23
|
+
- different realistic answers would materially change what follows;
|
|
24
|
+
- proceeding would silently decide for the user or override accepted source truth.
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
Do not use Decision Gate for:
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
- facts available through focused passive inspection;
|
|
29
|
+
- reversible implementation details that preserve the accepted outcome;
|
|
30
|
+
- ordinary authorization for one clear additional action;
|
|
31
|
+
- preferences that do not affect the result or its acceptance;
|
|
32
|
+
- hypothetical edge cases without supported reachability or consequence;
|
|
33
|
+
- broad or unsettled option spaces that still require exploration.
|
|
34
|
+
|
|
35
|
+
Use [Discuss](../discuss/SKILL.md) when the problem, alternatives, assumptions, or direction are not yet bounded enough for one decision.
|
|
36
|
+
|
|
37
|
+
When several decisions appear, ask only the earliest one whose answer determines whether the others remain relevant. Do not turn the gate into an interview.
|
|
38
|
+
|
|
39
|
+
## Resolve Facts Before Asking
|
|
40
|
+
|
|
41
|
+
Inspect the smallest existing evidence that can settle the factual part: the current request, accepted decisions, code, tests, documentation, Specs, policies, ADRs, repository state, supplied artifacts, and current primary sources when relevant.
|
|
42
|
+
|
|
43
|
+
Do not ask the user to choose between factual claims whose truth can be established from available evidence.
|
|
44
|
+
|
|
45
|
+
When accepted sources appear to conflict:
|
|
46
|
+
|
|
47
|
+
1. state each source's exact claim and applicable scope;
|
|
48
|
+
2. determine whether each is current, accepted, draft, historical, generated, or advisory;
|
|
49
|
+
3. apply repository-defined precedence or maintenance policy when one exists;
|
|
50
|
+
4. identify the observable consequence of following each claim.
|
|
51
|
+
|
|
52
|
+
A difference is material only when applicable sources make incompatible claims and selecting between them changes the accepted result or next safe action.
|
|
53
|
+
|
|
54
|
+
Do not invent a universal hierarchy: code is not automatically correct because it runs, tests are not automatically requirements because they fail, documentation is not automatically stale because implementation differs, and task memory does not override live accepted source truth.
|
|
55
|
+
|
|
56
|
+
If established precedence resolves the conflict, return the supported result to Workflow without asking a decision question. Updating an inconsistent source belongs to its owning activity and requires its own authority.
|
|
57
|
+
|
|
58
|
+
If responsible framing requires new active evidence, return the exact claim, proposed observer, expected evidence, and stop condition to Workflow. Decision Gate does not run an experiment merely to make its question easier.
|
|
28
59
|
|
|
29
60
|
## Ask One Direct Question
|
|
30
61
|
|
|
31
|
-
State:
|
|
62
|
+
State proportionately:
|
|
32
63
|
|
|
33
|
-
1.
|
|
34
|
-
2. the
|
|
64
|
+
1. the requested or previously accepted path;
|
|
65
|
+
2. the exact missing choice or conflicting evidence;
|
|
35
66
|
3. why it changes the next action;
|
|
36
|
-
4. the
|
|
67
|
+
4. the realistic options and material tradeoffs;
|
|
37
68
|
5. a recommendation when evidence supports one;
|
|
38
69
|
6. one direct question that resolves the block.
|
|
39
70
|
|
|
71
|
+
Frame the choice around the outcome the user owns, not ordinary implementation mechanics. Do not ask which file to change when the real decision is which behavior or contract should govern.
|
|
72
|
+
|
|
73
|
+
Do not manufacture a menu. Omit dominated, unsafe, unavailable, or hypothetical options. A direct yes-or-no question is appropriate when one supported deviation needs a decision. Include preserving the current behavior, waiting, or stopping only when each is real.
|
|
74
|
+
|
|
75
|
+
Recommend plainly when one path is better supported. State its principal tradeoff and what evidence or changed priority would alter the recommendation. A recommendation is not the user's decision.
|
|
76
|
+
|
|
40
77
|
Then stop. Do not perform the blocked action in the same response.
|
|
41
78
|
|
|
42
|
-
Urgency,
|
|
79
|
+
Urgency, prior effort, reviewer confidence, common practice, or general approval to continue does not resolve an unnamed decision or source conflict.
|
|
80
|
+
|
|
81
|
+
## Interpret And Return The Decision
|
|
82
|
+
|
|
83
|
+
Treat an explicit choice as resolving only the decision that was asked. A question, criticism, hypothesis, preference, conditional answer, or request for more information is not automatically a decision; respond to its substance and keep the blocked action stopped.
|
|
84
|
+
|
|
85
|
+
Route narrowly:
|
|
86
|
+
|
|
87
|
+
- explicit choice with a clear covered path → Workflow;
|
|
88
|
+
- answer that reopens alternatives or assumptions → Discuss;
|
|
89
|
+
- unresolved factual evidence → Workflow and the appropriate evidence owner;
|
|
90
|
+
- defer, preserve, or stop → return that outcome without forcing progress.
|
|
91
|
+
|
|
92
|
+
A resolved decision may complete the missing intent for a still-valid request. It does not authorize unrelated effects or another outcome by implication.
|
|
93
|
+
|
|
94
|
+
Return to Workflow with:
|
|
95
|
+
|
|
96
|
+
- the exact decision and who or what established it;
|
|
97
|
+
- the selected outcome and important exclusions;
|
|
98
|
+
- material consequences and affected source truth;
|
|
99
|
+
- remaining uncertainty or revisit condition;
|
|
100
|
+
- the authority state of the next action.
|
|
43
101
|
|
|
44
|
-
|
|
102
|
+
When losing the decision or its rationale could cause later misalignment, Workflow may route [Track Work](../track-work/SKILL.md) to preserve it. Decision Gate does not mutate task memory itself.
|
|
45
103
|
|
|
46
|
-
|
|
104
|
+
Do not broaden the answer, reinterpret it as approval for a different path, or continue past another separately controlled boundary.
|
|
47
105
|
|
|
48
|
-
|
|
106
|
+
Stop when one direct question has been asked and no answer exists, the answer does not resolve the material block, the appropriate decision owner is unavailable, or active evidence is required before a responsible choice can be framed. A supported wait, deferment, preservation boundary, or stop is a valid result.
|
|
@@ -1,87 +1,252 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: design-for-depth
|
|
3
|
-
description: Use
|
|
3
|
+
description: Use during coding and software design to keep boundaries, interfaces, ownership, state, dependencies, and failure behavior simple and proportionate.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Design For Depth
|
|
7
7
|
|
|
8
|
-
Reduce coordination by hiding
|
|
8
|
+
Reduce coordination by hiding coherent, likely-changing decisions behind small, stable, outcome-level interfaces.
|
|
9
9
|
|
|
10
|
-
A **module** is anything with an interface and implementation. A **caller** is anything that uses
|
|
10
|
+
A **module** is anything with an interface and implementation. A **caller** is anything that uses it. The **interface** is every fact callers must know to use it correctly: operations, inputs, decisions, states, ordering, errors, side effects, dependencies, configuration, timing, and recovery.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
**Depth** is useful coherent behavior and hidden complexity per unit of caller knowledge.
|
|
13
13
|
|
|
14
|
-
Use this as a compositional lens
|
|
14
|
+
Use this as a compositional lens under the active activity. It is not a mandatory phase, authority source, architecture owner, or reason to refactor.
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## Orient Broadly, Deepen Narrowly
|
|
17
17
|
|
|
18
|
-
Use
|
|
18
|
+
Use breadth of understanding before depth of intervention.
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Before deepening a design, understand only the material breadth:
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
- complete caller outcome;
|
|
23
|
+
- caller-owned decisions;
|
|
24
|
+
- existing interface and dependencies;
|
|
25
|
+
- canonical state and visible transitions;
|
|
26
|
+
- success, failure, and recovery boundary;
|
|
27
|
+
- current constraints and accepted non-goals;
|
|
28
|
+
- evidence capable of changing the design route.
|
|
23
29
|
|
|
24
|
-
|
|
30
|
+
Then deepen only the decision, seam, state boundary, or failure unit whose ownership could materially change the result.
|
|
25
31
|
|
|
26
|
-
|
|
32
|
+
Do not broaden the task merely to complete the survey. Do not discuss every design topic, inspect every dependency, generate every alternative, or design the whole system.
|
|
27
33
|
|
|
28
|
-
|
|
29
|
-
- the coordination or likely-changing policy the module can hide;
|
|
30
|
-
- visible success and the **failure unit**—the smallest outcome treated as one success, failure, and recovery boundary;
|
|
31
|
-
- failure observers, state or evidence written, forbidden partial outcomes, response policy (stop, fail closed/open, degrade, retry, or escalate), safe restart, recovery, and required proof.
|
|
34
|
+
## Start Shallow
|
|
32
35
|
|
|
33
|
-
|
|
36
|
+
For any coding or design task, ask:
|
|
34
37
|
|
|
35
|
-
|
|
38
|
+
1. What complete outcome is changing?
|
|
39
|
+
2. What must callers currently know or coordinate?
|
|
40
|
+
3. Does this change add caller knowledge, spread policy, alter dependency direction, or change state or failure ownership?
|
|
41
|
+
4. Would keeping the current boundary make correct use or the next likely change materially harder?
|
|
36
42
|
|
|
37
|
-
|
|
43
|
+
When the change is local, source-backed, reversible, and leaves the interface, dependencies, state, and failure unit sound:
|
|
38
44
|
|
|
39
|
-
|
|
45
|
+
- apply this lens silently;
|
|
46
|
+
- preserve accepted behavior;
|
|
47
|
+
- do not load references;
|
|
48
|
+
- do not present architectural alternatives;
|
|
49
|
+
- do not widen the task.
|
|
40
50
|
|
|
41
|
-
|
|
51
|
+
A large mechanical change may need no design escalation. A one-line change may require it when permissions, canonical state, public behavior, compatibility, or consequential failure changes.
|
|
42
52
|
|
|
43
|
-
|
|
53
|
+
An abstraction is not required merely because code is duplicated, tests are awkward, or another design is imaginable.
|
|
54
|
+
|
|
55
|
+
## Enter Early Or Re-enter From Evidence
|
|
56
|
+
|
|
57
|
+
Use this lens early when ownership, interface, state, dependency, or failure decisions could harden into caller contracts before implementation.
|
|
58
|
+
|
|
59
|
+
Early design may support:
|
|
60
|
+
|
|
61
|
+
- discussion;
|
|
62
|
+
- a Spec or Plan;
|
|
63
|
+
- an API or module boundary;
|
|
64
|
+
- a state transition;
|
|
65
|
+
- a consequential integration;
|
|
66
|
+
- test-seam selection.
|
|
67
|
+
|
|
68
|
+
During implementation, testing, and review, preserve a supported boundary without reopening it merely because this lens remains in context.
|
|
69
|
+
|
|
70
|
+
Re-enter later only when direct evidence shows:
|
|
71
|
+
|
|
72
|
+
- caller coordination growing;
|
|
73
|
+
- policy or state spreading;
|
|
74
|
+
- repeated patches adding flags or lifecycle knowledge;
|
|
75
|
+
- tests reproducing internal choreography;
|
|
76
|
+
- dependencies or failures crossing unclear ownership;
|
|
77
|
+
- prior boundary assumptions becoming false.
|
|
78
|
+
|
|
79
|
+
When repeated or unexplained failure lacks a supported cause, use [Diagnose Failure](../diagnose-failure/SKILL.md) first. Diagnosis owns causal investigation. This lens consumes supported structural evidence without recreating the diagnosis.
|
|
80
|
+
|
|
81
|
+
## Establish The Outcome And Failure Unit
|
|
82
|
+
|
|
83
|
+
Before choosing classes, services, packages, adapters, or states, name:
|
|
84
|
+
|
|
85
|
+
- caller and complete outcome;
|
|
86
|
+
- caller-visible success and failure;
|
|
87
|
+
- decisions the caller genuinely owns;
|
|
88
|
+
- coordination or likely-changing policy the module could hide;
|
|
89
|
+
- the **failure unit**: the coherent outcome treated as one success, failure, and recovery boundary.
|
|
90
|
+
|
|
91
|
+
When the boundary has side effects, can leave partial state, or makes failure materially consequential, establish its **failure contract**:
|
|
92
|
+
|
|
93
|
+
- who observes failure;
|
|
94
|
+
- canonical and diagnostic state written;
|
|
95
|
+
- forbidden partial outcomes;
|
|
96
|
+
- stop, fail-open, fail-closed, degrade, retry, or escalation behavior;
|
|
97
|
+
- cancellation and concurrency behavior when relevant;
|
|
98
|
+
- safe restart, recovery, and reconciliation;
|
|
99
|
+
- evidence required to prove the outcome.
|
|
100
|
+
|
|
101
|
+
Failure behavior is part of the interface even when its mechanism remains private.
|
|
102
|
+
|
|
103
|
+
Depth is not breadth. A deep module owns one coherent decision or failure unit. It does not collect unrelated responsibilities merely to reduce method count.
|
|
104
|
+
|
|
105
|
+
Use [Decision Gate](../decision-gate/SKILL.md) when the boundary changes product behavior, public interfaces, compatibility, permissions, security, privacy, billing, data-loss behavior, migration direction, or another user-owned outcome.
|
|
106
|
+
|
|
107
|
+
## Hide Coordination And Likely-Changing Decisions
|
|
108
|
+
|
|
109
|
+
Prefer interfaces where callers request an outcome and the module owns its internal protocol.
|
|
110
|
+
|
|
111
|
+
Before exposing a flag, path, state, ordering rule, retry, provider detail, timing behavior, dependency choice, or recovery step, ask:
|
|
112
|
+
|
|
113
|
+
- Does the caller genuinely own this choice?
|
|
44
114
|
- Does exposing it make correct use easier?
|
|
45
|
-
- Is it stable enough to become a contract?
|
|
115
|
+
- Is it stable enough to become a supported contract?
|
|
116
|
+
- Which surrounding edits would occur if it changed?
|
|
46
117
|
- Could one outcome-level operation hide it?
|
|
47
118
|
|
|
48
|
-
Keep
|
|
119
|
+
Keep public:
|
|
49
120
|
|
|
50
|
-
|
|
121
|
+
- caller-owned outcomes and decisions;
|
|
122
|
+
- stable invariants;
|
|
123
|
+
- necessary inputs;
|
|
124
|
+
- observable success and failure semantics;
|
|
125
|
+
- information required for correct recovery.
|
|
126
|
+
|
|
127
|
+
Keep private unless callers genuinely control them:
|
|
128
|
+
|
|
129
|
+
- sequencing;
|
|
130
|
+
- storage layout;
|
|
131
|
+
- provider mechanics;
|
|
132
|
+
- retries and cleanup;
|
|
133
|
+
- temporary states;
|
|
134
|
+
- cache and optimization machinery;
|
|
135
|
+
- diagnostic implementation;
|
|
136
|
+
- dependency construction.
|
|
137
|
+
|
|
138
|
+
A **seam** is a boundary where behavior, dependencies, or observation can change without forcing surrounding edits. An **enabling point** is where an adapter, test implementation, clock, probe, provider, or migration path enters that seam.
|
|
139
|
+
|
|
140
|
+
Add a seam for demonstrated variation, a known migration, a required observation boundary, or a dependency that must be controlled in tests—not imagined flexibility.
|
|
51
141
|
|
|
52
142
|
## Recognize Structural Pressure
|
|
53
143
|
|
|
54
|
-
Structural pressure
|
|
144
|
+
Structural pressure is evidence that the current boundary is increasing coordination or hiding no useful decision.
|
|
145
|
+
|
|
146
|
+
Pressure may appear as:
|
|
147
|
+
|
|
148
|
+
- change amplification across unrelated callers;
|
|
149
|
+
- caller lifecycle choreography;
|
|
150
|
+
- scattered policy;
|
|
151
|
+
- unowned canonical state or failure behavior;
|
|
152
|
+
- growing flags, temporary states, retries, or recovery rules;
|
|
153
|
+
- tests coupled to machinery rather than accepted behavior;
|
|
154
|
+
- infrastructure details leaking into policy;
|
|
155
|
+
- edge-case patches revealing one shared contract gap;
|
|
156
|
+
- a bounded result unexpectedly requiring a subsystem.
|
|
157
|
+
|
|
158
|
+
Ordinary bugs, failed tests, duplicate code, broad mechanical edits, finding count, and personal design preference do not prove structural pressure.
|
|
159
|
+
|
|
160
|
+
When observed coordination could change the next route, read [Design Pressure Signals](references/design-pressure-signals.md). Skip it only when an equivalent route classification is already supported.
|
|
161
|
+
|
|
162
|
+
When structural pressure is supported but the likely-changing decision or missing information-hiding boundary cannot yet be named, read [Software Design Philosophy](references/software-design-philosophy.md).
|
|
163
|
+
|
|
164
|
+
Read the narrowest reference whose condition matches the current question. Read another only if its distinct question remains afterward.
|
|
165
|
+
|
|
166
|
+
## Choose The Required Design Depth
|
|
167
|
+
|
|
168
|
+
Read [Interface Design Loop](references/interface-design-loop.md) before:
|
|
169
|
+
|
|
170
|
+
- comparing materially different interfaces;
|
|
171
|
+
- selecting consequential ownership;
|
|
172
|
+
- freezing an important correctness boundary;
|
|
173
|
+
- choosing among real seam placements.
|
|
174
|
+
|
|
175
|
+
Read [State And Failure Boundaries](references/state-and-failure-boundaries.md) when correctness materially depends on:
|
|
176
|
+
|
|
177
|
+
- canonical state;
|
|
178
|
+
- partial effects;
|
|
179
|
+
- atomic visibility;
|
|
180
|
+
- concurrency or cancellation;
|
|
181
|
+
- idempotency and retries;
|
|
182
|
+
- recovery or reconciliation;
|
|
183
|
+
- failure evidence.
|
|
184
|
+
|
|
185
|
+
Read [Module And Dependency Design](references/module-and-dependency-design.md) when the question materially concerns:
|
|
186
|
+
|
|
187
|
+
- module decomposition;
|
|
188
|
+
- cohesion and conceptual integrity;
|
|
189
|
+
- dependency direction;
|
|
190
|
+
- cycles or layering;
|
|
191
|
+
- policy versus infrastructure;
|
|
192
|
+
- shared ownership;
|
|
193
|
+
- ports and adapters.
|
|
194
|
+
|
|
195
|
+
Several references may apply to one consequential boundary. Read them one at a time and only while each distinct condition remains.
|
|
196
|
+
|
|
197
|
+
## Test Through The Intended Interface
|
|
55
198
|
|
|
56
|
-
|
|
199
|
+
The intended interface is the normal behavior and test surface.
|
|
57
200
|
|
|
58
|
-
|
|
201
|
+
Question the design before adding test machinery when callers or tests must:
|
|
59
202
|
|
|
60
|
-
|
|
203
|
+
- bypass the intended interface;
|
|
204
|
+
- reproduce lifecycle choreography;
|
|
205
|
+
- mock many internals to verify one outcome;
|
|
206
|
+
- depend on private temporary states;
|
|
207
|
+
- know dependency construction callers should not own.
|
|
61
208
|
|
|
62
|
-
|
|
209
|
+
Do not redesign merely because an internal test observes internals. The problem is external callers requiring knowledge the module should hide.
|
|
63
210
|
|
|
64
|
-
|
|
211
|
+
Architecture-bearing tests should protect:
|
|
65
212
|
|
|
66
|
-
|
|
213
|
+
- accepted behavior;
|
|
214
|
+
- visible failure;
|
|
215
|
+
- state invariants;
|
|
216
|
+
- forbidden partial outcomes;
|
|
217
|
+
- settled recovery behavior;
|
|
218
|
+
- a real dependency or observation seam.
|
|
67
219
|
|
|
68
|
-
|
|
220
|
+
Tests that protect only accidental machinery do not justify that machinery.
|
|
69
221
|
|
|
70
|
-
|
|
222
|
+
Exploratory code can produce design evidence. It does not become production architecture without deliberate selection, authorized implementation, and verification at the required boundary.
|
|
71
223
|
|
|
72
|
-
|
|
224
|
+
## Return The Narrowest Supported Route
|
|
73
225
|
|
|
74
|
-
|
|
226
|
+
Return a changed ownership, scope, authority, or route boundary through [Workflow](../workflow/SKILL.md). Otherwise return to the active activity with:
|
|
75
227
|
|
|
76
|
-
|
|
228
|
+
- structural evidence;
|
|
229
|
+
- affected caller outcome;
|
|
230
|
+
- interface, module, dependency, state, and failure unit involved;
|
|
231
|
+
- likely-changing or currently unowned decision;
|
|
232
|
+
- materially different alternatives only when real;
|
|
233
|
+
- recommendation and assumptions;
|
|
234
|
+
- unresolved user-owned decisions;
|
|
235
|
+
- evidence still required;
|
|
236
|
+
- narrowest route.
|
|
77
237
|
|
|
78
|
-
|
|
79
|
-
- Every caller coordinates retry, storage, cleanup, and error translation → consider an outcome-level module that owns the protocol.
|
|
80
|
-
- One isolated condition is wrong while callers and the interface remain valid → make a local correction; do not redesign.
|
|
81
|
-
- Related failures repeatedly add shared states and caller rules → diagnose the common cause, then use this lens only when structural pressure is supported.
|
|
238
|
+
Possible routes include:
|
|
82
239
|
|
|
83
|
-
|
|
240
|
+
- continue with the current boundary;
|
|
241
|
+
- make a local correction;
|
|
242
|
+
- diagnose an unsupported cause;
|
|
243
|
+
- revise a Spec or Plan;
|
|
244
|
+
- use [Simplify Code](../simplify-code/SKILL.md) for behavior-preserving reduction;
|
|
245
|
+
- run a bounded learning slice;
|
|
246
|
+
- propose bounded deepening;
|
|
247
|
+
- defer supported design pressure;
|
|
248
|
+
- stop for owner direction.
|
|
84
249
|
|
|
85
|
-
|
|
250
|
+
A design recommendation does not authorize implementation.
|
|
86
251
|
|
|
87
|
-
|
|
252
|
+
Freeze a supported boundary instead of pursuing architectural completeness. Retain the decision, not perpetual design activity.
|