@cratis/pi 8.0.2 → 8.2.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/package/corpus/harnesses/copilot/instructions/ai-distribution.instructions.md +9 -102
- package/package/corpus/harnesses/copilot/instructions/authoring-skills.instructions.md +3 -5
- package/package/corpus/harnesses/copilot/instructions/browser.instructions.md +8 -49
- package/package/corpus/harnesses/copilot/instructions/code-health.instructions.md +1 -1
- package/package/corpus/harnesses/copilot/instructions/code-quality.csharp.instructions.md +3 -84
- package/package/corpus/harnesses/copilot/instructions/code-quality.instructions.md +6 -51
- package/package/corpus/harnesses/copilot/instructions/code-quality.typescript.instructions.md +4 -81
- package/package/corpus/harnesses/copilot/instructions/codescene.instructions.md +5 -54
- package/package/corpus/harnesses/copilot/instructions/components.instructions.md +1 -1
- package/package/corpus/harnesses/copilot/instructions/cratis-folder-is-configuration.instructions.md +5 -22
- package/package/corpus/harnesses/copilot/instructions/csharp.instructions.md +7 -315
- package/package/corpus/harnesses/copilot/instructions/dialogs.instructions.md +1 -1
- package/package/corpus/harnesses/copilot/instructions/discoverability.instructions.md +3 -25
- package/package/corpus/harnesses/copilot/instructions/documentation-structure-and-formatting.instructions.md +5 -151
- package/package/corpus/harnesses/copilot/instructions/documentation.instructions.md +5 -104
- package/package/corpus/harnesses/copilot/instructions/editing-cratis-docs.instructions.md +5 -63
- package/package/corpus/harnesses/copilot/instructions/efcore.instructions.md +8 -55
- package/package/corpus/harnesses/copilot/instructions/efcore.specs.instructions.md +3 -33
- package/package/corpus/harnesses/copilot/instructions/elixir.instructions.md +6 -79
- package/package/corpus/harnesses/copilot/instructions/exit-codes-and-wrappers.instructions.md +4 -27
- package/package/corpus/harnesses/copilot/instructions/framework-dotnet.instructions.md +4 -6
- package/package/corpus/harnesses/copilot/instructions/framework.instructions.md +0 -2
- package/package/corpus/harnesses/copilot/instructions/frontend-quality.instructions.md +0 -1
- package/package/corpus/harnesses/copilot/instructions/frontend-testing.instructions.md +1 -1
- package/package/corpus/harnesses/copilot/instructions/github-actions.instructions.md +7 -138
- package/package/corpus/harnesses/copilot/instructions/glossary.instructions.md +19 -19
- package/package/corpus/harnesses/copilot/instructions/go-engineering.instructions.md +1 -4
- package/package/corpus/harnesses/copilot/instructions/go.instructions.md +2 -7
- package/package/corpus/harnesses/copilot/instructions/guards-and-fuses.instructions.md +5 -6
- package/package/corpus/harnesses/copilot/instructions/java.instructions.md +7 -129
- package/package/corpus/harnesses/copilot/instructions/kotlin.instructions.md +8 -165
- package/package/corpus/harnesses/copilot/instructions/local-work-artifacts.instructions.md +4 -1
- package/package/corpus/harnesses/copilot/instructions/orleans.instructions.md +5 -98
- package/package/corpus/harnesses/copilot/instructions/profiles.instructions.md +9 -63
- package/package/corpus/harnesses/copilot/instructions/scripting.instructions.md +1 -1
- package/package/corpus/harnesses/copilot/instructions/specs.csharp.instructions.md +8 -148
- package/package/corpus/harnesses/copilot/instructions/specs.elixir.instructions.md +4 -37
- package/package/corpus/harnesses/copilot/instructions/specs.typescript.instructions.md +3 -1
- package/package/corpus/harnesses/copilot/instructions/storybook.instructions.md +7 -70
- package/package/corpus/harnesses/copilot/instructions/typescript.instructions.md +8 -98
- package/package/corpus/harnesses/copilot/instructions/writing-correct-examples.instructions.md +3 -47
- package/package/corpus/harnesses/copilot/instructions/writing-cratis-docs.instructions.md +3 -65
- package/package/corpus/hooks/README.md +16 -8
- package/package/corpus/hooks/scripts/cratis-cleanup-worktrees.sh +109 -6
- package/package/corpus/hooks/scripts/cratis-guard-shell-writes.sh +1 -1
- package/package/corpus/hooks/scripts/quality-gates.json +3 -5
- package/package/corpus/rules/ai-distribution.md +9 -102
- package/package/corpus/rules/authoring-skills.md +3 -5
- package/package/corpus/rules/browser.md +8 -49
- package/package/corpus/rules/code-health-policy.txt +4 -24
- package/package/corpus/rules/code-health.md +1 -1
- package/package/corpus/rules/code-quality.csharp.md +3 -84
- package/package/corpus/rules/code-quality.md +6 -51
- package/package/corpus/rules/code-quality.typescript.md +4 -81
- package/package/corpus/rules/codescene.md +5 -54
- package/package/corpus/rules/components.md +1 -1
- package/package/corpus/rules/cratis-folder-is-configuration.md +5 -22
- package/package/corpus/rules/csharp.md +7 -315
- package/package/corpus/rules/dialogs.md +1 -1
- package/package/corpus/rules/discoverability.md +3 -25
- package/package/corpus/rules/documentation-structure-and-formatting.md +5 -151
- package/package/corpus/rules/documentation.md +5 -104
- package/package/corpus/rules/editing-cratis-docs.md +5 -63
- package/package/corpus/rules/efcore.md +8 -55
- package/package/corpus/rules/efcore.specs.md +3 -33
- package/package/corpus/rules/elixir.md +6 -79
- package/package/corpus/rules/exit-codes-and-wrappers.md +4 -27
- package/package/corpus/rules/framework-dotnet.md +4 -6
- package/package/corpus/rules/framework.md +0 -2
- package/package/corpus/rules/frontend-quality.md +0 -1
- package/package/corpus/rules/frontend-testing.md +1 -1
- package/package/corpus/rules/general.md +2 -2
- package/package/corpus/rules/github-actions.md +7 -138
- package/package/corpus/rules/glossary.md +19 -19
- package/package/corpus/rules/go-engineering.md +1 -4
- package/package/corpus/rules/go.md +2 -7
- package/package/corpus/rules/guards-and-fuses.md +5 -6
- package/package/corpus/rules/java.md +7 -129
- package/package/corpus/rules/kotlin.md +8 -165
- package/package/corpus/rules/local-work-artifacts.md +4 -1
- package/package/corpus/rules/orleans.md +5 -98
- package/package/corpus/rules/profiles.md +9 -63
- package/package/corpus/rules/scripting.md +1 -1
- package/package/corpus/rules/specs.csharp.md +8 -148
- package/package/corpus/rules/specs.elixir.md +4 -37
- package/package/corpus/rules/specs.typescript.md +3 -1
- package/package/corpus/rules/storybook.md +7 -70
- package/package/corpus/rules/typescript.md +8 -98
- package/package/corpus/rules/writing-correct-examples.md +3 -47
- package/package/corpus/rules/writing-cratis-docs.md +3 -65
- package/package/corpus/skills/cratis-application-growth/SKILL.md +7 -54
- package/package/corpus/skills/cratis-application-growth/references/move-and-untangle.md +49 -0
- package/package/corpus/skills/cratis-application-growth/references/rename-window.md +12 -14
- package/package/corpus/skills/cratis-application-growth/references/stages.md +2 -2
- package/package/corpus/skills/cratis-arc-authorize-request/SKILL.md +2 -2
- package/package/corpus/skills/cratis-arc-authorize-request/references/csharp.md +3 -3
- package/package/corpus/skills/cratis-arc-authorize-request/references/kotlin.md +2 -2
- package/package/corpus/skills/cratis-arc-code-analysis-typescript/SKILL.md +10 -43
- package/package/corpus/skills/cratis-arc-code-analysis-typescript/references/rule-fixes.md +40 -0
- package/package/corpus/skills/cratis-arc-connect-storage/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-connect-storage/references/csharp.md +1 -1
- package/package/corpus/skills/cratis-arc-declare-command/references/csharp.md +4 -4
- package/package/corpus/skills/cratis-arc-declare-command/references/go.md +1 -1
- package/package/corpus/skills/cratis-arc-declare-command/references/kotlin.md +6 -7
- package/package/corpus/skills/cratis-arc-declare-operation/SKILL.md +2 -8
- package/package/corpus/skills/cratis-arc-declare-operation/references/csharp.md +1 -1
- package/package/corpus/skills/cratis-arc-diagnose-live-query/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-diagnose-live-query/references/csharp.md +1 -1
- package/package/corpus/skills/cratis-arc-expose-mcp-operation/SKILL.md +6 -12
- package/package/corpus/skills/cratis-arc-expose-mcp-operation/references/custom-exposure-and-audit.md +4 -0
- package/package/corpus/skills/cratis-arc-expose-query/SKILL.md +2 -2
- package/package/corpus/skills/cratis-arc-expose-query/references/csharp.md +11 -4
- package/package/corpus/skills/cratis-arc-expose-query/references/typescript.md +1 -1
- package/package/corpus/skills/cratis-arc-generate-proxies/SKILL.md +2 -2
- package/package/corpus/skills/cratis-arc-generate-proxies/references/csharp.md +1 -1
- package/package/corpus/skills/cratis-arc-generate-proxies/references/go.md +19 -2
- package/package/corpus/skills/cratis-arc-generate-proxies/references/typescript.md +1 -1
- package/package/corpus/skills/cratis-arc-host-application/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-host-application/references/csharp.md +1 -2
- package/package/corpus/skills/cratis-arc-host-application/references/elixir.md +2 -2
- package/package/corpus/skills/cratis-arc-host-application/references/go.md +5 -1
- package/package/corpus/skills/cratis-arc-host-application/references/java.md +1 -1
- package/package/corpus/skills/cratis-arc-host-application/references/kotlin.md +1 -1
- package/package/corpus/skills/cratis-arc-host-application/references/typescript.md +1 -1
- package/package/corpus/skills/cratis-arc-identity-and-tenancy-kotlin/SKILL.md +4 -7
- package/package/corpus/skills/cratis-arc-invoke-command/SKILL.md +1 -1
- package/package/corpus/skills/cratis-arc-invoke-command/references/csharp.md +4 -4
- package/package/corpus/skills/cratis-arc-invoke-command/references/typescript.md +1 -1
- package/package/corpus/skills/cratis-arc-isolate-tenant/SKILL.md +2 -2
- package/package/corpus/skills/cratis-arc-isolate-tenant/references/csharp.md +2 -2
- package/package/corpus/skills/cratis-arc-isolate-tenant/references/elixir.md +1 -1
- package/package/corpus/skills/cratis-arc-isolate-tenant/references/java.md +1 -1
- package/package/corpus/skills/cratis-arc-isolate-tenant/references/kotlin.md +1 -1
- package/package/corpus/skills/cratis-arc-isolate-tenant/references/typescript.md +4 -2
- package/package/corpus/skills/cratis-arc-migrate-relational-schema/SKILL.md +6 -6
- package/package/corpus/skills/cratis-arc-page-query/SKILL.md +3 -3
- package/package/corpus/skills/cratis-arc-page-query/references/csharp.md +10 -6
- package/package/corpus/skills/cratis-arc-page-query/references/elixir.md +2 -2
- package/package/corpus/skills/cratis-arc-page-query/references/java.md +1 -1
- package/package/corpus/skills/cratis-arc-page-query/references/kotlin.md +1 -1
- package/package/corpus/skills/cratis-arc-react-bind-slice/SKILL.md +2 -2
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/csharp.md +1 -1
- package/package/corpus/skills/cratis-arc-react-bind-slice/references/kotlin.md +1 -1
- package/package/corpus/skills/cratis-arc-react-separate-view-model/SKILL.md +7 -3
- package/package/corpus/skills/cratis-arc-react-separate-view-model/references/react-routing-and-messaging.md +1 -1
- package/package/corpus/skills/cratis-arc-select-backend-sdk/SKILL.md +2 -2
- package/package/corpus/skills/cratis-arc-select-backend-sdk/references/elixir.md +2 -4
- package/package/corpus/skills/cratis-arc-select-backend-sdk/references/go.md +2 -2
- package/package/corpus/skills/cratis-arc-select-backend-sdk/references/java.md +1 -1
- package/package/corpus/skills/cratis-arc-select-backend-sdk/references/kotlin.md +2 -2
- package/package/corpus/skills/cratis-arc-select-backend-sdk/references/typescript.md +1 -3
- package/package/corpus/skills/cratis-arc-spring-data-kotlin/SKILL.md +13 -51
- package/package/corpus/skills/cratis-arc-spring-data-kotlin/references/read-model-naming.md +9 -1
- package/package/corpus/skills/cratis-arc-spring-data-kotlin/references/storage-boundaries.md +40 -0
- package/package/corpus/skills/cratis-arc-storage-typescript/SKILL.md +19 -64
- package/package/corpus/skills/cratis-arc-storage-typescript/references/drizzle.md +62 -0
- package/package/corpus/skills/cratis-arc-tenancy-typescript/SKILL.md +24 -55
- package/package/corpus/skills/cratis-arc-tenancy-typescript/references/tenant-selection.md +49 -0
- package/package/corpus/skills/cratis-arc-testing-kotlin/SKILL.md +13 -31
- package/package/corpus/skills/cratis-arc-testing-kotlin/references/jvm-scenario-variants.md +25 -0
- package/package/corpus/skills/cratis-arc-testing-typescript/SKILL.md +24 -62
- package/package/corpus/skills/cratis-arc-testing-typescript/references/hosts-and-runners.md +51 -0
- package/package/corpus/skills/cratis-arc-validate-command/SKILL.md +4 -4
- package/package/corpus/skills/cratis-arc-validate-command/references/csharp.md +10 -12
- package/package/corpus/skills/cratis-arc-validate-command/references/elixir.md +16 -3
- package/package/corpus/skills/cratis-arc-validate-command/references/go.md +19 -2
- package/package/corpus/skills/cratis-arc-validate-command/references/java.md +20 -7
- package/package/corpus/skills/cratis-arc-validate-command/references/kotlin.md +22 -2
- package/package/corpus/skills/cratis-arc-validate-command/references/python.md +8 -2
- package/package/corpus/skills/cratis-arc-validate-command/references/typescript.md +22 -2
- package/package/corpus/skills/cratis-arc-validation-kotlin/SKILL.md +22 -248
- package/package/corpus/skills/cratis-arc-validation-kotlin/references/feature-filters.md +55 -0
- package/package/corpus/skills/cratis-arc-validation-kotlin/references/model-validation.md +72 -0
- package/package/corpus/skills/cratis-arc-validation-kotlin/references/server-validators.md +86 -0
- package/package/corpus/skills/cratis-arc-validation-typescript/SKILL.md +27 -275
- package/package/corpus/skills/cratis-arc-validation-typescript/references/models-and-queries.md +63 -0
- package/package/corpus/skills/cratis-arc-validation-typescript/references/rules-and-checks.md +46 -0
- package/package/corpus/skills/cratis-arc-validation-typescript/references/server-decisions.md +114 -0
- package/package/corpus/skills/cratis-chronicle-cli-operations/SKILL.md +15 -255
- package/package/corpus/skills/cratis-chronicle-cli-operations/references/command-effects.md +13 -6
- package/package/corpus/skills/cratis-chronicle-cli-operations/references/inspection.md +75 -0
- package/package/corpus/skills/cratis-chronicle-cli-operations/references/project-tooling.md +78 -13
- package/package/corpus/skills/cratis-chronicle-cli-operations/references/recovery-and-comparison.md +16 -14
- package/package/corpus/skills/cratis-chronicle-connect-application/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-connect-application/references/csharp.md +10 -6
- package/package/corpus/skills/cratis-chronicle-connect-application/references/elixir.md +1 -1
- package/package/corpus/skills/cratis-chronicle-constrain-append/SKILL.md +2 -2
- package/package/corpus/skills/cratis-chronicle-constrain-append/references/csharp.md +8 -8
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/SKILL.md +10 -8
- package/package/corpus/skills/cratis-chronicle-deploy-kernel/references/storage.md +8 -4
- package/package/corpus/skills/cratis-chronicle-evolve-event/SKILL.md +4 -4
- package/package/corpus/skills/cratis-chronicle-evolve-event/references/csharp.md +2 -2
- package/package/corpus/skills/cratis-chronicle-evolve-event/references/deployed-readers.md +21 -8
- package/package/corpus/skills/cratis-chronicle-evolve-event/references/elixir.md +1 -1
- package/package/corpus/skills/cratis-chronicle-inspect-observer/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-inspect-observer/references/csharp.md +5 -7
- package/package/corpus/skills/cratis-chronicle-inspect-observer/references/elixir.md +3 -3
- package/package/corpus/skills/cratis-chronicle-mcp-inspection/SKILL.md +10 -80
- package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/blocked-tools.md +2 -2
- package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/deployment.md +9 -24
- package/package/corpus/skills/cratis-chronicle-mcp-inspection/references/observational-tools.md +10 -0
- package/package/corpus/skills/cratis-chronicle-project-view/SKILL.md +2 -2
- package/package/corpus/skills/cratis-chronicle-project-view/references/csharp.md +7 -6
- package/package/corpus/skills/cratis-chronicle-project-view/references/elixir.md +2 -2
- package/package/corpus/skills/cratis-chronicle-project-view/references/go.md +6 -0
- package/package/corpus/skills/cratis-chronicle-project-view/references/java.md +6 -0
- package/package/corpus/skills/cratis-chronicle-project-view/references/kotlin.md +6 -0
- package/package/corpus/skills/cratis-chronicle-project-view/references/typescript.md +11 -5
- package/package/corpus/skills/cratis-chronicle-protect-decision/SKILL.md +2 -2
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/csharp.md +4 -4
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/elixir.md +2 -2
- package/package/corpus/skills/cratis-chronicle-protect-decision/references/go.md +3 -1
- package/package/corpus/skills/cratis-chronicle-protect-personal-data/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-protect-personal-data/references/csharp.md +1 -1
- package/package/corpus/skills/cratis-chronicle-publish-contract/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-publish-contract/references/csharp.md +51 -40
- package/package/corpus/skills/cratis-chronicle-publish-contract/references/elixir.md +1 -1
- package/package/corpus/skills/cratis-chronicle-react-to-fact/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/{occurrences.md → csharp-occurrences.md} +2 -2
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/csharp.md +5 -6
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/go.md +1 -1
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/java.md +1 -1
- package/package/corpus/skills/cratis-chronicle-react-to-fact/references/kotlin.md +1 -1
- package/package/corpus/skills/cratis-chronicle-record-event/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-record-event/references/csharp.md +21 -19
- package/package/corpus/skills/cratis-chronicle-record-event/references/elixir.md +3 -3
- package/package/corpus/skills/cratis-chronicle-record-event/references/go.md +1 -1
- package/package/corpus/skills/cratis-chronicle-record-event/references/java.md +3 -4
- package/package/corpus/skills/cratis-chronicle-record-event/references/kotlin.md +3 -4
- package/package/corpus/skills/cratis-chronicle-record-event/references/typescript.md +2 -2
- package/package/corpus/skills/cratis-chronicle-reduce-state/SKILL.md +1 -1
- package/package/corpus/skills/cratis-chronicle-reduce-state/references/csharp.md +7 -2
- package/package/corpus/skills/cratis-chronicle-reduce-state/references/typescript.md +1 -1
- package/package/corpus/skills/cratis-chronicle-select-client/SKILL.md +4 -4
- package/package/corpus/skills/cratis-chronicle-select-client/references/csharp.md +3 -3
- package/package/corpus/skills/cratis-chronicle-select-client/references/elixir.md +2 -6
- package/package/corpus/skills/cratis-chronicle-select-client/references/go.md +2 -2
- package/package/corpus/skills/cratis-chronicle-select-client/references/java.md +1 -1
- package/package/corpus/skills/cratis-chronicle-select-client/references/kotlin.md +1 -5
- package/package/corpus/skills/cratis-chronicle-select-client/references/python.md +3 -3
- package/package/corpus/skills/cratis-chronicle-select-client/references/typescript.md +2 -2
- package/package/corpus/skills/cratis-chronicle-web-workbench/SKILL.md +12 -201
- package/package/corpus/skills/cratis-chronicle-web-workbench/references/hosting.md +67 -0
- package/package/corpus/skills/cratis-chronicle-web-workbench/references/operations.md +88 -0
- package/package/corpus/skills/cratis-ci-pipeline-performance/SKILL.md +8 -4
- package/package/corpus/skills/cratis-ci-pipeline-performance/references/build-once-and-shard.md +13 -11
- package/package/corpus/skills/cratis-ci-pipeline-performance/references/caching.md +2 -2
- package/package/corpus/skills/cratis-ci-pipeline-performance/references/flaky-and-hung-jobs.md +6 -4
- package/package/corpus/skills/cratis-ci-pipeline-performance/references/required-checks-and-path-filters.md +20 -61
- package/package/corpus/skills/cratis-ci-pipeline-performance/references/security-and-pinning.md +1 -1
- package/package/corpus/skills/cratis-cli-terminal-workbench/SKILL.md +15 -26
- package/package/corpus/skills/cratis-code-review/SKILL.md +7 -6
- package/package/corpus/skills/cratis-commits-and-pull-requests/SKILL.md +1 -1
- package/package/corpus/skills/cratis-commits-and-pull-requests/references/pr-description.md +1 -1
- package/package/corpus/skills/cratis-components-accessibility/SKILL.md +14 -206
- package/package/corpus/skills/cratis-components-accessibility/references/control-labels.md +29 -0
- package/package/corpus/skills/cratis-components-accessibility/references/focus-and-announcements.md +8 -0
- package/package/corpus/skills/cratis-components-build-canvas/SKILL.md +7 -7
- package/package/corpus/skills/cratis-components-build-canvas/references/pixi-items.md +1 -1
- package/package/corpus/skills/cratis-components-choose-control/SKILL.md +7 -8
- package/package/corpus/skills/cratis-components-choose-control/references/collections.md +2 -2
- package/package/corpus/skills/cratis-components-choose-control/references/inputs.md +1 -1
- package/package/corpus/skills/cratis-components-compose-toolbar/SKILL.md +22 -27
- package/package/corpus/skills/cratis-components-compose-toolbar/references/contributed-tools.md +5 -0
- package/package/corpus/skills/cratis-components-coordinate-feedback/SKILL.md +19 -25
- package/package/corpus/skills/cratis-components-display-list/SKILL.md +26 -19
- package/package/corpus/skills/cratis-components-display-list/references/server-query.md +3 -3
- package/package/corpus/skills/cratis-components-edit-schema-data/SKILL.md +15 -12
- package/package/corpus/skills/cratis-components-edit-schema-data/references/controlled-editor.md +3 -3
- package/package/corpus/skills/cratis-components-explore-data/SKILL.md +7 -7
- package/package/corpus/skills/cratis-components-host-chat/SKILL.md +7 -7
- package/package/corpus/skills/cratis-components-submit-form/SKILL.md +9 -15
- package/package/corpus/skills/cratis-components-submit-form/references/confirmation.md +5 -5
- package/package/corpus/skills/cratis-components-submit-form/references/wizard.md +3 -3
- package/package/corpus/skills/cratis-components-theme-application/SKILL.md +7 -51
- package/package/corpus/skills/cratis-components-theme-application/references/palette.md +49 -0
- package/package/corpus/skills/cratis-components-theme-application/references/renderer-adapters.md +4 -2
- package/package/corpus/skills/cratis-content-length/SKILL.md +34 -46
- package/package/corpus/skills/cratis-content-length/references/length-evidence.md +26 -127
- package/package/corpus/skills/cratis-developer-marketing/SKILL.md +15 -27
- package/package/corpus/skills/cratis-developer-marketing/references/measurement.md +3 -19
- package/package/corpus/skills/cratis-developer-marketing/references/playbook-evidence.md +29 -224
- package/package/corpus/skills/cratis-discoverability/SKILL.md +11 -4
- package/package/corpus/skills/cratis-discoverability/references/package-metadata.md +2 -2
- package/package/corpus/skills/cratis-documentation-writing/SKILL.md +4 -3
- package/package/corpus/skills/cratis-engineering-ci-gates/SKILL.md +13 -129
- package/package/corpus/skills/cratis-engineering-ci-gates/references/gate-operation.md +132 -0
- package/package/corpus/skills/cratis-engineering-consolidation-guard/SKILL.md +11 -100
- package/package/corpus/skills/cratis-engineering-consolidation-guard/references/ci-required-check.md +55 -40
- package/package/corpus/skills/cratis-engineering-consolidation-guard/references/source-verification.md +68 -0
- package/package/corpus/skills/cratis-engineering-consolidation-guard/references/verification-details.md +38 -0
- package/package/corpus/skills/cratis-engineering-csharp-conventions/SKILL.md +14 -65
- package/package/corpus/skills/cratis-engineering-csharp-conventions/references/exceptions-logging-and-di.md +40 -174
- package/package/corpus/skills/cratis-engineering-decision-record/SKILL.md +8 -52
- package/package/corpus/skills/cratis-engineering-decision-record/references/decision-pitfalls.md +29 -0
- package/package/corpus/skills/cratis-engineering-decision-record/references/decision-scope.md +20 -0
- package/package/corpus/skills/cratis-engineering-decision-record/references/record-format.md +3 -4
- package/package/corpus/skills/cratis-engineering-docs-authoring/SKILL.md +7 -12
- package/package/corpus/skills/cratis-engineering-docs-authoring/references/site-format.md +5 -4
- package/package/corpus/skills/cratis-engineering-effect-boundaries/SKILL.md +6 -40
- package/package/corpus/skills/cratis-engineering-effect-boundaries/references/failure-archetypes.md +18 -151
- package/package/corpus/skills/cratis-engineering-inherited-work/SKILL.md +5 -21
- package/package/corpus/skills/cratis-engineering-inherited-work/references/continue-inherited-work.md +19 -0
- package/package/corpus/skills/cratis-engineering-issue-design-note/SKILL.md +3 -66
- package/package/corpus/skills/cratis-engineering-issue-design-note/references/design-note-format.md +68 -0
- package/package/corpus/skills/cratis-engineering-issue-hygiene/SKILL.md +2 -84
- package/package/corpus/skills/cratis-engineering-issue-hygiene/references/issue-disposition.md +87 -0
- package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/SKILL.md +15 -263
- package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/dependency-map.md +3 -3
- package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/docker-images.md +28 -6
- package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/dotnet-nuget.md +18 -14
- package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/helper-runbook.md +231 -0
- package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/other-environments.md +2 -3
- package/package/corpus/skills/cratis-engineering-local-cross-repo-verification/references/worked-examples.md +62 -77
- package/package/corpus/skills/cratis-engineering-post-mortem/SKILL.md +6 -39
- package/package/corpus/skills/cratis-engineering-post-mortem/references/proportionate-follow-up.md +36 -0
- package/package/corpus/skills/cratis-engineering-regression-cluster/SKILL.md +4 -4
- package/package/corpus/skills/cratis-engineering-release-trains/SKILL.md +8 -134
- package/package/corpus/skills/cratis-engineering-release-trains/references/candidate-assembly.md +139 -0
- package/package/corpus/skills/cratis-engineering-review-rounds/SKILL.md +3 -100
- package/package/corpus/skills/cratis-engineering-review-rounds/references/round-handoffs.md +109 -0
- package/package/corpus/skills/cratis-environments-and-secrets/SKILL.md +1 -5
- package/package/corpus/skills/cratis-environments-and-secrets/references/environment-file.md +1 -3
- package/package/corpus/skills/cratis-event-model-diagram/SKILL.md +11 -116
- package/package/corpus/skills/cratis-event-model-diagram/references/frame-patterns.md +93 -0
- package/package/corpus/skills/cratis-fundamentals-concept-go/SKILL.md +4 -15
- package/package/corpus/skills/cratis-fundamentals-name-value/SKILL.md +8 -8
- package/package/corpus/skills/cratis-fundamentals-name-value/references/csharp.md +4 -4
- package/package/corpus/skills/cratis-fundamentals-name-value/references/elixir.md +1 -1
- package/package/corpus/skills/cratis-fundamentals-name-value/references/go.md +1 -1
- package/package/corpus/skills/cratis-fundamentals-name-value/references/java.md +5 -5
- package/package/corpus/skills/cratis-fundamentals-name-value/references/kotlin.md +15 -2
- package/package/corpus/skills/cratis-fundamentals-name-value/references/python.md +1 -1
- package/package/corpus/skills/cratis-fundamentals-name-value/references/typescript.md +1 -1
- package/package/corpus/skills/cratis-fundamentals-telemetry/SKILL.md +10 -27
- package/package/corpus/skills/cratis-fundamentals-telemetry/references/otlp-export.md +16 -0
- package/package/corpus/skills/cratis-fundamentals-type-discovery/SKILL.md +26 -188
- package/package/corpus/skills/cratis-fundamentals-type-discovery/references/diagnostics.md +14 -0
- package/package/corpus/skills/cratis-governed-release-methodology/SKILL.md +7 -5
- package/package/corpus/skills/cratis-lens-browser-extension/SKILL.md +23 -157
- package/package/corpus/skills/cratis-lens-browser-extension/references/troubleshooting.md +139 -0
- package/package/corpus/skills/cratis-llm-friendly-documentation/SKILL.md +7 -5
- package/package/corpus/skills/cratis-modeling-design-event-model/SKILL.md +2 -4
- package/package/corpus/skills/cratis-modeling-design-event-model/references/model-first.md +7 -0
- package/package/corpus/skills/cratis-modeling-discover-timeline/SKILL.md +2 -2
- package/package/corpus/skills/cratis-modeling-discover-timeline/references/group-and-document-intake.md +1 -1
- package/package/corpus/skills/cratis-modeling-review-event-model/SKILL.md +2 -2
- package/package/corpus/skills/cratis-modeling-review-event-model/references/implementation-findings.md +2 -2
- package/package/corpus/skills/cratis-modeling-trace-existing-behavior/SKILL.md +5 -23
- package/package/corpus/skills/cratis-modeling-trace-existing-behavior/references/compare-evidence.md +20 -0
- package/package/corpus/skills/cratis-modeling-trace-existing-behavior/references/recovery-inputs.md +3 -3
- package/package/corpus/skills/cratis-multi-service-local-orchestration/SKILL.md +8 -63
- package/package/corpus/skills/cratis-multi-service-local-orchestration/references/aspire.md +52 -0
- package/package/corpus/skills/cratis-observability/SKILL.md +1 -1
- package/package/corpus/skills/cratis-observability/references/arc-and-chronicle-signals.md +9 -23
- package/package/corpus/skills/cratis-observability/references/chronicle-kernel-export.md +3 -14
- package/package/corpus/skills/cratis-observability/references/csharp.md +4 -6
- package/package/corpus/skills/cratis-observability/references/elixir.md +1 -1
- package/package/corpus/skills/cratis-observability/references/troubleshooting.md +4 -5
- package/package/corpus/skills/cratis-onboarding-runtime/SKILL.md +1 -4
- package/package/corpus/skills/cratis-onboarding-runtime/references/default-offering.md +0 -3
- package/package/corpus/skills/cratis-onboarding-runtime/references/sign-up-review.md +0 -4
- package/package/corpus/skills/cratis-orchestration-lanes/SKILL.md +7 -49
- package/package/corpus/skills/cratis-orchestration-lanes/references/escalation.md +22 -0
- package/package/corpus/skills/cratis-orchestration-lanes/references/inbox-and-handover.md +4 -4
- package/package/corpus/skills/cratis-orchestration-lanes/references/placeholders.md +1 -1
- package/package/corpus/skills/cratis-orchestration-lanes/references/roles.md +12 -0
- package/package/corpus/skills/cratis-orchestration-lanes/references/roll-call.md +12 -0
- package/package/corpus/skills/cratis-orchestration-lanes/references/worktrees.md +11 -0
- package/package/corpus/skills/cratis-orchestration-merge-gates/SKILL.md +14 -13
- package/package/corpus/skills/cratis-orchestration-merge-gates/references/merge-queue.md +51 -26
- package/package/corpus/skills/cratis-orchestration-merge-gates/references/unattended-guards.md +8 -14
- package/package/corpus/skills/cratis-orleans-jobs/SKILL.md +9 -65
- package/package/corpus/skills/cratis-orleans-jobs/references/activation-callbacks.md +5 -0
- package/package/corpus/skills/cratis-orleans-jobs/references/lifecycle-and-placement.md +11 -7
- package/package/corpus/skills/cratis-orleans-jobs/references/state-machines.md +1 -1
- package/package/corpus/skills/cratis-orleans-jobs/references/step-planning.md +27 -0
- package/package/corpus/skills/cratis-orleans-jobs/references/storage-and-options.md +35 -0
- package/package/corpus/skills/cratis-performance-review/SKILL.md +6 -76
- package/package/corpus/skills/cratis-performance-review/references/review-checklist.md +79 -0
- package/package/corpus/skills/cratis-platform-configure-environment/SKILL.md +19 -16
- package/package/corpus/skills/cratis-platform-contribute-change/SKILL.md +2 -2
- package/package/corpus/skills/cratis-platform-deliver-slice/SKILL.md +5 -5
- package/package/corpus/skills/cratis-platform-deliver-slice/references/coordinate-slices.md +1 -1
- package/package/corpus/skills/cratis-platform-diagnose-slice/SKILL.md +2 -3
- package/package/corpus/skills/cratis-platform-prepare-release-pr/SKILL.md +2 -2
- package/package/corpus/skills/cratis-platform-start-application/SKILL.md +10 -8
- package/package/corpus/skills/cratis-platform-start-application/references/csharp.md +6 -6
- package/package/corpus/skills/cratis-platform-start-application/references/java.md +4 -4
- package/package/corpus/skills/cratis-platform-start-application/references/kotlin.md +4 -4
- package/package/corpus/skills/cratis-platform-verify-service-handoff/SKILL.md +3 -3
- package/package/corpus/skills/cratis-release-notes/SKILL.md +9 -133
- package/package/corpus/skills/cratis-release-notes/references/channel-guidance.md +59 -0
- package/package/corpus/skills/cratis-release-notes/references/publish-repair.md +64 -0
- package/package/corpus/skills/cratis-rtk/SKILL.md +12 -18
- package/package/corpus/skills/cratis-screenplay-accept-model/SKILL.md +3 -3
- package/package/corpus/skills/cratis-screenplay-accept-model/references/capability-consumption.md +1 -1
- package/package/corpus/skills/cratis-screenplay-accept-model/references/coverage-obligations.md +1 -1
- package/package/corpus/skills/cratis-screenplay-authentication-and-onboarding/SKILL.md +25 -59
- package/package/corpus/skills/cratis-screenplay-authentication-and-onboarding/references/onboarding-directives.md +11 -10
- package/package/corpus/skills/cratis-screenplay-author-extension/SKILL.md +9 -6
- package/package/corpus/skills/cratis-screenplay-author-extension/references/consume.md +3 -3
- package/package/corpus/skills/cratis-screenplay-author-extension/references/stage-candidate.md +8 -0
- package/package/corpus/skills/cratis-screenplay-availability/SKILL.md +20 -167
- package/package/corpus/skills/cratis-screenplay-availability/references/complete-example.md +23 -47
- package/package/corpus/skills/cratis-screenplay-availability/references/review-checks.md +9 -10
- package/package/corpus/skills/cratis-screenplay-availability/references/runtime-ownership.md +26 -23
- package/package/corpus/skills/cratis-screenplay-declare-slice/SKILL.md +6 -14
- package/package/corpus/skills/cratis-screenplay-declare-slice/references/projection-replay.md +2 -2
- package/package/corpus/skills/cratis-screenplay-declare-slice/references/read-identity.md +1 -1
- package/package/corpus/skills/cratis-screenplay-edit-workspace/SKILL.md +7 -9
- package/package/corpus/skills/cratis-screenplay-edit-workspace/references/model-notes.md +1 -1
- package/package/corpus/skills/cratis-screenplay-handoff-slice/SKILL.md +10 -14
- package/package/corpus/skills/cratis-screenplay-model-automation/SKILL.md +1 -1
- package/package/corpus/skills/cratis-screenplay-model-automation/references/reaction-boundaries.md +1 -1
- package/package/corpus/skills/cratis-screenplay-model-interaction/SKILL.md +6 -31
- package/package/corpus/skills/cratis-screenplay-model-interaction/references/shell-and-data.md +22 -0
- package/package/corpus/skills/cratis-screenplay-model-translation/SKILL.md +5 -5
- package/package/corpus/skills/cratis-screenplay-onboard-workspace/SKILL.md +5 -5
- package/package/corpus/skills/cratis-screenplay-onboard-workspace/references/version-migration.md +4 -4
- package/package/corpus/skills/cratis-screenplay-recover-intent/SKILL.md +2 -2
- package/package/corpus/skills/cratis-screenplay-recover-intent/references/csharp.md +2 -2
- package/package/corpus/skills/cratis-screenplay-recover-intent/references/ground-truth-benchmark.md +1 -1
- package/package/corpus/skills/cratis-screenplay-specify-outcome/SKILL.md +4 -75
- package/package/corpus/skills/cratis-screenplay-specify-outcome/references/host-body-execution.md +0 -2
- package/package/corpus/skills/cratis-screenplay-specify-outcome/references/observable-result.md +85 -1
- package/package/corpus/skills/cratis-screenplay-specify-outcome/references/query-rejections.md +1 -1
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/SKILL.md +15 -133
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/boundaries.md +5 -5
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/chronicle-boundaries.md +4 -12
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/consistency-and-concurrency.md +28 -57
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution-example.md +4 -5
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/evolution.md +13 -20
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/multi-service-models.md +1 -1
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/neighbouring-skills.md +1 -1
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/read-model-keys.md +3 -5
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-id-rules.md +2 -0
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/stream-patterns.md +5 -5
- package/package/corpus/skills/cratis-screenplay-streams-and-consistency/references/streams-example.md +82 -71
- package/package/corpus/skills/cratis-security-review/SKILL.md +4 -73
- package/package/corpus/skills/cratis-security-review/references/arc-boundaries.md +24 -13
- package/package/corpus/skills/cratis-security-review/references/review-checklist.md +74 -0
- package/package/corpus/skills/cratis-session-handoff/SKILL.md +7 -32
- package/package/corpus/skills/cratis-session-handoff/references/handoff-template.md +2 -2
- package/package/corpus/skills/cratis-session-handoff/references/session-hygiene.md +20 -0
- package/package/corpus/skills/cratis-showrunner-herald/SKILL.md +9 -17
- package/package/corpus/skills/cratis-showrunner-herald/references/options.md +2 -2
- package/package/corpus/skills/cratis-showrunner-herald/references/templates-and-images.md +16 -10
- package/package/corpus/skills/cratis-social-feed-post/SKILL.md +9 -162
- package/package/corpus/skills/cratis-social-feed-post/references/asset-and-formatting.md +37 -0
- package/package/corpus/skills/cratis-social-feed-post/references/editorial-checks.md +40 -0
- package/package/corpus/skills/cratis-social-feed-post/references/engagement-evidence.md +39 -150
- package/package/corpus/skills/cratis-social-feed-post/references/linkedin-media.md +24 -0
- package/package/corpus/skills/cratis-social-feed-post/references/other-channels.md +23 -0
- package/package/corpus/skills/cratis-specifications-exercise-backend/SKILL.md +5 -5
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-command-results.md +2 -2
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp-query-scenario.md +13 -5
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/csharp.md +7 -4
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/elixir.md +1 -1
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/go.md +20 -4
- package/package/corpus/skills/cratis-specifications-exercise-backend/references/typescript.md +1 -1
- package/package/corpus/skills/cratis-specifications-isolate-behavior/SKILL.md +2 -2
- package/package/corpus/skills/cratis-specifications-observe-ui/SKILL.md +5 -5
- package/package/corpus/skills/cratis-specifications-test-application-ui/SKILL.md +2 -2
- package/package/corpus/skills/cratis-specifications-test-application-ui/references/typescript-command-results.md +2 -2
- package/package/corpus/skills/cratis-specifications-test-typescript-behavior/SKILL.md +2 -2
- package/package/corpus/skills/cratis-stage-render-slice/SKILL.md +10 -9
- package/package/corpus/skills/cratis-stage-run-sandbox/SKILL.md +3 -3
- package/package/corpus/skills/cratis-stage-run-sandbox/references/semantic-spec-runner.md +7 -6
- package/package/corpus/skills/cratis-studio-mcp-safety-guidance/SKILL.md +4 -6
- package/package/corpus/skills/cratis-technical-examples/SKILL.md +10 -106
- package/package/corpus/skills/cratis-technical-examples/references/csharp-package-checks.md +1 -1
- package/package/corpus/skills/cratis-technical-examples/references/source-and-format.md +42 -0
- package/package/corpus/skills/cratis-technical-examples/references/typescript-package-checks.md +2 -2
- package/package/corpus/skills/cratis-technical-examples/references/verification-scope.md +37 -0
- package/package/corpus/skills/cratis-ux-review/SKILL.md +8 -40
- package/package/corpus/skills/cratis-ux-review/references/capture-contract.md +24 -0
- package/package/corpus/skills/cratis-ux-review/references/checklist.md +1 -1
- package/package/corpus/skills/cratis-ux-review/references/report-template.md +2 -1
- package/package/corpus/skills/cratis-writing-voice-and-cadence/SKILL.md +19 -132
- package/package/corpus/skills/cratis-writing-voice-and-cadence/references/ai-tells.md +24 -97
- package/package/corpus/skills/cratis-writing-voice-and-cadence/references/author-and-batch.md +23 -0
- package/package/corpus/skills/cratis-writing-voice-and-cadence/references/documentation-evidence.md +25 -0
- package/package/corpus/skills/cratis-writing-voice-and-cadence/references/interpretation.md +17 -0
- package/package/corpus/skills/cratis-writing-voice-and-cadence/references/stock-constructions.md +23 -0
- package/package/corpus/skills/cratis-writing-voice-and-cadence/references/voice-guidance.md +8 -29
- package/package.json +1 -1
- /package/package/corpus/skills/cratis-chronicle-protect-decision/references/{standalone.md → csharp-standalone.md} +0 -0
- /package/package/corpus/skills/cratis-engineering-post-mortem/references/{examples/silent-backup-failure.md → silent-backup-failure.md} +0 -0
- /package/package/corpus/skills/cratis-engineering-post-mortem/references/{examples/unintended-release-regression.md → unintended-release-regression.md} +0 -0
|
@@ -1,202 +1,40 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cratis-fundamentals-type-discovery
|
|
3
|
-
description: Use when a
|
|
3
|
+
description: Use when a .NET handler set, strategy set or dispatcher must discover every implementation of an abstraction. Not for choosing dependencies across application modules (use cratis-application-growth).
|
|
4
4
|
license: MIT
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# Discover implementations in .NET
|
|
8
8
|
|
|
9
|
-
`
|
|
10
|
-
cost arrives later: a new implementation in another folder does nothing until
|
|
11
|
-
someone remembers the line, a removed one leaves a registration that fails at
|
|
12
|
-
startup, and every specification setup has to mirror the composition root.
|
|
9
|
+
When a consumer needs every implementation, inject `IInstancesOf<T>` from `Cratis.Types`. Use a concrete, non-generic implementation of an interface or abstract class. Discovering a set avoids maintaining a second list in the composition root. For one chosen service, inject that service's interface instead; for a sequence returned as data, use an ordinary collection type.
|
|
13
10
|
|
|
14
|
-
`
|
|
15
|
-
|
|
11
|
+
1. Reference `Cratis.Fundamentals` in projects that contribute implementations; its NuGet package carries the discovery analyzer. Arc's `AddCratisArc()` already configures discovery and convention bindings. **Choose explicit host setup when** using a plain .NET host: call `services.AddTypeDiscovery()`, `services.AddBindingsByConvention()` and `services.AddSelfBindings()` before building the provider (`Cratis.DependencyInjection` and `Microsoft.Extensions.DependencyInjection`). A project reference to Fundamentals source doesn't bring the analyzer: see [discovery diagnostics](references/diagnostics.md) if the host can't see a contributor.
|
|
12
|
+
2. Implement the contract. Leave the lifetime unspecified for a transient; use `[Scoped]` for a scope-bound implementation or `[Singleton]` for an implementation safe to share across scopes and concurrent calls. Both attributes are in `Cratis.DependencyInjection`. Keep the consumer within a scope if it resolves scoped implementations.
|
|
13
|
+
3. Enumerate the discovered set in the operation. In this example, neither the consumer nor its implementations needs a manual registration in an Arc host:
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
```csharp
|
|
16
|
+
using System.Linq;
|
|
17
|
+
using Cratis.Types;
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
| --- | --- |
|
|
21
|
-
| `Cratis.Fundamentals` | `IInstancesOf<T>`, `IImplementationsOf<T>`, `ITypes`, convention bindings and the bundled `Cratis.Fundamentals.TypeDiscovery.Generator` |
|
|
19
|
+
namespace Reports;
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
public interface IReportSection
|
|
22
|
+
{
|
|
23
|
+
string Heading { get; }
|
|
24
|
+
}
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
public class TotalsSection : IReportSection
|
|
27
|
+
{
|
|
28
|
+
public string Heading => "Totals";
|
|
29
|
+
}
|
|
27
30
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
*injecting* implementations of an abstraction, not about returning values.
|
|
34
|
-
- You only need the **types**, never instances: inject `IImplementationsOf<T>`,
|
|
35
|
-
which enumerates `Type` rather than `T`.
|
|
31
|
+
public class ReportOutline(IInstancesOf<IReportSection> sections)
|
|
32
|
+
{
|
|
33
|
+
public string[] GetHeadings() => sections.Select(section => section.Heading).ToArray();
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
The set resolves concrete self-bindings, not `IEnumerable<T>` interface registrations. Remove old manual registrations only after checking that no other consumer needs them. Each enumeration resolves instances from the captured provider, so a singleton consumer cannot safely resolve scoped implementations. Materialize once when an operation needs to reuse the same resolved instances. Do not rely on discovery order as business precedence; apply an explicit order when it matters.
|
|
38
|
+
4. Build and exercise the behavior through the host. Assert the expected contributions, not just that iteration completed: an empty set can otherwise pass a fan-out spec. If a contribution is missing or enumeration throws, use [discovery diagnostics](references/diagnostics.md).
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
registered implementation:
|
|
41
|
-
|
|
42
|
-
- Anything plural that delegates to a set — `*Handlers`, `*Filters`,
|
|
43
|
-
`*Validators`, `*Formatters`, `*Strategies`, `*Providers`, `*Resolvers`.
|
|
44
|
-
- A dispatcher that asks each implementation `CanHandle(...)` and forwards to
|
|
45
|
-
the one that says yes.
|
|
46
|
-
- A composite that fans one input out to all implementations and aggregates.
|
|
47
|
-
|
|
48
|
-
## Step 1 — Confirm the implementations are discoverable
|
|
49
|
-
|
|
50
|
-
Discovery normally uses compile-time generated providers, not a walk of
|
|
51
|
-
`DefinedTypes`. Reflection is the fallback when no generated providers exist.
|
|
52
|
-
|
|
53
|
-
- Use concrete, non-generic implementations. Generated contract maps exclude
|
|
54
|
-
open-generic implementors. An assembly's own provider can include its internal
|
|
55
|
-
types; references emitted from another assembly require public types.
|
|
56
|
-
- `T` is an interface or abstract class (`where T : class`).
|
|
57
|
-
- Instances resolve by concrete type, so each implementation needs a self-binding.
|
|
58
|
-
`AddSelfBindings()` honors `[Singleton]`, `[Scoped]`, and `[IgnoreConvention]`;
|
|
59
|
-
it excludes static/abstract/interface/exception types, System/Microsoft
|
|
60
|
-
namespaces, and classes with primitive or record-typed constructor parameters.
|
|
61
|
-
`IFoo → Foo` bindings require matching names in the same namespace and exactly
|
|
62
|
-
one implementation; they do not replace self-bindings for a discovered set.
|
|
63
|
-
|
|
64
|
-
The host must call `services.AddTypeDiscovery()` to register `ITypes`,
|
|
65
|
-
`IInstancesOf<>`, and `IImplementationsOf<>`, plus the convention binding setup.
|
|
66
|
-
Arc's `AddCratisArc` does this; a plain host must do it.
|
|
67
|
-
No per-implementation registration is needed when self-binding applies.
|
|
68
|
-
|
|
69
|
-
The Fundamentals NuGet package carries the generator as an analyzer. A project
|
|
70
|
-
reference does **not** carry it: reference the generator explicitly, otherwise
|
|
71
|
-
only Fundamentals' own provider may contribute. A captured `ITypes` universe
|
|
72
|
-
never gains late-loaded assemblies. `AddTypeDiscovery()` reuses the default
|
|
73
|
-
universe while the provider set is unchanged; a later call rebuilds it if new
|
|
74
|
-
providers registered, without changing earlier consumers.
|
|
75
|
-
|
|
76
|
-
## Step 2 — Choose the lifetime with an attribute
|
|
77
|
-
|
|
78
|
-
```csharp
|
|
79
|
-
using Cratis.DependencyInjection;
|
|
80
|
-
|
|
81
|
-
[Singleton]
|
|
82
|
-
public class CsvReportFormatter(IClock clock) : IReportFormatter
|
|
83
|
-
{
|
|
84
|
-
public bool CanHandle(ReportRequest request) => request.Format == "csv";
|
|
85
|
-
public string Format(Report report) => /* … */;
|
|
86
|
-
}
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
⚠️ `[Singleton]` lives in **`Cratis.DependencyInjection`**, not `Cratis`. That
|
|
90
|
-
is the using directive to add when it does not resolve.
|
|
91
|
-
|
|
92
|
-
The convention reads exactly three attributes:
|
|
93
|
-
|
|
94
|
-
| Attribute | Lifetime |
|
|
95
|
-
| --- | --- |
|
|
96
|
-
| `[Singleton]` | Singleton |
|
|
97
|
-
| `[Scoped]` | Scoped |
|
|
98
|
-
| neither | **Transient** |
|
|
99
|
-
|
|
100
|
-
`[IgnoreConvention]` opts a type out of convention binding entirely.
|
|
101
|
-
|
|
102
|
-
Skip `[Singleton]` only when the implementation genuinely holds per-call state.
|
|
103
|
-
The `IFoo → Foo` convention still applies to transients — do not register them
|
|
104
|
-
explicitly either.
|
|
105
|
-
|
|
106
|
-
## Step 3 — Inject `IInstancesOf<T>` in the consumer
|
|
107
|
-
|
|
108
|
-
```csharp
|
|
109
|
-
using Cratis.DependencyInjection;
|
|
110
|
-
using Cratis.Types;
|
|
111
|
-
|
|
112
|
-
[Singleton]
|
|
113
|
-
public class ReportFormatters(IInstancesOf<IReportFormatter> formatters) : IReportFormatters
|
|
114
|
-
{
|
|
115
|
-
public bool CanHandle(ReportRequest request) =>
|
|
116
|
-
formatters.Any(formatter => formatter.CanHandle(request));
|
|
117
|
-
|
|
118
|
-
public string Format(ReportRequest request, Report report) =>
|
|
119
|
-
formatters.First(formatter => formatter.CanHandle(request)).Format(report);
|
|
120
|
-
}
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
`IInstancesOf<T>` implements `IEnumerable<T>`, so LINQ works on it directly.
|
|
124
|
-
|
|
125
|
-
**The type set is fixed at construction; instances resolve on every enumeration**
|
|
126
|
-
through the service provider captured by `InstancesOf<T>`. The consumer's scope
|
|
127
|
-
therefore matters: the singleton above is safe only when no implementation is
|
|
128
|
-
scoped. A singleton captures the root provider and would make a scoped
|
|
129
|
-
implementation captive or fail scope validation. Use a scoped or transient
|
|
130
|
-
consumer resolved inside a scope when any implementation is scoped; follow the
|
|
131
|
-
lifetime rule in `csharp.md`. Materialize with `.ToArray()` only when one operation
|
|
132
|
-
needs a stable instance snapshot.
|
|
133
|
-
|
|
134
|
-
## Step 4 — Delete the dead registrations
|
|
135
|
-
|
|
136
|
-
Find every line in a composition root or service-collection extension that
|
|
137
|
-
registered the implementations or the consumer, and remove it:
|
|
138
|
-
|
|
139
|
-
```csharp
|
|
140
|
-
// Delete — IInstancesOf<T> discovers them, [Singleton] gives them their lifetime
|
|
141
|
-
services.AddSingleton<IReportFormatter, CsvReportFormatter>();
|
|
142
|
-
services.AddSingleton<IReportFormatter, JsonReportFormatter>();
|
|
143
|
-
services.AddSingleton<IReportFormatters, ReportFormatters>();
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
Search for every remaining reference before deleting, so nothing else was
|
|
147
|
-
relying on a registration for a different reason.
|
|
148
|
-
|
|
149
|
-
## Reuse derived-type discovery
|
|
150
|
-
|
|
151
|
-
Requires Fundamentals and its generator 7.26.1 for per-universe caching plus nested-generic/experimental-type generator fixes; check `dotnet list package`, or keep the older construction path until upgrading.
|
|
152
|
-
|
|
153
|
-
Use `Cratis.Serialization.DerivedTypes.For(types)` when several service
|
|
154
|
-
collections share the same `ITypes` instance. It returns one shared `DerivedTypes`
|
|
155
|
-
per universe, held weakly; distinct universes stay isolated. Do not construct one
|
|
156
|
-
per scope or replace a host's explicit universe with `DerivedTypes.Instance`.
|
|
157
|
-
|
|
158
|
-
The generator omits nested open-generic types from referenced Cratis packages
|
|
159
|
-
and handles referenced `[Experimental]` diagnostic IDs. Upgrade the generator
|
|
160
|
-
rather than editing its output to bypass those build failures.
|
|
161
|
-
|
|
162
|
-
## What breaks
|
|
163
|
-
|
|
164
|
-
- **`[Singleton]` does not resolve.** The using directive is
|
|
165
|
-
`Cratis.DependencyInjection`, not `Cratis`.
|
|
166
|
-
- **An implementation is silently absent from the set.** Its assembly did not
|
|
167
|
-
contribute a generated provider before the universe was built, or its type is
|
|
168
|
-
abstract, generic, or inaccessible to the emitted provider. Inspect
|
|
169
|
-
`ITypes.DiscoveryMode` (`Unknown`, `Generated`, `Reflected`, or `Explicit`) and
|
|
170
|
-
`ITypes.Assemblies`; ask `TypeDiscoveryDiagnostics.FindMissingContributors(types)`
|
|
171
|
-
for referenced assembly names that did not contribute (it loads nothing and
|
|
172
|
-
may also report libraries with no discoverable types). The reflection fallback
|
|
173
|
-
includes package assemblies by prefix: `Cratis` by default, configurable through
|
|
174
|
-
`PackageReferencedAssemblies.Instance.AddAssemblyPrefixesToInclude(...)` before
|
|
175
|
-
discovery.
|
|
176
|
-
- **Discovery dependencies cannot resolve.** The plain host omitted
|
|
177
|
-
`services.AddTypeDiscovery()`.
|
|
178
|
-
- **Enumeration yields null.** The concrete type was discovered but not registered
|
|
179
|
-
as itself, for example because `[IgnoreConvention]` or a self-binding exclusion
|
|
180
|
-
skipped it. `InstancesOf<T>` uses `GetService(type)`, not `GetRequiredService`.
|
|
181
|
-
- **An implementation is a new instance every time it is touched.** It has no
|
|
182
|
-
lifetime attribute, so the convention made it transient. That is correct
|
|
183
|
-
behavior for the convention and usually the wrong intent — add `[Singleton]`.
|
|
184
|
-
- **A stale registration fails at startup.** A hand-written
|
|
185
|
-
`AddSingleton<TInterface, Impl>()` survived a type being removed. Step 4 is
|
|
186
|
-
what prevents it.
|
|
187
|
-
- **Injecting `IEnumerable<T>` seems to work and returns nothing.** That
|
|
188
|
-
signature only sees hand-registered implementations. It is the failure mode
|
|
189
|
-
this skill exists to remove — it fails silently and empty, not loudly.
|
|
190
|
-
|
|
191
|
-
## How it is proven
|
|
192
|
-
|
|
193
|
-
`dotnet build` — zero warnings, zero errors — then run the specifications for
|
|
194
|
-
the affected behavior. The non-vacuity check matters here: assert the **count**
|
|
195
|
-
of discovered implementations, not just that iterating them threw nothing. A
|
|
196
|
-
fan-out over an empty set passes every assertion that only says "nothing went
|
|
197
|
-
wrong".
|
|
198
|
-
|
|
199
|
-
Assert the expected `ITypes.DiscoveryMode` and contributing assembly names too.
|
|
200
|
-
For startup diagnostics, collect EventSource `Cratis.Fundamentals.TypeDiscovery`
|
|
201
|
-
with `dotnet-trace`: it reports universe construction and warns when only
|
|
202
|
-
Fundamentals contributed.
|
|
40
|
+
**Choose `IImplementationsOf<T>` when** the consumer needs only type metadata. It enumerates `Type` without constructing the implementations, so concrete self-bindings aren't needed for that enumeration.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Diagnose a discovery or binding gap
|
|
2
|
+
|
|
3
|
+
## Missing type versus missing registration
|
|
4
|
+
|
|
5
|
+
- **Missing from the discovered set:** inspect `ITypes.DiscoveryMode` (`Unknown`, `Generated`, `Reflected`, or `Explicit`) and `ITypes.Assemblies`. The normal path uses generated providers; reflection is a fallback when no providers are available. Generated contract maps exclude open generic implementations. An assembly can contribute internal types through its own provider; providers emitted by another assembly can reference only accessible types. With a project reference to Fundamentals source, reference the generator as an analyzer in the contributing project instead of editing generated code.
|
|
6
|
+
- **Missing assembly:** `TypeDiscoveryDiagnostics.FindMissingContributors(types)` reports referenced assembly names that did not contribute. It doesn't load assemblies and can name libraries that have nothing to discover. For reflected discovery, set any extra package prefixes with `PackageReferencedAssemblies.Instance.AddAssemblyPrefixesToInclude(...)` before building the universe; `Cratis` is included by default. For startup diagnostics, collect the `Cratis.Fundamentals.TypeDiscovery` EventSource with `dotnet-trace`. In a discovery diagnostic test, assert the expected mode and contributing assemblies.
|
|
7
|
+
- **Type was found but enumeration throws:** `IInstancesOf<T>` resolves each discovered concrete type with `GetRequiredService`. Check the concrete self-registration and its dependencies. `[IgnoreConvention]` opts out of convention binding, not discovery. Automatic self-binding can skip types such as exceptions or types with primitive or record constructor parameters. When an intentionally excluded implementation still belongs in the set, explicitly bind its concrete type at the appropriate lifetime before convention setup. An interface-only registration won't satisfy the lookup.
|
|
8
|
+
- **An injected `IEnumerable<T>` is empty:** that collection sees only registrations for `T`, not the discovery set. The single-implementation convention binds `IFoo` to `Foo` when they share a namespace and there is only one eligible implementation; it is not a substitute for a self-binding for each discovered implementation.
|
|
9
|
+
|
|
10
|
+
## Multiple hosts or serializer composition
|
|
11
|
+
|
|
12
|
+
An existing `ITypes` snapshot does not gain late-loaded providers. A later default `AddTypeDiscovery()` call reuses the universe if the generated provider set is unchanged, or creates a new one if the set changed. Check the universe resolved by the host you are testing.
|
|
13
|
+
|
|
14
|
+
When composing serializers against an existing universe, use `Cratis.Serialization.DerivedTypes.For(types)`. It shares the derived-type registry per `ITypes` instance; separate universes keep separate registries. Do not replace a host's explicit universe with `DerivedTypes.Instance`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cratis-governed-release-methodology
|
|
3
|
-
description: Use when planning release assurance, support claims, promotion and recovery, or deciding whether supply-chain evidence is warranted. Not for
|
|
3
|
+
description: Use when planning release assurance, support claims, promotion and recovery, or deciding whether supply-chain evidence is warranted. Not for preparing a platform release PR (use cratis-platform-prepare-release-pr).
|
|
4
4
|
license: MIT
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -17,6 +17,9 @@ pushing container images, and one whose whole delivery is a merge to `main`. It
|
|
|
17
17
|
grants no release authority of its own: it tells you what a claim costs, not
|
|
18
18
|
that you may make it.
|
|
19
19
|
|
|
20
|
+
This skill sets the assurance and recovery plan, not product implementation,
|
|
21
|
+
publish-command syntax, or credential provisioning.
|
|
22
|
+
|
|
20
23
|
## Start with the artifact, not the process
|
|
21
24
|
|
|
22
25
|
The single most expensive mistake is applying package-release ceremony to
|
|
@@ -94,10 +97,9 @@ Two rules keep the ladder honest:
|
|
|
94
97
|
or mocked host proves the pipeline, never the host. Classify every observation
|
|
95
98
|
as synthetic, local, hosted, or real-consumer, and never let a synthetic
|
|
96
99
|
observation satisfy an execution requirement.
|
|
97
|
-
- **A missing or version-mismatched host is a blocked outcome, not a skip.**
|
|
98
|
-
the canary
|
|
99
|
-
|
|
100
|
-
one, because it retires the question.
|
|
100
|
+
- **A missing or version-mismatched host is a blocked outcome, not a skip.**
|
|
101
|
+
Record what the canary required and what was available. A skipped phase
|
|
102
|
+
supplies no execution evidence.
|
|
101
103
|
|
|
102
104
|
## The lifecycle phases a real install cycle must cover
|
|
103
105
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cratis-lens-browser-extension
|
|
3
|
-
description: Use when setting up Lens for a development Arc application, diagnosing app detection or checking switched identities and tenants. Not for
|
|
3
|
+
description: Use when setting up Lens for a development Arc application, diagnosing app detection or checking switched identities and tenants. Not for designing access rules for Arc endpoints (use cratis-arc-authorize-request).
|
|
4
4
|
license: MIT
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -10,17 +10,12 @@ Screenplay `user` declarations are development identities Stage can offer to Len
|
|
|
10
10
|
|
|
11
11
|
Lens is a Manifest V3 browser extension that impersonates a user and a tenant
|
|
12
12
|
against an Arc application you are developing, and executes that application's
|
|
13
|
-
commands and queries from a popup.
|
|
14
|
-
rewrites request headers
|
|
15
|
-
|
|
13
|
+
commands and queries from a popup. Lens needs no application code changes: it
|
|
14
|
+
rewrites request headers and reads Arc's introspection endpoints. Running a
|
|
15
|
+
command from the popup sends a real request and can change application state.
|
|
16
|
+
Use disposable fixtures and verify the target before running a command.
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
the developer points it at. Nothing in it is production tooling.
|
|
19
|
-
|
|
20
|
-
⚠️ **There is no published store listing.** Nothing in the Lens repository links
|
|
21
|
-
a Chrome Web Store, Edge Add-ons, AMO, or App Store entry — the only store URLs
|
|
22
|
-
present are developer-console links inside its own publishing guide. Building
|
|
23
|
-
from source and loading unpacked is the only install path that exists.
|
|
18
|
+
Use an unpacked build in a dedicated development browser profile.
|
|
24
19
|
|
|
25
20
|
## Safety
|
|
26
21
|
|
|
@@ -38,6 +33,8 @@ inject into any page.
|
|
|
38
33
|
|
|
39
34
|
## Install
|
|
40
35
|
|
|
36
|
+
Use the Node.js version selected by Lens’s build workflow, Yarn, and Chromium.
|
|
37
|
+
|
|
41
38
|
```bash
|
|
42
39
|
cd Source
|
|
43
40
|
yarn install
|
|
@@ -46,20 +43,16 @@ yarn build # writes the unpacked extension to Source/dist/
|
|
|
46
43
|
|
|
47
44
|
Then open `chrome://extensions`, enable **Developer mode**, choose **Load
|
|
48
45
|
unpacked**, and select `Source/dist`. Chrome lists it as **Cratis Lens** — the
|
|
49
|
-
name in
|
|
50
|
-
Developer Tools", which is stale.
|
|
46
|
+
name in its manifest.
|
|
51
47
|
|
|
52
48
|
`yarn dev` is `vite build --watch`; the extension still has to be reloaded in
|
|
53
49
|
Chrome after each rebuild. `yarn ci` runs `typecheck`, `test` and `build` — the
|
|
54
50
|
same three the pull-request workflow runs. There is no lint script.
|
|
55
51
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
is still **Cratis Lens**. the script instead zips to `lens-extension.zip`.
|
|
52
|
+
If you need a local ZIP rather than an unpacked build, run `yarn build-package`
|
|
53
|
+
from `Source`; it writes `lens-extension.zip` at the repository root.
|
|
59
54
|
|
|
60
|
-
|
|
61
|
-
workflow also packages for Edge, Firefox and Safari, but no cross-browser
|
|
62
|
-
behavior is tested; treat Chromium as the supported target.
|
|
55
|
+
Use Chromium for development; release packaging for other browsers does not establish runtime support.
|
|
63
56
|
|
|
64
57
|
## What the Arc application must already provide
|
|
65
58
|
|
|
@@ -78,15 +71,6 @@ strips client-supplied identity headers.
|
|
|
78
71
|
| `GET /.cratis/tenants` | every `ICanProvideTenants`, identity discovery policy | The importable tenant list |
|
|
79
72
|
| `GET /.cratis/identity-details/schema` | the identity endpoint mapper | The schema-driven editor for a user's `identityDetails` |
|
|
80
73
|
|
|
81
|
-
Requires Arc 22.45.0 for discovery to be anonymous by default **only in Development**; older versions serve it anonymously everywhere.
|
|
82
|
-
|
|
83
|
-
Discovery is anonymous by default **only in Development**.
|
|
84
|
-
Against a deployed host Lens needs the user signed in; hosts unable to authenticate
|
|
85
|
-
omit those routes (404). `Introspection.Enabled` controls catalogs and
|
|
86
|
-
`IdentityDiscovery` the roster/tenant/schema routes. Forwarded identity switching
|
|
87
|
-
also needs the explicit host-wide `TrustForwardedIdentityHeaders` opt-in, only
|
|
88
|
-
behind a header-stripping ingress.
|
|
89
|
-
|
|
90
74
|
`MapIntrospectionEndpoints` runs during Arc activation, subject to these settings. The user and tenant
|
|
91
75
|
routes return whatever the application implements — with **no implementation
|
|
92
76
|
registered they return an empty list**, and Lens treats a `404` on either as
|
|
@@ -100,138 +84,20 @@ the host cannot enforce it. `Cratis:Arc:Introspection` options `Enabled` and
|
|
|
100
84
|
access. Register development user/tenant providers with fixtures, not production
|
|
101
85
|
rosters.
|
|
102
86
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
Lens sends exactly three forwarded client-principal headers. Arc ignores them
|
|
106
|
-
and treats the request as anonymous unless
|
|
107
|
-
`Cratis:Arc:TrustForwardedIdentityHeaders=true`; a default Arc app therefore
|
|
108
|
-
does not honor Lens identity switching:
|
|
109
|
-
|
|
110
|
-
```text
|
|
111
|
-
X-MS-CLIENT-PRINCIPAL-ID
|
|
112
|
-
X-MS-CLIENT-PRINCIPAL-NAME
|
|
113
|
-
X-MS-CLIENT-PRINCIPAL # base64 of the principal JSON
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
The principal document it base64-encodes is
|
|
117
|
-
`{ identityProvider, userId, userDetails, userRoles, claims: [{ typ, val }], … }`
|
|
118
|
-
with the user's `identityDetails` and `applicationProperties` spread over it.
|
|
119
|
-
`identityProvider` defaults to `aad` and `userRoles` falls back to
|
|
120
|
-
`["authenticated", "anonymous"]` when the user has no roles.
|
|
121
|
-
|
|
122
|
-
⚠️ That is Lens's **only** identity mode. There is no bearer token, no OIDC, no
|
|
123
|
-
sign-in. The application has to be running on the Microsoft-Identity-Platform
|
|
124
|
-
forwarded-header path, and the reverse proxy in front of it in production must
|
|
125
|
-
be the only thing that can set those headers.
|
|
126
|
-
|
|
127
|
-
### Tenancy
|
|
128
|
-
|
|
129
|
-
Lens sets one header, named by its `tenantHeaderName` setting, whose default is
|
|
130
|
-
`x-cratis-tenant-id`. That matches `TenancyOptions.HttpHeader`'s default, and
|
|
131
|
-
`TenantResolverType.Header` is Arc's default resolver — so a default Arc
|
|
132
|
-
application needs no change.
|
|
133
|
-
|
|
134
|
-
⚠️ **`tenantHeaderName` has no user interface.** It is a stored setting with a
|
|
135
|
-
default and nothing binds it to an input. An application that resolves tenancy
|
|
136
|
-
by query parameter, claim, subdomain, or a renamed header **cannot be driven by
|
|
137
|
-
Lens** without editing `chrome.storage.local` by hand. Guidance describing
|
|
138
|
-
a "Tenant Header Name" field on an options page is describing something that
|
|
139
|
-
does not exist — there is no `options_page` in the manifest at all.
|
|
140
|
-
|
|
141
|
-
### The frontend
|
|
142
|
-
|
|
143
|
-
Detection is not header-level and is not invisible. Lens injects a function into
|
|
144
|
-
the page's main world and looks for:
|
|
145
|
-
|
|
146
|
-
1. an element with `id="root"`;
|
|
147
|
-
2. a React fiber or container key on it (`__reactFiber…` / `__reactContainer…`);
|
|
148
|
-
3. a context value on the fiber tree carrying either a `reconnectQueries`
|
|
149
|
-
property, or a `configuration` object with one of `baseUrl`, `apiBaseUrl`,
|
|
150
|
-
`apiSurface`, `apiSurfaceBaseUrl`, `baseUri` or `baseAddress`.
|
|
151
|
-
|
|
152
|
-
If that fails it falls back to matching the path
|
|
153
|
-
`/projects/{guid}/application/{guid}`, and otherwise to the host being
|
|
154
|
-
`localhost` or `127.0.0.1`.
|
|
155
|
-
|
|
156
|
-
⚠️ A non-React frontend, a root element with another id, or a React version that
|
|
157
|
-
renames its internal fiber keys leaves Lens undetected — the Commands, Queries
|
|
158
|
-
and Query Diagnostics tabs are then **disabled**, and only Context and Settings
|
|
159
|
-
work. The detected base URL is also what the Commands and Queries tabs call, so
|
|
160
|
-
without detection there is nothing to call.
|
|
161
|
-
|
|
162
|
-
## Switch the active user or tenant
|
|
163
|
-
|
|
164
|
-
Pick both on the **Context** tab. Two things then happen, in this order:
|
|
165
|
-
|
|
166
|
-
1. The service worker rebuilds its `declarativeNetRequest` **dynamic** rules —
|
|
167
|
-
at most two, one for the identity headers and one for the tenant header.
|
|
168
|
-
2. It deletes the Arc identity cookie `.cratis-identity` on the detected base URL
|
|
169
|
-
and page origins, then reloads every open tab on those origins.
|
|
170
|
-
|
|
171
|
-
The backend neither reads nor writes that legacy identity
|
|
172
|
-
cookie. Lens still deletes it for older hosts; reloading clears the frontend's
|
|
173
|
-
in-memory identity and asks `/.cratis/me` again. Header-based switching requires
|
|
174
|
-
the host-wide trust opt-in and a suitable development/ingress boundary; the
|
|
175
|
-
extension cannot turn unsigned headers into authenticated credentials.
|
|
176
|
-
|
|
177
|
-
The rules are scoped, deliberately. When a page origin is known the condition is
|
|
178
|
-
`{ urlFilter: '*', initiatorDomains: [<page host>] }`; otherwise it is
|
|
179
|
-
`||<base URL host>`. **With neither resolvable, no rules are installed at all** —
|
|
180
|
-
`host_permissions` is `<all_urls>`, so a wildcard filter would attach
|
|
181
|
-
impersonation headers to every XHR on every site the developer browses.
|
|
182
|
-
|
|
183
|
-
⚠️ The rules match `XMLHTTPREQUEST` **only**. Document navigations, WebSocket
|
|
184
|
-
connections and EventSource/SSE streams carry no injected headers. Arc's
|
|
185
|
-
observable-query transports (`/.cratis/queries/ws`, `/.cratis/queries/sse`) are
|
|
186
|
-
therefore **not** covered by header injection.
|
|
187
|
-
|
|
188
|
-
## Execute a command or query
|
|
189
|
-
|
|
190
|
-
The Commands and Queries tabs read the introspection lists and group them into a
|
|
191
|
-
tree by splitting the namespace on `.`.
|
|
192
|
-
|
|
193
|
-
A command is always `POST <base URL><route>` with `Content-Type: application/json`
|
|
194
|
-
and the active context headers, and a body built by the schema-driven editor. A
|
|
195
|
-
query is always `GET`, with `{name}` segments in the route substituted from the
|
|
196
|
-
path-parameter inputs and the same context headers.
|
|
197
|
-
|
|
198
|
-
⚠️ **The schema-driven payload form does not receive a schema from
|
|
199
|
-
Arc.** Lens reads an optional property named `schema` off each introspection
|
|
200
|
-
item, and falls back to trying `/.cratis/types/{type}`, `/.cratis/schema/{type}`,
|
|
201
|
-
`/.cratis/schemas/{type}` and `/.cratis/types?type={type}` in turn. Arc names the
|
|
202
|
-
property **`payloadSchema`** on a command and **`argumentsSchema`** on a query,
|
|
203
|
-
and maps none of those four fallback routes. Every branch therefore misses, and
|
|
204
|
-
the panel shows *"No payload schema available. Lens will execute this command
|
|
205
|
-
with an empty payload object."*
|
|
206
|
-
|
|
207
|
-
There is **no raw-JSON editor** behind that empty state, so a command reached
|
|
208
|
-
this way can only be fired with `{}`. Expect that for every command until the two
|
|
209
|
-
sides agree on a property name; do not read it as a broken application. Queries
|
|
210
|
-
are unaffected — their inputs come from the `{name}` segments of the route, not
|
|
211
|
-
from a schema.
|
|
212
|
-
|
|
213
|
-
Both result panels parse defensively rather than against a contract: success is
|
|
214
|
-
`isSuccess` when present and HTTP 2xx otherwise, messages are harvested from
|
|
215
|
-
`exceptionMessages`/`errors`/`message`/`title`/`detail`, and a query payload is
|
|
216
|
-
unwrapped from the first of `data`, `result`, `items`, `results`, `value`,
|
|
217
|
-
`payload` or `content` that is present.
|
|
218
|
-
|
|
219
|
-
⚠️ **The two introspection fetches send no headers and no credentials**, while
|
|
220
|
-
the Settings user/tenant refresh does send both. So an application that puts
|
|
221
|
-
authentication in front of `/.cratis/commands` and `/.cratis/queries` breaks
|
|
222
|
-
those tabs while Settings may keep working. This is the default outside
|
|
223
|
-
Development. Run the app in **Development**, or knowingly set
|
|
224
|
-
`Cratis:Arc:Introspection:RequireAuthentication=false` on an isolated development
|
|
225
|
-
host; do not weaken production discovery for Lens.
|
|
87
|
+
## Switch context and inspect
|
|
226
88
|
|
|
227
|
-
|
|
228
|
-
|
|
89
|
+
Open the popup on the application tab. In **Context**, choose a user and tenant.
|
|
90
|
+
The tab reloads; check that the application reports the selected values. Use
|
|
91
|
+
fixture identities, whether imported from Arc or created in Lens Settings.
|
|
229
92
|
|
|
230
|
-
|
|
93
|
+
Open **Commands** or **Queries** to inspect discovered endpoints. Use the normal
|
|
94
|
+
client for commands that need a payload: Lens expects a different schema field
|
|
95
|
+
than Arc supplies and has no raw JSON editor. Popup queries accept path
|
|
96
|
+
parameters, not live subscriptions or paging options.
|
|
231
97
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
98
|
+
Read [Lens troubleshooting](references/troubleshooting.md) when context switching
|
|
99
|
+
fails, tabs are disabled, a payload editor is missing, or observable diagnostics
|
|
100
|
+
show no data.
|
|
235
101
|
|
|
236
102
|
## Verify
|
|
237
103
|
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# Troubleshoot Lens against an Arc application
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- Identity
|
|
6
|
+
- Tenancy
|
|
7
|
+
- Frontend detection
|
|
8
|
+
- Switch the active user or tenant
|
|
9
|
+
- Execute a command or query
|
|
10
|
+
- Query diagnostics
|
|
11
|
+
|
|
12
|
+
## Identity
|
|
13
|
+
|
|
14
|
+
Lens sends exactly three forwarded client-principal headers. Arc ignores them
|
|
15
|
+
and treats the request as anonymous unless
|
|
16
|
+
`Cratis:Arc:TrustForwardedIdentityHeaders=true`; a default Arc app therefore
|
|
17
|
+
does not honor Lens identity switching:
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
X-MS-CLIENT-PRINCIPAL-ID
|
|
21
|
+
X-MS-CLIENT-PRINCIPAL-NAME
|
|
22
|
+
X-MS-CLIENT-PRINCIPAL # base64 of the principal JSON
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The principal document it base64-encodes is
|
|
26
|
+
`{ identityProvider, userId, userDetails, userRoles, claims: [{ typ, val }], … }`
|
|
27
|
+
with the user's `identityDetails` and `applicationProperties` spread over it.
|
|
28
|
+
`identityProvider` defaults to `aad` and `userRoles` falls back to
|
|
29
|
+
`["authenticated", "anonymous"]` when the user has no roles.
|
|
30
|
+
|
|
31
|
+
⚠️ That is Lens's **only** identity mode. There is no bearer token, no OIDC, no
|
|
32
|
+
sign-in. The application has to be running on the Microsoft-Identity-Platform
|
|
33
|
+
forwarded-header path, and the reverse proxy in front of it in production must
|
|
34
|
+
be the only thing that can set those headers.
|
|
35
|
+
|
|
36
|
+
## Tenancy
|
|
37
|
+
|
|
38
|
+
Lens sets one header, named by its `tenantHeaderName` setting, whose default is
|
|
39
|
+
`x-cratis-tenant-id`. That matches `TenancyOptions.HttpHeader`'s default, and
|
|
40
|
+
`TenantResolverType.Header` is Arc's default resolver — so a default Arc
|
|
41
|
+
application needs no change.
|
|
42
|
+
|
|
43
|
+
⚠️ **`tenantHeaderName` has no user interface.** It is a stored setting with a
|
|
44
|
+
default and nothing binds it to an input. An application that resolves tenancy
|
|
45
|
+
by query parameter, claim, subdomain, or a renamed header **cannot be driven by
|
|
46
|
+
Lens** without editing `chrome.storage.local` by hand. Guidance describing
|
|
47
|
+
a "Tenant Header Name" field on an options page is describing something that
|
|
48
|
+
does not exist — there is no `options_page` in the manifest at all.
|
|
49
|
+
|
|
50
|
+
## Frontend detection
|
|
51
|
+
|
|
52
|
+
Detection is not header-level and is not invisible. Lens injects a function into
|
|
53
|
+
the page's main world and looks for:
|
|
54
|
+
|
|
55
|
+
1. an element with `id="root"`;
|
|
56
|
+
2. a React fiber or container key on it (`__reactFiber…` / `__reactContainer…`);
|
|
57
|
+
3. a context value on the fiber tree carrying either a `reconnectQueries`
|
|
58
|
+
property, or a `configuration` object with one of `baseUrl`, `apiBaseUrl`,
|
|
59
|
+
`apiSurface`, `apiSurfaceBaseUrl`, `baseUri` or `baseAddress`.
|
|
60
|
+
|
|
61
|
+
The page probe recognizes `/projects/{guid}/application/{guid}` as a fallback.
|
|
62
|
+
If script execution errors or produces no result, the extension also accepts
|
|
63
|
+
`localhost` or `127.0.0.1`. A negative result from a successfully executed
|
|
64
|
+
probe is not overridden simply because the tab is on localhost.
|
|
65
|
+
|
|
66
|
+
If neither React inspection nor a fallback detects the application, Lens leaves it undetected — the Commands, Queries
|
|
67
|
+
and Query Diagnostics tabs are then **disabled**, and only Context and Settings
|
|
68
|
+
work. The detected base URL is also what the Commands and Queries tabs call, so
|
|
69
|
+
without detection there is nothing to call.
|
|
70
|
+
|
|
71
|
+
## Switch the active user or tenant
|
|
72
|
+
|
|
73
|
+
Pick both on the **Context** tab. Two things then happen, in this order:
|
|
74
|
+
|
|
75
|
+
1. The service worker rebuilds its `declarativeNetRequest` **dynamic** rules —
|
|
76
|
+
at most two, one for the identity headers and one for the tenant header.
|
|
77
|
+
2. It deletes the Arc identity cookie `.cratis-identity` on the detected base URL
|
|
78
|
+
and page origins, then reloads every open tab on those origins.
|
|
79
|
+
|
|
80
|
+
Reloading clears the frontend’s in-memory identity and requests `/.cratis/me` again. Header-based switching requires
|
|
81
|
+
the host-wide trust opt-in and a suitable development/ingress boundary; the
|
|
82
|
+
extension cannot turn unsigned headers into authenticated credentials.
|
|
83
|
+
|
|
84
|
+
The rules are scoped, deliberately. When a page origin is known the condition is
|
|
85
|
+
`{ urlFilter: '*', initiatorDomains: [<page host>] }`; otherwise it is
|
|
86
|
+
`||<base URL host>`. **With neither resolvable, no rules are installed at all** —
|
|
87
|
+
`host_permissions` is `<all_urls>`, so a wildcard filter would attach
|
|
88
|
+
impersonation headers to every XHR on every site the developer browses.
|
|
89
|
+
|
|
90
|
+
⚠️ The rules match `XMLHTTPREQUEST` **only**. Document navigations, WebSocket
|
|
91
|
+
connections and EventSource/SSE streams carry no injected headers. Arc's
|
|
92
|
+
observable-query transports (`/.cratis/queries/ws`, `/.cratis/queries/sse`) are
|
|
93
|
+
therefore **not** covered by header injection.
|
|
94
|
+
|
|
95
|
+
## Execute a command or query
|
|
96
|
+
|
|
97
|
+
The Commands and Queries tabs read the introspection lists and group them into a
|
|
98
|
+
tree by splitting the namespace on `.`.
|
|
99
|
+
|
|
100
|
+
A command is always `POST <base URL><route>` with `Content-Type: application/json`
|
|
101
|
+
and the active context headers, and a body built by the schema-driven editor. A
|
|
102
|
+
query is always `GET`, with `{name}` segments in the route substituted from the
|
|
103
|
+
path-parameter inputs and the same context headers.
|
|
104
|
+
|
|
105
|
+
⚠️ **The schema-driven payload form does not receive a schema from
|
|
106
|
+
Arc.** Lens reads an optional property named `schema` off each introspection
|
|
107
|
+
item, and falls back to trying `/.cratis/types/{type}`, `/.cratis/schema/{type}`,
|
|
108
|
+
`/.cratis/schemas/{type}` and `/.cratis/types?type={type}` in turn. Arc names the
|
|
109
|
+
property **`payloadSchema`** on a command and **`argumentsSchema`** on a query,
|
|
110
|
+
and maps none of those four fallback routes. Every branch therefore misses, and
|
|
111
|
+
the panel shows *"No payload schema available. Lens will execute this command
|
|
112
|
+
with an empty payload object."*
|
|
113
|
+
|
|
114
|
+
There is no raw JSON editor. If no schema is available, the command would send
|
|
115
|
+
`{}`; use the normal client for a command that needs a payload. Query inputs
|
|
116
|
+
come from the `{name}` segments of the route, not from a schema.
|
|
117
|
+
|
|
118
|
+
Both result panels parse defensively rather than against a contract: success is
|
|
119
|
+
`isSuccess` when present and HTTP 2xx otherwise, messages are harvested from
|
|
120
|
+
`exceptionMessages`/`errors`/`message`/`title`/`detail`, and a query payload is
|
|
121
|
+
unwrapped from the first of `data`, `result`, `items`, `results`, `value`,
|
|
122
|
+
`payload` or `content` that is present.
|
|
123
|
+
|
|
124
|
+
⚠️ **The two introspection fetches do not set context headers or opt into cross-origin credentials**, while
|
|
125
|
+
the Settings user/tenant refresh does send both. So an application that puts
|
|
126
|
+
authentication in front of `/.cratis/commands` and `/.cratis/queries` breaks
|
|
127
|
+
those tabs while Settings may keep working. This is the default outside
|
|
128
|
+
Development. Run the app in **Development**, or knowingly set
|
|
129
|
+
`Cratis:Arc:Introspection:RequireAuthentication=false` on an isolated development
|
|
130
|
+
host; do not weaken production discovery for Lens.
|
|
131
|
+
|
|
132
|
+
Queries are path-parameter GETs only: no query-string arguments, no paging or
|
|
133
|
+
sorting inputs, and no observable subscription from the popup.
|
|
134
|
+
|
|
135
|
+
## Query diagnostics
|
|
136
|
+
|
|
137
|
+
The Query Diagnostics tab is read-only and polls every 2 seconds. It requires the
|
|
138
|
+
detected Arc context to expose `observableQueryDiagnostics.getSnapshot()`; when
|
|
139
|
+
it does not, the panel reports no data. Nothing else in Lens depends on it.
|