@hassangameryt/freeflow 0.7.3 → 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 +26 -31
- package/capabilities/cognitive-routing/SKILL.md +106 -161
- 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 +5 -2
- 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/{session-sources/events.js → cognitive-routing/event-store.js} +103 -40
- 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-v2 → cognitive-routing}/projection.js +229 -56
- package/pi-extension/dist/cognitive-routing/provenance.js +81 -0
- package/pi-extension/dist/cognitive-routing/runtime.js +396 -0
- package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/schemas.js +43 -7
- package/pi-extension/dist/cognitive-routing/session.js +221 -0
- package/pi-extension/dist/{session-sources → cognitive-routing}/sources.js +99 -85
- package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/state.js +37 -378
- package/pi-extension/dist/cognitive-routing/status.js +80 -0
- package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/tools.js +12 -12
- package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/types.js +5 -11
- 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/{runtime → host}/request-history.js +121 -39
- package/pi-extension/dist/host/runtime-state.js +189 -0
- package/pi-extension/dist/{settings/settings-ui.js → host/settings/freeflow-command.js} +620 -410
- 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 +423 -173
- 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 +44 -3
- package/pi-extension/dist/provider-support/{astra → openai}/adapter.js +46 -29
- package/pi-extension/dist/provider-support/{astra → openai}/history.js +10 -8
- package/pi-extension/dist/provider-support/{astra → openai}/index.js +8 -4
- package/pi-extension/dist/provider-support/{astra → openai}/session-state.js +29 -38
- 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 +1 -1
- 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 +35 -11
- 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/runtime.js +0 -2181
- 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 -378
- 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 -314
- 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 -754
- package/pi-extension/dist/runtime/runtime-identity.js +0 -5
- package/pi-extension/dist/session-sources/provenance.js +0 -32
- 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 -173
- package/pi-extension/src/cognitive-routing-v2/projection.ts +0 -375
- package/pi-extension/src/cognitive-routing-v2/render.ts +0 -277
- package/pi-extension/src/cognitive-routing-v2/runtime.ts +0 -2241
- package/pi-extension/src/cognitive-routing-v2/schemas.ts +0 -180
- package/pi-extension/src/cognitive-routing-v2/state.ts +0 -839
- package/pi-extension/src/cognitive-routing-v2/tools.ts +0 -62
- package/pi-extension/src/cognitive-routing-v2/types.ts +0 -254
- 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 -428
- 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 -366
- 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 -390
- package/pi-extension/src/integrations/mcp-config.ts +0 -32
- package/pi-extension/src/provider-support/astra/adapter.ts +0 -108
- package/pi-extension/src/provider-support/astra/history.ts +0 -145
- package/pi-extension/src/provider-support/astra/index.ts +0 -12
- package/pi-extension/src/provider-support/astra/session-state.ts +0 -113
- package/pi-extension/src/provider-support/index.ts +0 -5
- package/pi-extension/src/runtime/request-history.ts +0 -243
- package/pi-extension/src/runtime/runtime-context.ts +0 -860
- package/pi-extension/src/runtime/runtime-identity.ts +0 -8
- package/pi-extension/src/session-sources/events.ts +0 -230
- package/pi-extension/src/session-sources/provenance.ts +0 -39
- package/pi-extension/src/session-sources/read-only-session.ts +0 -170
- package/pi-extension/src/session-sources/sources.ts +0 -334
- package/pi-extension/src/settings/settings-tui.ts +0 -501
- package/pi-extension/src/settings/settings-ui.ts +0 -1652
- package/pi-extension/src/ui/text-component.ts +0 -66
- package/pi-extension/tests/cache-reuse/history.test.js +0 -117
- package/pi-extension/tests/cache-reuse/native.test.js +0 -91
- package/pi-extension/tests/cache-reuse/settings.test.js +0 -211
- package/pi-extension/tests/cognitive-routing-v2/communication.test.js +0 -577
- package/pi-extension/tests/cognitive-routing-v2/compaction-input.test.js +0 -183
- package/pi-extension/tests/cognitive-routing-v2/delegation.test.js +0 -557
- package/pi-extension/tests/cognitive-routing-v2/native.test.js +0 -474
- package/pi-extension/tests/cognitive-routing-v2/performance.test.js +0 -87
- package/pi-extension/tests/cognitive-routing-v2/persistence.test.js +0 -300
- package/pi-extension/tests/cognitive-routing-v2/projection.test.js +0 -241
- package/pi-extension/tests/cognitive-routing-v2/recovery.test.js +0 -1034
- package/pi-extension/tests/cognitive-routing-v2/render.test.js +0 -244
- package/pi-extension/tests/cognitive-routing-v2/runtime.test.js +0 -423
- package/pi-extension/tests/cognitive-routing-v2/stabilization.test.js +0 -521
- package/pi-extension/tests/cognitive-routing-v2/state.test.js +0 -586
- package/pi-extension/tests/context-virtualization/extension.test.js +0 -775
- package/pi-extension/tests/context-virtualization/projector.test.js +0 -110
- package/pi-extension/tests/context-virtualization/runtime.test.js +0 -230
- 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 -191
- package/pi-extension/tests/integration/mode-free-core.test.js +0 -220
- package/pi-extension/tests/integration/pi-extension.test.js +0 -1447
- package/pi-extension/tests/integration/prompt-architecture.test.js +0 -447
- package/pi-extension/tests/integration/unaffected-regressions.test.js +0 -478
- package/pi-extension/tests/provider-support/astra-boundaries.test.js +0 -75
- package/pi-extension/tests/provider-support/astra.test.js +0 -306
- package/pi-extension/tests/provider-support/cli.test.js +0 -92
- package/pi-extension/tests/provider-support/native.test.js +0 -183
- 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
- /package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/render.js +0 -0
|
@@ -9,13 +9,23 @@ 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
|
-
Decision Gate is not general discussion, factual investigation, or an approval checkpoint for routine work.
|
|
12
|
+
Decision Gate is not general discussion, factual investigation, or an approval checkpoint for routine work. 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.
|
|
13
13
|
|
|
14
|
-
The
|
|
14
|
+
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.
|
|
15
|
+
|
|
16
|
+
## Rules
|
|
17
|
+
|
|
18
|
+
- After asking, stop. Do not perform the blocked action in the same response, and never settle a user-owned choice by proceeding.
|
|
19
|
+
- Never ask the user to choose between factual claims that available evidence can settle.
|
|
20
|
+
- Urgency, prior effort, reviewer confidence, common practice, or general approval to continue does not resolve an unnamed decision or source conflict.
|
|
21
|
+
- An explicit choice resolves only the decision that was asked. A question, criticism, hypothesis, preference, conditional answer, or request for more information is not a decision, and no answer authorizes unrelated effects, another outcome, or a separately controlled boundary.
|
|
22
|
+
- Decision Gate runs no experiments and does not change task memory; return those needs to Workflow.
|
|
15
23
|
|
|
16
24
|
## Enter With One Decision
|
|
17
25
|
|
|
18
|
-
|
|
26
|
+
Goal: use the gate only for a real, bounded, blocking choice.
|
|
27
|
+
|
|
28
|
+
Use Decision Gate when:
|
|
19
29
|
|
|
20
30
|
- the requested or accepted path is known;
|
|
21
31
|
- one unresolved choice or material source conflict can be stated precisely;
|
|
@@ -23,24 +33,15 @@ Use Decision Gate only when:
|
|
|
23
33
|
- different realistic answers would materially change what follows;
|
|
24
34
|
- proceeding would silently decide for the user or override accepted source truth.
|
|
25
35
|
|
|
26
|
-
Do not use
|
|
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
|
+
Do not use it for facts available through focused passive inspection, reversible implementation details that preserve the accepted outcome, ordinary authorization for one clear additional action, preferences that do not affect the result, hypothetical edge cases without supported reachability or consequence, or broad option spaces that still need exploration; use [Discuss](../discuss/SKILL.md) when the problem, alternatives, assumptions, or direction are not yet bounded enough for one decision.
|
|
36
37
|
|
|
37
|
-
When several decisions appear, ask
|
|
38
|
+
When several decisions appear, ask the earliest one whose answer determines whether the others remain relevant. Do not turn the gate into an interview.
|
|
38
39
|
|
|
39
40
|
## Resolve Facts Before Asking
|
|
40
41
|
|
|
41
|
-
|
|
42
|
+
Goal: the question the user receives contains only what they must decide.
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
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.
|
|
44
45
|
|
|
45
46
|
When accepted sources appear to conflict:
|
|
46
47
|
|
|
@@ -49,16 +50,14 @@ When accepted sources appear to conflict:
|
|
|
49
50
|
3. apply repository-defined precedence or maintenance policy when one exists;
|
|
50
51
|
4. identify the observable consequence of following each claim.
|
|
51
52
|
|
|
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.
|
|
53
|
+
A difference is material only when applicable sources make incompatible claims and selecting between them changes the accepted result or next safe action. Do not invent a universal hierarchy: code is not correct because it runs, tests are not requirements because they fail, documentation is not stale because implementation differs, and task memory does not override live accepted source truth.
|
|
57
54
|
|
|
58
|
-
If
|
|
55
|
+
If established precedence resolves the conflict, return the supported result to Workflow without asking. Updating an inconsistent source belongs to its owning activity and needs its own authority. If framing the choice responsibly needs new active evidence, return the exact claim, proposed observer, expected evidence, and stop condition to Workflow.
|
|
59
56
|
|
|
60
57
|
## Ask One Direct Question
|
|
61
58
|
|
|
59
|
+
Goal: the user can decide from one message, and knows what you recommend.
|
|
60
|
+
|
|
62
61
|
State proportionately:
|
|
63
62
|
|
|
64
63
|
1. the requested or previously accepted path;
|
|
@@ -68,39 +67,21 @@ State proportionately:
|
|
|
68
67
|
5. a recommendation when evidence supports one;
|
|
69
68
|
6. one direct question that resolves the block.
|
|
70
69
|
|
|
71
|
-
Frame the choice around the outcome the user owns, not
|
|
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
|
-
|
|
77
|
-
Then stop. Do not perform the blocked action in the same response.
|
|
70
|
+
Frame the choice around the outcome the user owns, not implementation mechanics: do not ask which file to change when the real decision is which behavior or contract should govern. Do not manufacture a menu; omit dominated, unsafe, unavailable, or hypothetical options. A yes-or-no question fits when one supported deviation needs a decision. Include preserving current behavior, waiting, or stopping only when each is real.
|
|
78
71
|
|
|
79
|
-
|
|
72
|
+
Recommend plainly when one path is better supported, with its principal tradeoff and what would change the recommendation. A recommendation is not the user's decision.
|
|
80
73
|
|
|
81
74
|
## Interpret And Return The Decision
|
|
82
75
|
|
|
83
|
-
|
|
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:
|
|
76
|
+
Goal: carry exactly the decision made, no more and no less, back to the work.
|
|
95
77
|
|
|
96
|
-
|
|
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.
|
|
78
|
+
Respond to the substance of anything that is not a decision, and keep the blocked action stopped. Route narrowly:
|
|
101
79
|
|
|
102
|
-
|
|
80
|
+
- explicit choice with a clear covered path -> Workflow;
|
|
81
|
+
- answer that reopens alternatives or assumptions -> Discuss;
|
|
82
|
+
- unresolved factual evidence -> Workflow and the appropriate evidence owner;
|
|
83
|
+
- defer, preserve, or stop -> return that outcome without forcing progress.
|
|
103
84
|
|
|
104
|
-
|
|
85
|
+
A resolved decision may complete the missing intent for a still-valid request. Return to Workflow with the exact decision and who or what established it, the selected outcome and important exclusions, material consequences and affected source truth, remaining uncertainty or revisit condition, and the authority state of the next action. When losing the decision or its rationale could cause later misalignment, Workflow may route [Track Work](../track-work/SKILL.md) to preserve it.
|
|
105
86
|
|
|
106
|
-
Stop when one direct question has been asked and no answer exists, the answer does not resolve the material block, the
|
|
87
|
+
Stop when one direct question has been asked and no answer exists, the answer does not resolve the material block, the 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.
|
|
@@ -7,13 +7,24 @@ description: "Use during coding and software design to keep boundaries, interfac
|
|
|
7
7
|
|
|
8
8
|
Hide coherent, likely-changing decisions behind small, stable, outcome-level interfaces. Reduce the knowledge and coordination callers need without changing the accepted outcome.
|
|
9
9
|
|
|
10
|
-
A module is anything with an interface and implementation. Its interface includes every fact a caller needs for correct use: operations, decisions, inputs, state, ordering, effects, errors, dependencies, timing, and recovery.
|
|
10
|
+
A module is anything with an interface and an implementation. Its interface includes every fact a caller needs for correct use: operations, decisions, inputs, state, ordering, effects, errors, dependencies, timing, and recovery. A module is **deep** when it provides much useful, coherent behavior per unit of caller knowledge; depth is not fewer methods or more responsibilities.
|
|
11
11
|
|
|
12
|
-
Use this lens under the current activity. It is not a mandatory phase, architecture owner, permission to refactor
|
|
12
|
+
Use this lens under the current activity. It is not a mandatory phase, an architecture owner, or permission to refactor.
|
|
13
|
+
|
|
14
|
+
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.
|
|
15
|
+
|
|
16
|
+
## Rules
|
|
17
|
+
|
|
18
|
+
- A design recommendation is not implementation authority, and this lens never enlarges a task by itself. A new dependency must earn its place through the accepted outcome or a demonstrated need.
|
|
19
|
+
- Never remove required correctness, trust, or safety to make a design smaller. Never turn hypothetical lifecycle completeness into a production requirement.
|
|
20
|
+
- Never design around an invented product or failure policy. When a boundary changes product behavior, public interfaces, compatibility, permissions, security, privacy, billing, data-loss behavior, migration direction, or another user-owned outcome, use [Decision Gate](../decision-gate/SKILL.md) with its concrete consequences and supported alternatives.
|
|
21
|
+
- Do not invent APIs, files, or stronger guarantees to make a design look complete; name the missing observation or choice instead.
|
|
13
22
|
|
|
14
23
|
## Start With The Required Outcome
|
|
15
24
|
|
|
16
|
-
|
|
25
|
+
Goal: know whether the change touches a boundary worth designing, before designing anything.
|
|
26
|
+
|
|
27
|
+
Understand enough breadth to identify the caller's complete outcome, accepted constraints, current interface, dependencies, canonical state, and relevant success and failure boundary. Do not survey the entire system or settle future variations without a present question.
|
|
17
28
|
|
|
18
29
|
Ask:
|
|
19
30
|
|
|
@@ -22,96 +33,76 @@ Ask:
|
|
|
22
33
|
3. Does the change spread policy, state, dependency choices, or lifecycle knowledge?
|
|
23
34
|
4. Would the current boundary make correct use or the next likely change materially harder?
|
|
24
35
|
|
|
25
|
-
For a local, source-backed, reversible change that leaves these boundaries sound, apply the lens silently and continue
|
|
26
|
-
|
|
27
|
-
A large mechanical change may need no design escalation. A one-line change may need it when it changes permissions, public behavior, canonical state, or consequential failure semantics.
|
|
36
|
+
For a local, source-backed, reversible change that leaves these boundaries sound, apply the lens silently and continue: load no references, generate no alternatives, add no abstraction because another shape is imaginable. A large mechanical change may need no design escalation; a one-line change may need it when it changes permissions, public behavior, canonical state, or consequential failure semantics.
|
|
28
37
|
|
|
29
38
|
## Intervene Where The Decision Can Still Change
|
|
30
39
|
|
|
31
|
-
|
|
40
|
+
Goal: settle consequential choices before they harden into caller contracts, and leave ordinary mechanics free.
|
|
32
41
|
|
|
33
|
-
|
|
42
|
+
Use the lens early when interface, ownership, state, or failure choices could harden. It can support discussion, a Spec or Plan, implementation preparation, or choosing a test seam.
|
|
34
43
|
|
|
35
|
-
|
|
44
|
+
Read [Implementation Decisions](references/implementation-decisions.md) when unresolved representation, identity, ownership, algorithm, dependency, or failure choices could materially change a technical recommendation or invalidate significant dependent work, before recommending a mechanism, writing its guiding design, or beginning substantial implementation.
|
|
36
45
|
|
|
37
|
-
Ordinary bugs, duplication, test awkwardness, finding count, and preference do not establish structural pressure. Use [Diagnose Failure](../diagnose-failure/SKILL.md) first when repeated or unexplained failures lack a supported cause
|
|
46
|
+
Once a boundary is supported, do not reopen it because this skill remains in context. Re-enter when evidence shows growing caller coordination, scattered policy, exposed internal states, fragile test choreography, unclear dependency or failure ownership, or an invalidated design assumption. Ordinary bugs, duplication, test awkwardness, finding count, and preference do not establish structural pressure. Use [Diagnose Failure](../diagnose-failure/SKILL.md) first when repeated or unexplained failures lack a supported cause; this lens consumes a structural finding rather than inventing one.
|
|
38
47
|
|
|
39
48
|
## Bound Success And Failure Proportionately
|
|
40
49
|
|
|
41
|
-
|
|
50
|
+
Goal: the failure behavior that matters is owned, and nothing more is built.
|
|
51
|
+
|
|
52
|
+
Before choosing classes, services, packages, flags, or states, name:
|
|
42
53
|
|
|
43
54
|
- the caller and complete accepted outcome;
|
|
44
|
-
- caller-owned decisions and observable success
|
|
55
|
+
- caller-owned decisions and observable success and failure;
|
|
45
56
|
- the likely-changing coordination the module could hide;
|
|
46
|
-
- the failure unit
|
|
57
|
+
- the **failure unit**: what must succeed, fail, and recover as one coherent boundary.
|
|
47
58
|
|
|
48
|
-
Where effects or partial state are consequential, establish the material failure contract: observer, canonical
|
|
59
|
+
Where effects or partial state are consequential, establish the material failure contract: observer, canonical and diagnostic state, forbidden outcomes, stop/degrade/fail/retry behavior, and supported recovery. Include cancellation, concurrency, or reconciliation only where required behavior or observed reachability makes them material. Read [State And Failure Boundaries](references/state-and-failure-boundaries.md) when correctness depends on them.
|
|
49
60
|
|
|
50
|
-
Distinguish required correctness and safety from optional stronger guarantees.
|
|
51
|
-
|
|
52
|
-
Use [Decision Gate](../decision-gate/SKILL.md) when the proposed boundary changes product behavior, public interfaces, compatibility, permissions, security, privacy, billing, data-loss behavior, migration direction, or another user-owned outcome. Explain concrete consequences and supported alternatives, not only an architectural label.
|
|
61
|
+
Distinguish required correctness and safety from optional stronger guarantees. Efficiency, scale, and portability need an accepted requirement or observed pressure before they shape the design. A module owning a failure unit does not automatically need durable replay, rollback, universal provenance, or every recovery mechanism.
|
|
53
62
|
|
|
54
63
|
## Hide Coordination Without Hiding Caller Choices
|
|
55
64
|
|
|
56
|
-
|
|
65
|
+
Goal: callers request outcomes; the module owns the protocol.
|
|
57
66
|
|
|
58
67
|
Before exposing a flag, path, state, ordering rule, retry, provider detail, or recovery step, ask whether the caller genuinely owns it, whether it makes correct use easier, and whether it is stable enough to become a supported contract.
|
|
59
68
|
|
|
60
|
-
Keep public:
|
|
61
|
-
|
|
62
|
-
- caller-owned outcomes and decisions;
|
|
63
|
-
- necessary inputs and stable invariants;
|
|
64
|
-
- observable success/failure;
|
|
65
|
-
- information required for correct recovery.
|
|
69
|
+
Keep public: caller-owned outcomes and decisions, necessary inputs and stable invariants, observable success and failure, and information required for correct recovery. Keep internal unless callers genuinely control it: sequencing, storage layout, dependency construction, provider mechanics, retries, cleanup, temporary states, caches, optimization machinery, and diagnostic details.
|
|
66
70
|
|
|
67
|
-
|
|
71
|
+
A **seam** lets behavior, a dependency, or an observer change without coordinated surrounding edits; the adapter, clock, provider, or probe that plugs into it is what varies. Add one for demonstrated variation, a known migration, a required observer, or a dependency needing control, not for imagined flexibility.
|
|
68
72
|
|
|
69
|
-
|
|
70
|
-
- retries, cleanup, temporary states, caches, and optimization machinery;
|
|
71
|
-
- diagnostic implementation details.
|
|
72
|
-
|
|
73
|
-
A seam permits behavior, dependency, or observation changes without coordinated surrounding edits. An enabling point admits the adapter, clock, provider, or probe at that seam. Add one for demonstrated variation, a known migration, a required observer, or a dependency needing control—not imagined flexibility.
|
|
74
|
-
|
|
75
|
-
Do not centralize unrelated responsibilities merely to reduce interface count or scatter an old protocol into callers while claiming an abstraction was removed.
|
|
73
|
+
Do not centralize unrelated responsibilities to reduce interface count, or scatter an old protocol into callers while claiming an abstraction was removed.
|
|
76
74
|
|
|
77
75
|
## Load Only The Depth The Question Needs
|
|
78
76
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
Read [Software Design Philosophy](references/software-design-philosophy.md) when structural pressure is supported but the likely-changing decision or missing information-hiding boundary cannot yet be named.
|
|
82
|
-
|
|
83
|
-
Read [Interface Design Loop](references/interface-design-loop.md) before comparing materially different interfaces, choosing consequential ownership, freezing an important correctness boundary, or choosing among real seam placements.
|
|
77
|
+
Goal: read the one reference that answers the open question, and stop.
|
|
84
78
|
|
|
85
|
-
|
|
79
|
+
- [Design Pressure Signals](references/design-pressure-signals.md): observed coordination could change the route, or pressure is supported but the missing boundary cannot yet be named.
|
|
80
|
+
- [Interface Design Loop](references/interface-design-loop.md): comparing materially different interfaces, choosing consequential ownership, freezing an important correctness boundary, or choosing among real seam placements.
|
|
81
|
+
- [State And Failure Boundaries](references/state-and-failure-boundaries.md): correctness depends on canonical state, partial effects, atomic visibility, concurrency, cancellation, retries, idempotency, recovery, reconciliation, or failure evidence.
|
|
82
|
+
- [Module And Dependency Design](references/module-and-dependency-design.md): decomposition, cohesion, dependency direction, cycles, layering, shared ownership, policy versus infrastructure, or ports and adapters.
|
|
86
83
|
|
|
87
|
-
Read
|
|
88
|
-
|
|
89
|
-
Read references one at a time while each distinct question remains. Do not convert their checklists into obligations unrelated to the accepted result.
|
|
84
|
+
Read references one at a time while each distinct question remains. Do not convert their lists into obligations unrelated to the accepted result.
|
|
90
85
|
|
|
91
86
|
## Learn Without Building The Future System
|
|
92
87
|
|
|
93
|
-
|
|
88
|
+
Goal: when evidence cannot choose between boundaries, answer that question cheaply.
|
|
94
89
|
|
|
95
|
-
The experiment must answer the design question
|
|
90
|
+
Frame a bounded prototype or observation through the current owner: question, alternatives, adequate observer, permitted effects, evidence, return condition, and disposition. The experiment must answer the design question; if its next prerequisite is future production infrastructure, reassess before building it. One failed extension or technique does not prove every in-scope approach impossible.
|
|
96
91
|
|
|
97
|
-
Return a supported boundary or an explicit limitation. Working exploratory code is evidence, not
|
|
92
|
+
Return a supported boundary or an explicit limitation. Working exploratory code is evidence, not production architecture; promotion needs deliberate selection and authority, and a negative answer does not require another, broader prototype.
|
|
98
93
|
|
|
99
94
|
## Check Through The Intended Interface
|
|
100
95
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
An internal test inspecting internals is not itself a design defect. The concern is callers requiring knowledge the module should hide, or a fixture manufacturing the behavior it claims to observe.
|
|
96
|
+
Goal: tests protect the behavior callers rely on, not the machinery.
|
|
104
97
|
|
|
105
|
-
|
|
98
|
+
The intended interface should normally be the behavior and test surface. Question the design when callers or tests must bypass it, coordinate private lifecycle steps, replace many internals, or know dependency construction the module should own. An internal test inspecting internals is not itself a defect; the concern is callers needing hidden knowledge, or a fixture manufacturing the behavior it claims to observe.
|
|
106
99
|
|
|
107
|
-
|
|
100
|
+
Architecture-bearing checks protect accepted behavior, visible failures, required state invariants, forbidden partial outcomes, settled recovery, and real dependency or observation seams. Tests that protect accidental machinery do not justify keeping it. Test order is not a design criterion.
|
|
108
101
|
|
|
109
102
|
## Return The Smallest Supported Change
|
|
110
103
|
|
|
111
104
|
Return to [Workflow](../workflow/SKILL.md) when ownership, scope, authority, or the route changes. Otherwise return to the current activity with the structural evidence, affected outcome, boundary, likely-changing decision, assumptions, and remaining evidence or user-owned choice.
|
|
112
105
|
|
|
113
|
-
Compare alternatives only when real. Recommend the simplest supported boundary that preserves required behavior
|
|
114
|
-
|
|
115
|
-
Possible results include keeping the existing design, a local correction, diagnosis, an artifact revision, a bounded learning action, an accepted deepening, explicit deferral, or a stop for owner direction. Use [Simplify Code](../simplify-code/SKILL.md) when the selected result is behavior-preserving reduction.
|
|
106
|
+
Compare alternatives only when real. Recommend the simplest supported boundary that preserves required behavior, with its principal cost and what would invalidate it. Results include keeping the existing design, a local correction, diagnosis, an artifact revision, a bounded learning action, an accepted deepening, explicit deferral, or a stop for owner direction. Use [Simplify Code](../simplify-code/SKILL.md) when the selected result is behavior-preserving reduction.
|
|
116
107
|
|
|
117
|
-
Freeze a sufficiently supported boundary instead of pursuing architectural completeness.
|
|
108
|
+
Freeze a sufficiently supported boundary instead of pursuing architectural completeness.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Design Pressure Signals
|
|
2
2
|
|
|
3
|
-
Read this when observed coordination could change the next route and an equivalent design-route classification is not already supported.
|
|
3
|
+
Read this when observed coordination could change the next route and an equivalent design-route classification is not already supported, or when structural pressure is supported but the likely-changing decision or missing information-hiding boundary cannot yet be named.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This reference is judgment. Identify the pressure that changes the next action, or conclude that none does; do not count smells, and do not produce a literature review or system-wide redesign.
|
|
6
6
|
|
|
7
7
|
## Classify The Evidence
|
|
8
8
|
|
|
@@ -17,166 +17,68 @@ Ask:
|
|
|
17
17
|
|
|
18
18
|
Choose the narrowest supported route:
|
|
19
19
|
|
|
20
|
-
- **Continue:** current boundary remains sound.
|
|
21
|
-
- **Local correction:** defect
|
|
22
|
-
- **Diagnosis:** failure is repeated or unexplained and cause is unsupported.
|
|
23
|
-
- **Spec or Plan revision:** behavior, acceptance, or execution boundary is incomplete.
|
|
24
|
-
- **User decision:** resolving pressure changes a user-owned outcome.
|
|
20
|
+
- **Continue:** the current boundary remains sound.
|
|
21
|
+
- **Local correction:** the defect stays within one module and contract.
|
|
22
|
+
- **Diagnosis:** a failure is repeated or unexplained and its cause is unsupported.
|
|
23
|
+
- **Spec or Plan revision:** behavior, acceptance, or the execution boundary is incomplete.
|
|
24
|
+
- **User decision:** resolving the pressure changes a user-owned outcome.
|
|
25
25
|
- **Learning:** evidence cannot distinguish viable boundaries.
|
|
26
|
-
- **Deepening:** supported information-hiding improvement fits accepted scope.
|
|
27
|
-
- **Deferred deepening:** pressure is real but not worth resolving now.
|
|
26
|
+
- **Deepening:** a supported information-hiding improvement fits accepted scope.
|
|
27
|
+
- **Deferred deepening:** the pressure is real but not worth resolving now.
|
|
28
28
|
|
|
29
|
-
##
|
|
29
|
+
## Recognize The Signals
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Complexity is coordination, not line count. It shows up as change amplification (one change needs many surrounding edits), cognitive load (callers must remember many facts), obscurity (important rules are hard to find), dependency burden (safe change needs unrelated modules understood), and unknown unknowns (a caller cannot tell what else to inspect). A large implementation can be simple to use; a small helper can be complex when every caller must know its quirks.
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
- **Change amplification.** One policy change needs edits across unrelated callers, such as a retry policy touching routes, workers, UI state, and tests. Name the decision causing the edits; do not merely move the same choreography into one helper.
|
|
34
|
+
- **Caller protocol growth.** Callers perform internal lifecycle steps (`configure -> open -> retry -> translate error -> clean up -> publish evidence`), each correction adds a state or flag, recovery becomes ordinary caller behavior, or callers depend on paths, filenames, provider errors, or queue names. Ask whether one operation can own the complete success and failure unit while publishing diagnostics separately.
|
|
35
|
+
- **Scattered policy.** One product or operational decision is encoded in several places, such as billing transition timing in a webhook, dashboard, email, and worker. Do not centralize it until the policy is accepted; stop for a decision when it is user-owned or conflicting.
|
|
36
|
+
- **Unowned state or failure.** No module owns canonical state and its visibility point, forbidden partial outcomes, retry or escalation, cancellation and reconciliation, recovery after partial completion, or the evidence proving the final state.
|
|
37
|
+
- **Contract-surface growth.** Each patch adds public flags, temporary states, manifest fields, retry links, recovery instructions, provider-specific errors, or cache and integrity controls. Ask whether callers own those facts or are being forced to understand internal protocol.
|
|
38
|
+
- **Distorted tests.** Tests reproduce caller choreography, mock many helpers to verify one outcome, depend on private lifecycle states, protect machinery from recent patches, prove rejection without checking forbidden writes, or make provider mechanics look like domain requirements. First inspect whether the production boundary owns the complete behavior; do not automatically add mocks or test-only seams.
|
|
39
|
+
- **Edge-case patch streams.** Related fixes keep adding conditions, states, or caller rules (missing contact, then fallback, then duplicate delivery, then retry telemetry, then another exposed state). Diagnose whether the cases share one missing contract, state owner, or failure unit; finding count alone is not architecture.
|
|
40
|
+
- **Scope growth.** A bounded result unexpectedly needs a subsystem, expands remaining work, pulls in deferred capabilities, invalidates earlier evidence, or requires unrelated callers to change. Return the evidence; the route may be simplify, split, revise an artifact, learn, defer, or stop.
|
|
34
41
|
|
|
35
|
-
|
|
36
|
-
Changing retry policy requires edits in API routes, workers,
|
|
37
|
-
UI state, and tests.
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Name the decision causing the edits. Do not merely move the same choreography into one helper.
|
|
41
|
-
|
|
42
|
-
## Caller Protocol Growth
|
|
43
|
-
|
|
44
|
-
Pressure exists when callers must perform internal lifecycle steps:
|
|
45
|
-
|
|
46
|
-
```text
|
|
47
|
-
configure -> open -> retry -> translate error -> clean up -> publish evidence
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
Related signals:
|
|
51
|
-
|
|
52
|
-
- every correction adds another state or flag;
|
|
53
|
-
- recovery steps become ordinary caller behavior;
|
|
54
|
-
- callers depend on paths, filenames, provider errors, or queue names;
|
|
55
|
-
- a complete outcome becomes a public protocol of attempts and temporary states.
|
|
56
|
-
|
|
57
|
-
Ask whether one operation can own the complete success and failure unit while publishing diagnostics separately.
|
|
58
|
-
|
|
59
|
-
## Scattered Policy
|
|
60
|
-
|
|
61
|
-
Pressure exists when one product or operational decision is encoded in several places.
|
|
62
|
-
|
|
63
|
-
Example:
|
|
64
|
-
|
|
65
|
-
```text
|
|
66
|
-
billing transition timing appears separately in webhook,
|
|
67
|
-
dashboard, email, and worker behavior.
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Do not centralize behavior until the policy is accepted. When it is user-owned or conflicting, stop for a decision.
|
|
71
|
-
|
|
72
|
-
## Unowned State Or Failure
|
|
73
|
-
|
|
74
|
-
Pressure exists when no module owns:
|
|
75
|
-
|
|
76
|
-
- canonical state and its visibility point;
|
|
77
|
-
- forbidden partial outcomes;
|
|
78
|
-
- retry, degradation, or escalation;
|
|
79
|
-
- cancellation and reconciliation;
|
|
80
|
-
- recovery after partial completion;
|
|
81
|
-
- evidence proving the final state.
|
|
82
|
-
|
|
83
|
-
Do not design architecture around an invented failure policy.
|
|
42
|
+
Common interface mismatches:
|
|
84
43
|
|
|
85
|
-
|
|
44
|
+
- **Pass-through wrapper:** renames a call without hiding policy or provider behavior; keep it only for a real domain, compatibility, or observation boundary.
|
|
45
|
+
- **Leaky interface:** callers know infrastructure-specific details.
|
|
46
|
+
- **God module:** unrelated decisions collected behind one interface.
|
|
47
|
+
- **Speculative seam:** indirection for imagined variation.
|
|
48
|
+
- **Dependency cycle:** modules cannot change independently because their responsibilities point at each other.
|
|
49
|
+
- **Premature artifact detail:** a Spec or Plan freezes classes, factories, tables, or algorithms before evidence supports the boundary.
|
|
86
50
|
|
|
87
|
-
|
|
51
|
+
## Rule Out False Positives
|
|
88
52
|
|
|
89
|
-
-
|
|
90
|
-
- temporary states;
|
|
91
|
-
- manifest fields;
|
|
92
|
-
- retry links;
|
|
93
|
-
- recovery instructions;
|
|
94
|
-
- provider-specific errors;
|
|
95
|
-
- cache or integrity controls.
|
|
53
|
+
Do not escalate when stable repetition is small and local, broad edits are mechanical and source-backed, a one-off script needs no long-term abstraction, a wrapper preserves a real compatibility contract, an isolated condition is wrong but the interface is sound, an internal test intentionally verifies an internal module, or resolving the pressure would exceed the user's goal without blocking it.
|
|
96
54
|
|
|
97
|
-
|
|
55
|
+
## Name The Missing Boundary
|
|
98
56
|
|
|
99
|
-
|
|
57
|
+
When pressure is supported, find the decision the module should hide.
|
|
100
58
|
|
|
101
|
-
|
|
59
|
+
Organize modules around decisions likely to change, not processing steps. Instead of exposing `parse -> validate -> retry -> send -> log -> clean up`, look for the decision those steps implement, such as a notification delivery policy. Ask which decision would cause the most surrounding edits if it changed, which callers know it now, who should own it, what outcome-level interface would let callers stop knowing it, and whether it is accepted or still user-owned. Failure and recovery policy are often the likely-changing decision.
|
|
102
60
|
|
|
103
|
-
-
|
|
104
|
-
- mock many helpers to verify one outcome;
|
|
105
|
-
- depend on private lifecycle states;
|
|
106
|
-
- protect machinery introduced by recent patches;
|
|
107
|
-
- prove rejection without checking forbidden writes;
|
|
108
|
-
- make provider mechanics look like domain requirements.
|
|
61
|
+
A deep module lets callers state the outcome while it owns sequencing, likely-changing policy, internal transitions, cleanup, provider mechanics, and internal failure handling. A wrapper is not deep because it hides lines; it is deep when callers stop knowing concepts or coordinating protocol. Depth is not breadth: a god module hiding unrelated decisions is not deep.
|
|
109
62
|
|
|
110
|
-
|
|
63
|
+
Prefer proportionate strategic design over tactical patching, not maximal architecture: stop the current patch when it clearly spreads a likely-changing decision, adds caller protocol, exposes internal state, creates another required workaround, or makes the next accepted change materially harder.
|
|
111
64
|
|
|
112
|
-
|
|
65
|
+
Preserve conceptual integrity: one coherent model of the outcome, state, and failure behavior. Pressure exists when a concept has different names or rules across callers, several modules partly own one decision, callers translate between incompatible representations, or each feature adds another exception to the shared concept. This does not mean one module or one abstraction.
|
|
113
66
|
|
|
114
|
-
|
|
67
|
+
Every observable fact is a contract callers may depend on: flags, paths, states, errors, timing rules, fallbacks, ordering, filenames, retry counts. Expose a fact only when the caller owns the decision, correct use requires it, it is stable enough to support, and its compatibility cost is understood.
|
|
115
68
|
|
|
116
|
-
|
|
69
|
+
Classify each proposed mechanism by what it is for: **trust** (knowing the result is valid), **safety** (preventing damage, leakage, or runaway behavior), **efficiency**, **scale**, or **portability**. Trust and safety cannot be deferred to simplify a design; efficiency, scale, and portability need an accepted requirement or observed pressure.
|
|
117
70
|
|
|
118
|
-
|
|
71
|
+
Name the boundary with supported evidence:
|
|
119
72
|
|
|
120
73
|
```text
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
74
|
+
Outcome:
|
|
75
|
+
Coordination currently spread across:
|
|
76
|
+
Likely-changing decision:
|
|
77
|
+
Current owners:
|
|
78
|
+
Proposed owner:
|
|
79
|
+
What callers would stop knowing:
|
|
80
|
+
Failure unit:
|
|
81
|
+
Evidence still missing:
|
|
126
82
|
```
|
|
127
83
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
## Scope Growth
|
|
131
|
-
|
|
132
|
-
Pressure exists when a bounded result unexpectedly:
|
|
133
|
-
|
|
134
|
-
- requires a subsystem;
|
|
135
|
-
- expands remaining work;
|
|
136
|
-
- pulls deferred capabilities into scope;
|
|
137
|
-
- invalidates earlier evidence;
|
|
138
|
-
- requires unrelated callers to change.
|
|
139
|
-
|
|
140
|
-
Return the evidence. The correct route may be simplify, split, revise an artifact, learn, defer, or stop.
|
|
141
|
-
|
|
142
|
-
## Common Interface Mismatches
|
|
143
|
-
|
|
144
|
-
### Pass-through wrapper
|
|
145
|
-
|
|
146
|
-
Renames a call without hiding policy or provider behavior.
|
|
147
|
-
|
|
148
|
-
Keep only when it preserves a real domain, compatibility, or observation boundary.
|
|
149
|
-
|
|
150
|
-
### Leaky interface
|
|
151
|
-
|
|
152
|
-
Callers know infrastructure-specific details.
|
|
153
|
-
|
|
154
|
-
### God module
|
|
155
|
-
|
|
156
|
-
Unrelated decisions are collected behind one interface.
|
|
157
|
-
|
|
158
|
-
### Speculative seam
|
|
159
|
-
|
|
160
|
-
Indirection exists only for imagined variation.
|
|
161
|
-
|
|
162
|
-
### Dependency cycle
|
|
163
|
-
|
|
164
|
-
Modules cannot change independently because their responsibilities point at each other.
|
|
165
|
-
|
|
166
|
-
### Premature artifact detail
|
|
167
|
-
|
|
168
|
-
A Spec or Plan freezes classes, factories, tables, or algorithms before evidence supports the boundary.
|
|
169
|
-
|
|
170
|
-
## False Positives
|
|
171
|
-
|
|
172
|
-
Do not escalate when:
|
|
173
|
-
|
|
174
|
-
- stable repetition remains small and local;
|
|
175
|
-
- broad edits are mechanical and source-backed;
|
|
176
|
-
- a one-off script does not need long-term abstraction;
|
|
177
|
-
- a wrapper preserves a real compatibility contract;
|
|
178
|
-
- an isolated condition is wrong but the interface remains sound;
|
|
179
|
-
- an internal test intentionally verifies an internal module;
|
|
180
|
-
- resolving the pressure would exceed the user’s goal without blocking it.
|
|
181
|
-
|
|
182
|
-
Stop once the route is classified. Return evidence and classification; do not redesign automatically.
|
|
84
|
+
If the decision cannot yet be named, define one bounded learning question rather than a generic abstraction. Stop once the route is classified and the missing boundary is named, or evidence shows no worthwhile boundary change; return the evidence and classification without redesigning automatically.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Read this when unresolved representation, identity, ownership, algorithm, dependency, or failure choices could materially change a technical recommendation or invalidate significant dependent work. Apply it before recommending a mechanism during discussion, writing its guiding design, or beginning substantial implementation. Skip it for a supported local change whose remaining mechanics do not alter those boundaries.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This reference is judgment, used under Design for Depth and the current activity. It does not create another planning phase, document requirement, approval gate, or compute role.
|
|
6
6
|
|
|
7
7
|
## Identify What Implementation Would Still Have To Invent
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Read this before comparing materially different interfaces or settling an important correctness boundary where ownership is consequential.
|
|
4
4
|
|
|
5
|
-
Use only evidence and criteria capable of distinguishing viable boundaries
|
|
5
|
+
This reference is judgment. Use only evidence and criteria capable of distinguishing viable boundaries; the numbered steps are an order of thinking, not output to emit.
|
|
6
6
|
|
|
7
7
|
## 1. Frame The Complete Outcome
|
|
8
8
|
|
|
@@ -19,19 +19,7 @@ Do not begin from existing flags, storage paths, classes, or temporary states. T
|
|
|
19
19
|
|
|
20
20
|
## 2. Define The Failure Unit
|
|
21
21
|
|
|
22
|
-
Name the
|
|
23
|
-
|
|
24
|
-
Define material:
|
|
25
|
-
|
|
26
|
-
- terminal states and observers;
|
|
27
|
-
- canonical and diagnostic state;
|
|
28
|
-
- evidence written;
|
|
29
|
-
- forbidden partial outcomes;
|
|
30
|
-
- safe restart and recovery;
|
|
31
|
-
- required proof;
|
|
32
|
-
- whether partial reuse is required or merely an optimization.
|
|
33
|
-
|
|
34
|
-
When correctness materially depends on canonical state, partial effects, atomic visibility, concurrency, cancellation, retries, recovery, reconciliation, or evidence of the final outcome, read [State And Failure Boundaries](state-and-failure-boundaries.md).
|
|
22
|
+
Name the failure unit as Design for Depth's Bound Success And Failure describes, including whether partial reuse is required or merely an optimization. When correctness depends on canonical state, partial effects, atomic visibility, concurrency, cancellation, retries, recovery, reconciliation, or final-outcome evidence, read [State And Failure Boundaries](state-and-failure-boundaries.md).
|
|
35
23
|
|
|
36
24
|
## 3. Inventory Material Caller Knowledge
|
|
37
25
|
|
|
@@ -55,16 +43,9 @@ For each fact ask:
|
|
|
55
43
|
|
|
56
44
|
The goal is not zero interface knowledge. It is the smallest honest contract.
|
|
57
45
|
|
|
58
|
-
## 4. Classify
|
|
59
|
-
|
|
60
|
-
Separate:
|
|
46
|
+
## 4. Classify What Each Mechanism Is For
|
|
61
47
|
|
|
62
|
-
|
|
63
|
-
- accepted efficiency or scale;
|
|
64
|
-
- demonstrated portability;
|
|
65
|
-
- speculative flexibility.
|
|
66
|
-
|
|
67
|
-
Do not defer required correctness to obtain a simpler-looking interface. Do not promote hypothetical efficiency, scale, or portability into present architecture.
|
|
48
|
+
Separate required trust and safety from efficiency, scale, and portability, as [Design Pressure Signals](design-pressure-signals.md) describes. Do not defer required correctness for a simpler-looking interface, or promote hypothetical efficiency, scale, or portability into present architecture.
|
|
68
49
|
|
|
69
50
|
## 5. Produce Alternatives Only When Real
|
|
70
51
|
|
|
@@ -121,16 +102,4 @@ The learning slice answers the design question. It does not quietly implement th
|
|
|
121
102
|
|
|
122
103
|
## 8. Return The Supported Boundary
|
|
123
104
|
|
|
124
|
-
Return
|
|
125
|
-
|
|
126
|
-
- structural evidence;
|
|
127
|
-
- selected boundary and hidden decision;
|
|
128
|
-
- caller-owned contract;
|
|
129
|
-
- module and dependency implications;
|
|
130
|
-
- failure unit and material failure behavior;
|
|
131
|
-
- rejected alternatives and discriminating reason, when alternatives were real;
|
|
132
|
-
- unresolved user-owned decisions;
|
|
133
|
-
- assumptions and required evidence;
|
|
134
|
-
- narrowest next route.
|
|
135
|
-
|
|
136
|
-
Stop once a boundary is supported or a bounded learning question is identified. Recommendation does not authorize implementation.
|
|
105
|
+
Return the selected boundary with its structural evidence, hidden decision, caller-owned contract, failure behavior, the discriminating reason when alternatives were real, unresolved user-owned decisions, and the narrowest next route. Stop once a boundary is supported or a bounded learning question is identified.
|