@hassangameryt/freeflow 0.7.3 → 0.9.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/.agents/plugins/marketplace.json +2 -2
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +2 -2
- package/.codex-plugin/plugin.json +3 -3
- package/.cursor-plugin/plugin.json +1 -1
- package/NOTICE +14 -0
- package/README.md +101 -159
- package/capabilities/cognitive-routing/SKILL.md +47 -210
- package/capabilities/cognitive-routing/references/coordinator.md +163 -0
- package/capabilities/cognitive-routing/references/worker.md +38 -0
- package/capabilities/compaction/SKILL.md +49 -0
- package/capabilities/compaction/references/summary-format.md +250 -0
- package/capabilities/messaging/SKILL.md +49 -0
- package/capabilities/task-memory/SKILL.md +87 -0
- package/command-surface.json +8 -52
- package/gemini-extension.json +1 -1
- package/hooks/claude/hooks.json +13 -3
- package/hooks/codex/hooks.json +2 -1
- package/hooks/shared/runtime-context.mjs +73 -83
- package/licenses/Apache-2.0.txt +55 -0
- package/package.json +42 -12
- package/pi-extension/README.md +41 -0
- package/pi-extension/dist/ask-user/ask.js +108 -0
- package/pi-extension/dist/ask-user/form.js +250 -0
- package/pi-extension/dist/ask-user/questions.js +66 -0
- package/pi-extension/dist/ask-user/tool.js +124 -0
- package/pi-extension/dist/cognitive-routing/assembler.js +417 -0
- package/pi-extension/dist/cognitive-routing/bootstrap.js +90 -0
- package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/config.js +8 -6
- 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} +107 -41
- package/pi-extension/dist/cognitive-routing/gate.js +256 -0
- package/pi-extension/dist/cognitive-routing/handlers.js +901 -0
- package/pi-extension/dist/cognitive-routing/handoffs.js +350 -0
- package/pi-extension/dist/cognitive-routing/model-control.js +476 -0
- package/pi-extension/dist/cognitive-routing/projection.js +520 -0
- package/pi-extension/dist/cognitive-routing/provenance.js +83 -0
- package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/render.js +15 -15
- package/pi-extension/dist/cognitive-routing/runtime.js +398 -0
- package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/schemas.js +47 -11
- package/pi-extension/dist/cognitive-routing/session.js +223 -0
- package/pi-extension/dist/{session-sources → cognitive-routing}/sources.js +126 -87
- package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/state.js +55 -386
- package/pi-extension/dist/cognitive-routing/status.js +81 -0
- package/pi-extension/dist/cognitive-routing/tools.js +74 -0
- package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/types.js +14 -11
- package/pi-extension/dist/compaction/carry.js +205 -0
- package/pi-extension/dist/compaction/config.js +24 -0
- package/pi-extension/dist/compaction/controller.js +494 -0
- package/pi-extension/dist/compaction/harness.js +93 -0
- package/pi-extension/dist/compaction/results.js +159 -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 +62 -0
- package/pi-extension/dist/host/config-validation.js +233 -0
- package/pi-extension/dist/host/config.js +361 -0
- package/pi-extension/dist/host/inbound.js +142 -0
- package/pi-extension/dist/host/projection-tags.js +60 -0
- package/pi-extension/dist/host/prompts.js +93 -0
- package/pi-extension/dist/{session-sources → host}/read-only-session.js +117 -1
- package/pi-extension/dist/{runtime → host}/request-history.js +125 -39
- package/pi-extension/dist/host/rows.js +25 -0
- package/pi-extension/dist/host/runtime-state.js +204 -0
- package/pi-extension/dist/host/section-keeper.js +85 -0
- package/pi-extension/dist/host/settings/freeflow-command.js +2323 -0
- package/pi-extension/dist/{settings/settings-tui.js → host/settings/settings-view.js} +205 -73
- package/pi-extension/dist/host/staging.js +28 -0
- package/pi-extension/dist/host/status.js +115 -0
- package/pi-extension/dist/index.js +1004 -188
- package/pi-extension/dist/messaging/config.js +27 -0
- package/pi-extension/dist/messaging/messaging.js +398 -0
- package/pi-extension/dist/messaging/registry.js +57 -0
- package/pi-extension/dist/messaging/render.js +90 -0
- package/pi-extension/dist/messaging/tools.js +109 -0
- package/pi-extension/dist/messaging/transport.js +101 -0
- 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 +222 -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/task-memory/config.js +49 -0
- package/pi-extension/dist/task-memory/registry.js +119 -0
- package/pi-extension/dist/task-memory/render.js +107 -0
- package/pi-extension/dist/task-memory/runtime.js +994 -0
- package/pi-extension/dist/task-memory/tool.js +233 -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 +430 -0
- package/pi-extension/dist/tool-execution/bash-guard.js +23 -0
- package/pi-extension/dist/tool-execution/config.js +33 -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 +163 -0
- package/pi-extension/dist/tool-execution/guidance-notices.js +124 -0
- package/pi-extension/dist/tool-execution/prompt.js +54 -0
- package/pi-extension/dist/tool-execution/skill-reads.js +143 -0
- package/pi-extension/dist/tool-execution/tools.js +16 -0
- package/pi-extension/freeflow/README.md +9 -0
- package/runtime/prompts/cognitive-routing.md +4 -4
- package/runtime/prompts/core.md +29 -72
- package/runtime/prompts/interaction-contract.md +18 -8
- package/runtime/prompts/tool-execution.md +25 -0
- package/runtime/prompts/working-method.md +25 -0
- package/skills/deliver-work/SKILL.md +76 -0
- package/skills/deliver-work/references/branch-closeout.md +134 -0
- package/skills/deliver-work/references/commit.md +83 -0
- package/skills/deliver-work/references/launch.md +94 -0
- package/skills/deliver-work/references/release.md +85 -0
- package/skills/deliver-work/scripts/commit-state.mjs +139 -0
- package/skills/deliver-work/scripts/delivery-state.mjs +107 -0
- package/skills/deliver-work/scripts/lib/git-state.mjs +178 -0
- package/skills/deliver-work/scripts/push-route.mjs +122 -0
- package/skills/deliver-work/scripts/release-preflight.mjs +177 -0
- package/skills/discuss-work/SKILL.md +148 -0
- package/skills/{discuss → discuss-work}/references/discussion-continuity.md +13 -50
- package/skills/discuss-work/references/learning-action.md +36 -0
- package/skills/discuss-work/scripts/choices.mjs +101 -0
- package/skills/discuss-work/scripts/lib/choices.mjs +159 -0
- package/skills/evaluate-behavior/SKILL.md +107 -0
- package/skills/evaluate-behavior/references/authoring.md +381 -0
- package/skills/evaluate-behavior/references/coding-tasks.md +145 -0
- package/skills/evaluate-behavior/references/conversations-pipelines-judges.md +177 -0
- package/skills/evaluate-behavior/references/design-and-measurement.md +273 -0
- package/skills/evaluate-behavior/references/running-and-evidence.md +245 -0
- package/skills/evaluate-behavior/scripts/claude-guard.mjs +76 -0
- package/skills/evaluate-behavior/scripts/guard-rules.mjs +309 -0
- package/skills/evaluate-behavior/scripts/lib/agreement.mjs +90 -0
- package/skills/evaluate-behavior/scripts/lib/arms.mjs +55 -0
- package/skills/evaluate-behavior/scripts/lib/budget.mjs +87 -0
- package/skills/evaluate-behavior/scripts/lib/build-source.mjs +287 -0
- package/skills/evaluate-behavior/scripts/lib/clear.mjs +74 -0
- package/skills/evaluate-behavior/scripts/lib/container.mjs +395 -0
- package/skills/evaluate-behavior/scripts/lib/decision.mjs +418 -0
- package/skills/evaluate-behavior/scripts/lib/definitions.mjs +1072 -0
- package/skills/evaluate-behavior/scripts/lib/freeflow.mjs +103 -0
- package/skills/evaluate-behavior/scripts/lib/grade-command.mjs +591 -0
- package/skills/evaluate-behavior/scripts/lib/grade-comparison.mjs +90 -0
- package/skills/{evaluate-skill → evaluate-behavior}/scripts/lib/grade-interaction.mjs +19 -18
- package/skills/{evaluate-skill → evaluate-behavior}/scripts/lib/grade-support.mjs +32 -5
- package/skills/{evaluate-skill → evaluate-behavior}/scripts/lib/grade-workspace.mjs +28 -12
- package/skills/evaluate-behavior/scripts/lib/grade.mjs +101 -0
- package/skills/evaluate-behavior/scripts/lib/hooks.mjs +98 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/confinement.mjs +196 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/constraints.mjs +111 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/index.mjs +48 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/isolation.mjs +74 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/launch.mjs +123 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/model-call.mjs +73 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/recorder.mjs +178 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/session.mjs +494 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/skills.mjs +81 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/index.mjs +31 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/names.mjs +3 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/pi/confinement.mjs +173 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/pi/host.mjs +148 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/pi/index.mjs +70 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/pi/isolation.mjs +81 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/pi/model-call.mjs +79 -0
- package/skills/evaluate-behavior/scripts/lib/hosts/pi/process.mjs +241 -0
- package/skills/{evaluate-skill/scripts/lib → evaluate-behavior/scripts/lib/hosts/pi}/rpc.mjs +144 -26
- package/skills/evaluate-behavior/scripts/lib/identity.mjs +82 -0
- package/skills/evaluate-behavior/scripts/lib/judge.mjs +688 -0
- package/skills/evaluate-behavior/scripts/lib/metrics.mjs +332 -0
- package/skills/evaluate-behavior/scripts/lib/model-call.mjs +17 -0
- package/skills/evaluate-behavior/scripts/lib/participants.mjs +616 -0
- package/skills/{evaluate-skill → evaluate-behavior}/scripts/lib/process.mjs +22 -0
- package/skills/evaluate-behavior/scripts/lib/queue.mjs +54 -0
- package/skills/evaluate-behavior/scripts/lib/reference.mjs +343 -0
- package/skills/evaluate-behavior/scripts/lib/reuse.mjs +277 -0
- package/skills/evaluate-behavior/scripts/lib/review.mjs +933 -0
- package/skills/evaluate-behavior/scripts/lib/runner.mjs +732 -0
- package/skills/{evaluate-skill → evaluate-behavior}/scripts/lib/sandbox.mjs +121 -14
- package/skills/evaluate-behavior/scripts/lib/scan-shell.mjs +457 -0
- package/skills/evaluate-behavior/scripts/lib/scan.mjs +479 -0
- package/skills/evaluate-behavior/scripts/lib/seal.mjs +91 -0
- package/skills/evaluate-behavior/scripts/lib/shell.mjs +560 -0
- package/skills/evaluate-behavior/scripts/lib/source-override.mjs +64 -0
- package/skills/evaluate-behavior/scripts/lib/subject-file.mjs +88 -0
- package/skills/{evaluate-skill/scripts/lib/pi.mjs → evaluate-behavior/scripts/lib/subject.mjs} +239 -262
- package/skills/evaluate-behavior/scripts/lib/task-copy.mjs +124 -0
- package/skills/evaluate-behavior/scripts/lib/trials.mjs +524 -0
- package/skills/evaluate-behavior/scripts/lib/validity.mjs +68 -0
- package/skills/evaluate-behavior/scripts/lib/view-html.mjs +454 -0
- package/skills/{evaluate-skill → evaluate-behavior}/scripts/lib/view.mjs +218 -11
- package/skills/evaluate-behavior/scripts/pi-command-tool.mjs +159 -0
- package/skills/evaluate-behavior/scripts/pi-container-route.mjs +23 -0
- package/skills/evaluate-behavior/scripts/pi-guard.mjs +77 -0
- package/skills/evaluate-behavior/scripts/pi-login-refresh.mjs +31 -0
- package/skills/evaluate-behavior/scripts/skill-eval.mjs +586 -0
- package/skills/execute-work/SKILL.md +96 -72
- package/skills/execute-work/references/code-practices.md +27 -49
- package/skills/execute-work/references/design.md +271 -0
- package/skills/execute-work/references/diagnose.md +117 -0
- package/skills/execute-work/references/migration.md +108 -0
- package/skills/execute-work/references/simplify.md +65 -0
- package/skills/execute-work/scripts/self-review.mjs +422 -0
- package/skills/execute-work/scripts/touch-map.mjs +290 -0
- package/skills/review-work/SKILL.md +94 -64
- package/skills/review-work/references/adjudication.md +94 -0
- package/skills/review-work/references/artifact.md +198 -0
- package/skills/review-work/references/evals-and-judges.md +66 -0
- package/skills/review-work/references/work.md +177 -0
- package/skills/review-work/scripts/check-brief.mjs +128 -0
- package/skills/review-work/scripts/review-packet.mjs +233 -0
- package/skills/setup-freeflow/SKILL.md +69 -16
- package/skills/track-work/SKILL.md +135 -151
- package/skills/track-work/references/handoff.md +190 -0
- package/skills/track-work/references/projects.md +51 -0
- package/skills/track-work/references/working-record-format.md +201 -344
- package/skills/track-work/scripts/lib/document.mjs +79 -19
- package/skills/track-work/scripts/lib/format.mjs +18 -1
- package/skills/track-work/scripts/lib/recover.mjs +254 -0
- package/skills/track-work/scripts/lib/registry.mjs +656 -0
- package/skills/track-work/scripts/lib/search.mjs +40 -0
- package/skills/track-work/scripts/lib/store.mjs +53 -21
- package/skills/track-work/scripts/lib/transitions.mjs +79 -4
- package/skills/track-work/scripts/lib/views.mjs +50 -1
- package/skills/track-work/scripts/working-record.mjs +263 -22
- package/skills/verify-work/SKILL.md +64 -47
- package/skills/verify-work/references/feature-map.md +120 -0
- package/skills/verify-work/references/runtime-evidence.md +203 -0
- package/skills/verify-work/references/test-design.md +27 -6
- package/skills/verify-work/scripts/test-changes.mjs +246 -0
- package/skills/write-docs/SKILL.md +171 -0
- package/skills/write-docs/references/documentation-shapes.md +184 -0
- package/skills/write-docs/references/spec-and-plan-shapes.md +308 -0
- package/skills/write-docs/scripts/artifact-check.mjs +148 -0
- package/skills/write-docs/scripts/docs-check.mjs +229 -0
- package/skills/write-docs/scripts/plan-lint.mjs +123 -0
- package/skills/write-skill/SKILL.md +165 -165
- package/skills/write-skill/references/activation-and-wording.md +143 -0
- package/skills/write-skill/references/placement-and-dependencies.md +154 -0
- package/skills/write-skill/scripts/lib/compare.mjs +701 -0
- package/skills/write-skill/scripts/lib/similarity.mjs +56 -0
- package/skills/write-skill/scripts/lib/skill-author.mjs +197 -3
- package/skills/write-skill/scripts/skill-author.mjs +67 -8
- package/capabilities/context-virtualization/SKILL.md +0 -103
- package/capabilities/conversation-history/SKILL.md +0 -53
- package/hooks/tests/check-host-adapters.test.mjs +0 -82
- package/hooks/tests/check-runtime-context-hook.sh +0 -212
- package/pi-extension/dist/cognitive-routing-v2/projection.js +0 -330
- package/pi-extension/dist/cognitive-routing-v2/runtime.js +0 -2181
- package/pi-extension/dist/cognitive-routing-v2/tools.js +0 -60
- 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/settings/settings-ui.js +0 -1360
- 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/plugin.json +0 -33
- package/runtime/prompts/context-virtualization.md +0 -3
- package/runtime/prompts/conversation-history.md +0 -3
- package/skills/action-selection/SKILL.md +0 -100
- package/skills/action-selection/references/trajectory-stalls.md +0 -71
- package/skills/bypass/SKILL.md +0 -153
- package/skills/commit-work/SKILL.md +0 -145
- package/skills/commit-work/references/git-state-edges.md +0 -94
- package/skills/commit-work/references/simple-push.md +0 -92
- package/skills/commit-work/references/staging-decisions.md +0 -106
- package/skills/decision-gate/SKILL.md +0 -106
- package/skills/design-for-depth/SKILL.md +0 -117
- package/skills/design-for-depth/references/design-pressure-signals.md +0 -182
- package/skills/design-for-depth/references/implementation-decisions.md +0 -76
- package/skills/design-for-depth/references/interface-design-loop.md +0 -136
- package/skills/design-for-depth/references/module-and-dependency-design.md +0 -147
- package/skills/design-for-depth/references/software-design-philosophy.md +0 -202
- package/skills/design-for-depth/references/state-and-failure-boundaries.md +0 -136
- package/skills/diagnose-failure/SKILL.md +0 -125
- package/skills/diagnose-failure/references/diagnostic-loop-catalog.md +0 -48
- package/skills/diagnose-failure/references/flaky-and-performance-diagnosis.md +0 -51
- package/skills/discuss/SKILL.md +0 -116
- package/skills/evaluate-skill/SKILL.md +0 -219
- package/skills/evaluate-skill/references/evaluation-definition-schema.md +0 -385
- package/skills/evaluate-skill/references/evaluation-design.md +0 -112
- package/skills/evaluate-skill/references/execution-and-evidence.md +0 -90
- package/skills/evaluate-skill/references/review-and-revision.md +0 -92
- package/skills/evaluate-skill/scripts/lib/definitions.mjs +0 -407
- package/skills/evaluate-skill/scripts/lib/grade-comparison.mjs +0 -60
- package/skills/evaluate-skill/scripts/lib/grade.mjs +0 -64
- package/skills/evaluate-skill/scripts/lib/runner.mjs +0 -368
- package/skills/evaluate-skill/scripts/pi-guard.mjs +0 -164
- package/skills/evaluate-skill/scripts/skill-eval.mjs +0 -102
- package/skills/execute-work/references/execute-work-edges.md +0 -68
- package/skills/finish-branch/SKILL.md +0 -117
- package/skills/finish-branch/references/integration-options.md +0 -80
- package/skills/handoff/SKILL.md +0 -82
- package/skills/handoff/references/handoff-templates.md +0 -150
- package/skills/launch-work/SKILL.md +0 -116
- package/skills/launch-work/references/launch-readiness.md +0 -85
- package/skills/migration-work/SKILL.md +0 -115
- package/skills/migration-work/references/migration-lifecycle.md +0 -82
- package/skills/release-work/SKILL.md +0 -118
- package/skills/release-work/references/release-evidence.md +0 -78
- package/skills/review-artifact/SKILL.md +0 -142
- package/skills/review-artifact/references/adjudicate-artifact-review.md +0 -101
- package/skills/review-artifact/references/independent-artifact-reviewer-contract.md +0 -159
- package/skills/review-work/references/adjudicate-work-review.md +0 -97
- package/skills/review-work/references/independent-work-reviewer-contract.md +0 -139
- package/skills/review-work/references/security-risk-lens.md +0 -69
- package/skills/setup-freeflow/references/activation-contract.md +0 -109
- package/skills/setup-freeflow/references/host-setup.md +0 -67
- package/skills/simplify-code/SKILL.md +0 -85
- package/skills/simplify-code/references/simplification-patterns.md +0 -70
- package/skills/verify-work/references/browser-runtime-evidence.md +0 -55
- package/skills/verify-work/references/integration-evidence.md +0 -47
- package/skills/verify-work/references/performance-evidence.md +0 -57
- package/skills/workflow/SKILL.md +0 -127
- package/skills/workflow/references/domain-skill-composition.md +0 -43
- package/skills/write-plan/SKILL.md +0 -92
- package/skills/write-plan/references/plan-shapes.md +0 -156
- package/skills/write-skill/references/activation-boundaries.md +0 -104
- package/skills/write-skill/references/agent-first-instructions.md +0 -121
- package/skills/write-skill/references/progressive-disclosure.md +0 -127
- package/skills/write-skill/references/skill-dependency-graphs.md +0 -190
- package/skills/write-spec/SKILL.md +0 -92
- package/skills/write-spec/references/artifact-standards.md +0 -86
- package/skills/write-spec/references/decision-records.md +0 -78
- package/skills/write-spec/references/spec-shapes.md +0 -143
- /package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/budget.js +0 -0
- /package/skills/{evaluate-skill → evaluate-behavior}/scripts/lib/evidence.mjs +0 -0
- /package/skills/{evaluate-skill → evaluate-behavior}/scripts/pi-observer.mjs +0 -0
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
# Design Pressure Signals
|
|
2
|
-
|
|
3
|
-
Read this when observed coordination could change the next route and an equivalent design-route classification is not already supported.
|
|
4
|
-
|
|
5
|
-
Do not count smells. Identify the pressure that changes the next action, or conclude that none does.
|
|
6
|
-
|
|
7
|
-
## Classify The Evidence
|
|
8
|
-
|
|
9
|
-
Ask:
|
|
10
|
-
|
|
11
|
-
1. What caller outcome and interface are affected?
|
|
12
|
-
2. What facts must callers know or coordinate?
|
|
13
|
-
3. Did the current change add to that knowledge?
|
|
14
|
-
4. What policy, dependency, state transition, or failure behavior is spreading?
|
|
15
|
-
5. Is the cause supported?
|
|
16
|
-
6. Can the issue be resolved inside accepted scope and authority?
|
|
17
|
-
|
|
18
|
-
Choose the narrowest supported route:
|
|
19
|
-
|
|
20
|
-
- **Continue:** current boundary remains sound.
|
|
21
|
-
- **Local correction:** defect remains within one module and contract.
|
|
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.
|
|
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.
|
|
28
|
-
|
|
29
|
-
## Change Amplification
|
|
30
|
-
|
|
31
|
-
Pressure exists when one policy change requires unrelated edits across callers.
|
|
32
|
-
|
|
33
|
-
Example:
|
|
34
|
-
|
|
35
|
-
```text
|
|
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.
|
|
84
|
-
|
|
85
|
-
## Contract-Surface Growth
|
|
86
|
-
|
|
87
|
-
Pressure exists when each patch adds public:
|
|
88
|
-
|
|
89
|
-
- flags;
|
|
90
|
-
- temporary states;
|
|
91
|
-
- manifest fields;
|
|
92
|
-
- retry links;
|
|
93
|
-
- recovery instructions;
|
|
94
|
-
- provider-specific errors;
|
|
95
|
-
- cache or integrity controls.
|
|
96
|
-
|
|
97
|
-
Ask whether callers own those facts or are being forced to understand internal protocol.
|
|
98
|
-
|
|
99
|
-
## Distorted Tests
|
|
100
|
-
|
|
101
|
-
Pressure exists when tests:
|
|
102
|
-
|
|
103
|
-
- reproduce caller choreography;
|
|
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.
|
|
109
|
-
|
|
110
|
-
Do not automatically add mocks or test-only seams. First inspect whether the production boundary owns the complete behavior.
|
|
111
|
-
|
|
112
|
-
An intentional internal test is not a defect merely because it observes internals.
|
|
113
|
-
|
|
114
|
-
## Edge-Case Patch Streams
|
|
115
|
-
|
|
116
|
-
Pressure exists when related fixes repeatedly add conditions, states, or caller rules.
|
|
117
|
-
|
|
118
|
-
Example:
|
|
119
|
-
|
|
120
|
-
```text
|
|
121
|
-
handle missing contact
|
|
122
|
-
-> handle fallback
|
|
123
|
-
-> handle duplicate delivery
|
|
124
|
-
-> handle retry telemetry
|
|
125
|
-
-> expose another state to callers
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
Do not infer architecture from finding count alone. Diagnose whether the cases share one missing contract, state owner, or failure unit.
|
|
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.
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# Implementation Decisions
|
|
2
|
-
|
|
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
|
-
|
|
5
|
-
Use this method under Design for Depth and the current activity. It does not create another planning phase, document requirement, approval gate, or compute role.
|
|
6
|
-
|
|
7
|
-
## Identify What Implementation Would Still Have To Invent
|
|
8
|
-
|
|
9
|
-
Start from the current goal and constraints, relevant source evidence, and existing design. During discussion, mark unsettled outcomes and approaches as provisional: compare their consequences without turning an explored option into an accepted requirement. Select supported engineering details within the agreement; return user-owned choices through the current activity. Ask:
|
|
10
|
-
|
|
11
|
-
> Which remaining choices could change correctness, complexity, failure behavior, or force substantial dependent work to be redone?
|
|
12
|
-
|
|
13
|
-
Name the actual question, not a generic demand for more design. For example, deciding which occurrence identifies a source matters more than choosing Map versus array; deciding what survives a failed transfer matters more than choosing a retry helper.
|
|
14
|
-
|
|
15
|
-
For each consequential unknown, choose one route:
|
|
16
|
-
|
|
17
|
-
- **Evidence supports a mechanism:** select it and explain why it fits.
|
|
18
|
-
- **An environmental fact is missing:** identify the observation that distinguishes the alternatives before dependent implementation.
|
|
19
|
-
- **A user-owned boundary is unsettled:** return that choice through the current owner.
|
|
20
|
-
- **Only ordinary mechanics remain:** leave them to implementation and continue.
|
|
21
|
-
|
|
22
|
-
Do not invent APIs, future files, or stronger guarantees to complete the design. Nor should the user have to choose implementation syntax: explain user-owned consequences and resolve supported engineering details within the agreement.
|
|
23
|
-
|
|
24
|
-
## Choose The Representation And Mechanism
|
|
25
|
-
|
|
26
|
-
Develop only the decisions that answer the current question. Reuse supported design rather than filling every category:
|
|
27
|
-
|
|
28
|
-
| Decision | Make explicit when material |
|
|
29
|
-
| --- | --- |
|
|
30
|
-
| Representation and identity | Domain objects and independent lifetimes; what counts as the same occurrence; what must remain distinct |
|
|
31
|
-
| State and ownership | Authoritative facts, derived caches, transition owner, and permitted mutations |
|
|
32
|
-
| Algorithm and cost | Essential steps; collection keys and relationships; update/invalidation rules; work repeated as input grows |
|
|
33
|
-
| Effects and failure | Required ordering; what is accepted or visible at each boundary; what survives failure and what may be retried |
|
|
34
|
-
| Modules and dependencies | Who hides each decision; which callers consume the result; dependencies or coordination that must not spread |
|
|
35
|
-
| Evidence | Observable required behavior and a plausible wrong implementation the check must reject |
|
|
36
|
-
|
|
37
|
-
Use Design for Depth's interface, state/failure, and module references when their named questions need resolution; do not repeat their full methods here. Compare materially different approaches only when they remain viable. Prefer eliminating unnecessary coordination to hiding the same protocol behind another helper.
|
|
38
|
-
|
|
39
|
-
## Preserve The Decision, Not A Complete Patch
|
|
40
|
-
|
|
41
|
-
Communicate enough for another implementer, or your later context, to retain the chosen approach:
|
|
42
|
-
|
|
43
|
-
- the decision and its source basis;
|
|
44
|
-
- why it fits and the invariant it protects;
|
|
45
|
-
- the essential mechanism, including a small type or control-flow sketch when useful;
|
|
46
|
-
- the counterexample and distinguishing observer;
|
|
47
|
-
- required constraints versus suggested mechanics and local freedom;
|
|
48
|
-
- the evidence or condition that would invalidate the choice.
|
|
49
|
-
|
|
50
|
-
Use a paragraph, example, or compact table. Do not prescribe every loop or helper, or reproduce the whole program in prose. Naming a data structure without its keys, meaning, and maintenance rules is not useful algorithmic direction.
|
|
51
|
-
|
|
52
|
-
Keep durable decisions in the owning technical design; keep execution order in the Plan and changed understanding in task memory. A current assignment should carry the applicable decisions and relevant source section, not another complete copy of every artifact. A path or hash does not establish that its contents are available to the implementer.
|
|
53
|
-
|
|
54
|
-
## Check Realization Before Dependent Expansion
|
|
55
|
-
|
|
56
|
-
When an unfamiliar boundary could invalidate substantial later work, choose the first coherent implementation path that can disagree with the design. It may span several files and a failure case. A skeleton, happy-path result, or green summary alone may not exercise the decision.
|
|
57
|
-
|
|
58
|
-
Assess the actual implementation and observation: which important choices were realized, omitted, contradicted, or replaced with a supported reason? Check ownership, identity, ordering, and the observer—not fidelity to suggested filenames or helper syntax.
|
|
59
|
-
|
|
60
|
-
A precise sketch can be wrong. Preserve accepted behavior, stop dependent effects when the mechanism is invalidated, and resolve the affected choice through the current owner. Supported local corrections need no design restart. Once the boundary is established, reuse it rather than repeating this assessment after every edit.
|
|
61
|
-
|
|
62
|
-
## Examples
|
|
63
|
-
|
|
64
|
-
### Identity And Indexing
|
|
65
|
-
|
|
66
|
-
Weak direction: "Use a Map and avoid repeated scans."
|
|
67
|
-
|
|
68
|
-
Useful direction: "Keep native occurrence IDs as source identity. Equal bodies may identify several candidates; do not merge their occurrences. Let the source owner maintain the result-to-exchange relationship. Update appended sources and rebuild affected indexes after ancestry replacement. Check repeated equal bodies, late attribution, and a branch change; measure the repeated preparation path rather than only an isolated lookup. Helper layout is local. Reconsider the index if the source does not provide the assumed stable identity."
|
|
69
|
-
|
|
70
|
-
### Acknowledgment And Retry
|
|
71
|
-
|
|
72
|
-
Weak direction: "Make persistence idempotent and robust."
|
|
73
|
-
|
|
74
|
-
Useful direction: "The append owner distinguishes observed acknowledgment from an uncertain attempt. An equal entry in memory does not resolve an earlier failure. Validate before mutation; publish accepted state only at the supported acknowledgment boundary. Test append advancing memory then failing, followed by the identical operation: uncertainty must remain until supported reconciliation. Also test an acknowledged duplicate so the implementation does not reject every retry. Do not infer filesystem durability from readback. Reconsider the mechanism if the actual host boundary differs."
|
|
75
|
-
|
|
76
|
-
Stop when the current discussion has a supported recommendation or explicit open question, or the next implementation has a supported approach and intentional local freedom. Preserve provisional versus accepted decisions when passing the result back to the current activity; discussion does not authorize implementation. Do not pursue a complete blueprint for later work whose premises remain unsettled.
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
# Interface Design Loop
|
|
2
|
-
|
|
3
|
-
Read this before comparing materially different interfaces or settling an important correctness boundary where ownership is consequential.
|
|
4
|
-
|
|
5
|
-
Use only evidence and criteria capable of distinguishing viable boundaries. Do not emit a full checklist unless the artifact itself requires one.
|
|
6
|
-
|
|
7
|
-
## 1. Frame The Complete Outcome
|
|
8
|
-
|
|
9
|
-
Orient broadly enough to state:
|
|
10
|
-
|
|
11
|
-
- caller and complete outcome;
|
|
12
|
-
- source-backed behavior and non-goals;
|
|
13
|
-
- decisions the caller genuinely owns;
|
|
14
|
-
- dependencies and current constraints;
|
|
15
|
-
- material state and failure boundaries;
|
|
16
|
-
- why the current seam requires attention.
|
|
17
|
-
|
|
18
|
-
Do not begin from existing flags, storage paths, classes, or temporary states. They may be symptoms of the current design.
|
|
19
|
-
|
|
20
|
-
## 2. Define The Failure Unit
|
|
21
|
-
|
|
22
|
-
Name the coherent outcome treated as one success, failure, and recovery boundary.
|
|
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).
|
|
35
|
-
|
|
36
|
-
## 3. Inventory Material Caller Knowledge
|
|
37
|
-
|
|
38
|
-
List only facts callers must know and that could affect the boundary:
|
|
39
|
-
|
|
40
|
-
- operations and inputs;
|
|
41
|
-
- caller-owned decisions;
|
|
42
|
-
- ordering and lifecycle states;
|
|
43
|
-
- configuration and provider details;
|
|
44
|
-
- dependencies;
|
|
45
|
-
- errors and failure semantics;
|
|
46
|
-
- compatibility and migration;
|
|
47
|
-
- recovery, cost, and performance expectations.
|
|
48
|
-
|
|
49
|
-
For each fact ask:
|
|
50
|
-
|
|
51
|
-
- Does the caller own it?
|
|
52
|
-
- Could the module own it?
|
|
53
|
-
- Is it stable enough to expose?
|
|
54
|
-
- Would changing it force surrounding edits?
|
|
55
|
-
|
|
56
|
-
The goal is not zero interface knowledge. It is the smallest honest contract.
|
|
57
|
-
|
|
58
|
-
## 4. Classify Capability Maturity
|
|
59
|
-
|
|
60
|
-
Separate:
|
|
61
|
-
|
|
62
|
-
- required trust and safety;
|
|
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.
|
|
68
|
-
|
|
69
|
-
## 5. Produce Alternatives Only When Real
|
|
70
|
-
|
|
71
|
-
When materially different ownership choices remain viable, design two or three interfaces that change seam placement—not only terminology.
|
|
72
|
-
|
|
73
|
-
For each show:
|
|
74
|
-
|
|
75
|
-
1. ordinary caller usage;
|
|
76
|
-
2. caller-owned decisions;
|
|
77
|
-
3. hidden internal protocol;
|
|
78
|
-
4. failure unit and observable behavior;
|
|
79
|
-
5. dependency and adapter strategy;
|
|
80
|
-
6. evidence needed;
|
|
81
|
-
7. material cost or limitation.
|
|
82
|
-
|
|
83
|
-
When module decomposition, cohesion, dependency direction, cycles, layering, policy-versus-infrastructure ownership, or change propagation materially affects the design, read [Module And Dependency Design](module-and-dependency-design.md).
|
|
84
|
-
|
|
85
|
-
Do not manufacture alternatives for a local, reversible, source-backed choice.
|
|
86
|
-
|
|
87
|
-
## 6. Compare On Discriminating Criteria
|
|
88
|
-
|
|
89
|
-
Use only criteria that could change the recommendation:
|
|
90
|
-
|
|
91
|
-
- behavior per interface fact;
|
|
92
|
-
- locality of likely change;
|
|
93
|
-
- cohesion and ownership clarity;
|
|
94
|
-
- correct-use ergonomics;
|
|
95
|
-
- misuse and hidden-decision risk;
|
|
96
|
-
- dependency direction;
|
|
97
|
-
- failure honesty and recovery;
|
|
98
|
-
- contract stability;
|
|
99
|
-
- test surface;
|
|
100
|
-
- reversibility;
|
|
101
|
-
- maturity fit;
|
|
102
|
-
- implementation and evidence cost.
|
|
103
|
-
|
|
104
|
-
Prefer the boundary that removes concepts and coordination, not one that centralizes the same protocol behind additional terminology.
|
|
105
|
-
|
|
106
|
-
## 7. Learn Before Freezing
|
|
107
|
-
|
|
108
|
-
When evidence cannot distinguish viable boundaries, define one bounded learning slice:
|
|
109
|
-
|
|
110
|
-
```text
|
|
111
|
-
Question:
|
|
112
|
-
Competing boundaries:
|
|
113
|
-
Smallest prototype or observation:
|
|
114
|
-
Evidence required:
|
|
115
|
-
Time or cost boundary:
|
|
116
|
-
Discard-or-promote rule:
|
|
117
|
-
Return condition:
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
The learning slice answers the design question. It does not quietly implement the whole subsystem.
|
|
121
|
-
|
|
122
|
-
## 8. Return The Supported Boundary
|
|
123
|
-
|
|
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.
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
# Module And Dependency Design
|
|
2
|
-
|
|
3
|
-
Read this when module decomposition, cohesion, dependency direction, cycles, layering, policy-versus-infrastructure ownership, or change propagation materially affects the design.
|
|
4
|
-
|
|
5
|
-
Do not use this reference merely because the codebase has many files or dependencies.
|
|
6
|
-
|
|
7
|
-
## Decompose Around Coherent Decisions
|
|
8
|
-
|
|
9
|
-
A module should own one coherent outcome, policy, state boundary, or failure unit.
|
|
10
|
-
|
|
11
|
-
Do not split only by:
|
|
12
|
-
|
|
13
|
-
- processing step;
|
|
14
|
-
- technical file type;
|
|
15
|
-
- framework convention;
|
|
16
|
-
- arbitrary size;
|
|
17
|
-
- desire for more abstractions.
|
|
18
|
-
|
|
19
|
-
Ask:
|
|
20
|
-
|
|
21
|
-
- Which behavior changes together?
|
|
22
|
-
- Which decision has one reason to change?
|
|
23
|
-
- Which state and failure behavior belong together?
|
|
24
|
-
- What should callers stop coordinating?
|
|
25
|
-
|
|
26
|
-
## Prefer Cohesion Over Convenience
|
|
27
|
-
|
|
28
|
-
High cohesion means related behavior, invariants, state, and failure handling live together.
|
|
29
|
-
|
|
30
|
-
Pressure exists when:
|
|
31
|
-
|
|
32
|
-
- one module owns unrelated policies;
|
|
33
|
-
- one policy is spread across many modules;
|
|
34
|
-
- state transitions are separated from their invariants;
|
|
35
|
-
- failure handling is detached from the operation it protects;
|
|
36
|
-
- callers assemble the real behavior from helpers.
|
|
37
|
-
|
|
38
|
-
Do not centralize unrelated behavior merely to reduce duplication.
|
|
39
|
-
|
|
40
|
-
## Direct Dependencies Toward Stable Policy
|
|
41
|
-
|
|
42
|
-
Policy should not depend directly on volatile infrastructure details when those details can change independently.
|
|
43
|
-
|
|
44
|
-
Prefer:
|
|
45
|
-
|
|
46
|
-
```text
|
|
47
|
-
stable outcome or policy
|
|
48
|
-
-> small dependency interface
|
|
49
|
-
-> infrastructure adapter
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Use dependency inversion only when it hides real variation, provider mechanics, migration, or testing control.
|
|
53
|
-
|
|
54
|
-
Do not add interfaces around every concrete implementation.
|
|
55
|
-
|
|
56
|
-
## Detect Dependency Cycles
|
|
57
|
-
|
|
58
|
-
A dependency cycle often indicates:
|
|
59
|
-
|
|
60
|
-
- responsibilities are divided incorrectly;
|
|
61
|
-
- shared policy has no owner;
|
|
62
|
-
- state is jointly owned;
|
|
63
|
-
- interfaces expose implementation details;
|
|
64
|
-
- modules must know each other’s lifecycle.
|
|
65
|
-
|
|
66
|
-
Do not break a cycle by moving imports or creating a neutral-looking utility while preserving the same conceptual cycle.
|
|
67
|
-
|
|
68
|
-
Name the shared decision and assign ownership.
|
|
69
|
-
|
|
70
|
-
## Preserve Honest Layering
|
|
71
|
-
|
|
72
|
-
A layer is useful when it hides a distinct level of decision.
|
|
73
|
-
|
|
74
|
-
A layer is shallow when it:
|
|
75
|
-
|
|
76
|
-
- forwards calls;
|
|
77
|
-
- renames types;
|
|
78
|
-
- exposes lower-layer errors and states;
|
|
79
|
-
- requires callers to understand both layers;
|
|
80
|
-
- exists only to satisfy a pattern.
|
|
81
|
-
|
|
82
|
-
Allow a higher-level module to request outcomes. Keep infrastructure details below the boundary.
|
|
83
|
-
|
|
84
|
-
## Use Ports And Adapters Proportionately
|
|
85
|
-
|
|
86
|
-
A port is an outcome or capability required by policy. An adapter supplies concrete infrastructure.
|
|
87
|
-
|
|
88
|
-
Use when:
|
|
89
|
-
|
|
90
|
-
- provider variation exists;
|
|
91
|
-
- migration is known;
|
|
92
|
-
- infrastructure details leak into policy;
|
|
93
|
-
- tests require safe dependency control.
|
|
94
|
-
|
|
95
|
-
Avoid when:
|
|
96
|
-
|
|
97
|
-
- one stable implementation exists;
|
|
98
|
-
- the wrapper hides no decision;
|
|
99
|
-
- the generic interface preserves provider quirks;
|
|
100
|
-
- caller complexity does not decrease.
|
|
101
|
-
|
|
102
|
-
## Keep Shared Code From Becoming Shared Ownership
|
|
103
|
-
|
|
104
|
-
A shared helper may centralize syntax while leaving policy ownership scattered.
|
|
105
|
-
|
|
106
|
-
Before extracting shared code, ask:
|
|
107
|
-
|
|
108
|
-
- Is this one concept that should evolve together?
|
|
109
|
-
- Who owns its behavior and failure contract?
|
|
110
|
-
- Are callers still making the same decision independently?
|
|
111
|
-
- Does extraction remove coordination or merely relocate code?
|
|
112
|
-
|
|
113
|
-
Some duplication is cheaper than a shared abstraction with unclear ownership.
|
|
114
|
-
|
|
115
|
-
## Test Through Module Contracts
|
|
116
|
-
|
|
117
|
-
Module tests should protect:
|
|
118
|
-
|
|
119
|
-
- coherent behavior;
|
|
120
|
-
- invariants;
|
|
121
|
-
- public failure semantics;
|
|
122
|
-
- dependency contracts;
|
|
123
|
-
- real seams.
|
|
124
|
-
|
|
125
|
-
Question module shape when tests must:
|
|
126
|
-
|
|
127
|
-
- construct many internals;
|
|
128
|
-
- reproduce dependency ordering;
|
|
129
|
-
- mock several owned collaborators;
|
|
130
|
-
- inspect states callers should not know.
|
|
131
|
-
|
|
132
|
-
Do not make production architecture imitate the test framework.
|
|
133
|
-
|
|
134
|
-
## Return
|
|
135
|
-
|
|
136
|
-
Return:
|
|
137
|
-
|
|
138
|
-
- affected modules and responsibilities;
|
|
139
|
-
- policy, state, or failure ownership;
|
|
140
|
-
- dependency direction;
|
|
141
|
-
- cycle or layering pressure;
|
|
142
|
-
- proposed boundary and caller contract;
|
|
143
|
-
- variation or migration justifying seams;
|
|
144
|
-
- evidence and unresolved decisions;
|
|
145
|
-
- narrowest supported route.
|
|
146
|
-
|
|
147
|
-
Stop when dependencies support the selected outcome without unnecessary coordination. Do not reorganize the entire codebase for conceptual purity.
|