@rt-tools/agent-kit 0.37.0 → 0.38.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/README.md +5 -5
- package/assets/checks/action-of.mjs +154 -0
- package/assets/checks/board-pull-state.github.mjs +82 -13
- package/assets/checks/board-runs.github.mjs +40 -5
- package/assets/checks/board.github.mjs +1 -1
- package/assets/checks/check-board.github.mjs +58 -19
- package/assets/checks/check-specs.mjs +2 -2
- package/assets/checks/check-state-next.mjs +22 -10
- package/assets/checks/check-turn-map.mjs +26 -6
- package/assets/checks/check-work-steps.mjs +4 -173
- package/assets/checks/decide.mjs +285 -0
- package/assets/checks/decision-table.json +21365 -0
- package/assets/checks/decision-table.mjs +495 -0
- package/assets/checks/epic-table.github.mjs +4 -3
- package/assets/checks/epic-window.mjs +98 -0
- package/assets/checks/flow-condition.mjs +64 -0
- package/assets/checks/flow-data.mjs +136 -0
- package/assets/checks/flow-forecast.mjs +330 -0
- package/assets/checks/flow-guard-run.mjs +90 -0
- package/assets/checks/flow-guard.mjs +294 -0
- package/assets/checks/flow-model.mjs +271 -0
- package/assets/checks/flow-override.mjs +130 -0
- package/assets/checks/flow-plan.mjs +206 -0
- package/assets/checks/flow-scaffold.mjs +224 -0
- package/assets/checks/flow-step.mjs +365 -0
- package/assets/checks/flow-sync.mjs +296 -0
- package/assets/checks/flow-syntax.mjs +292 -0
- package/assets/checks/flow-verdict.mjs +112 -0
- package/assets/checks/lib-common.mjs +10 -2
- package/assets/checks/lib-domains.mjs +1 -1
- package/assets/checks/lib-manifests.mjs +34 -2
- package/assets/checks/merge-read.mjs +239 -0
- package/assets/checks/owner-nudges.mjs +389 -0
- package/assets/checks/push-inputs.mjs +444 -0
- package/assets/checks/push-trace.mjs +108 -0
- package/assets/checks/record-count.mjs +410 -0
- package/assets/checks/record-recount.mjs +187 -0
- package/assets/checks/record-turn.mjs +155 -0
- package/assets/checks/rt-kit-checks.config.mjs +17 -2
- package/assets/checks/spec-anchors.mjs +4 -4
- package/assets/checks/spec-contract.mjs +5 -5
- package/assets/checks/task-flow-script.mjs +292 -0
- package/assets/checks/tree-assignment.mjs +26 -7
- package/assets/checks/work-result.mjs +281 -0
- package/assets/checks/work-steps-lib.mjs +205 -0
- package/assets/commands/next-session.md +3 -1
- package/assets/commands/night.md +28 -18
- package/assets/defaults/gate-map.sh +39 -12
- package/assets/defaults/merges.sh +48 -0
- package/assets/defaults/project.sh +43 -13
- package/assets/defaults/push.sh +23 -0
- package/assets/defaults/turn-map.md +24 -21
- package/assets/docs/GLOSSARY.md +6 -2
- package/assets/hooks/ask-judge.md +65 -0
- package/assets/hooks/browser-guard-device-id.sh +11 -9
- package/assets/hooks/browser-guard-no-asking.sh +12 -6
- package/assets/hooks/browser-guard-no-listing.sh +13 -7
- package/assets/hooks/browser-guard-no-other-drivers.sh +25 -17
- package/assets/hooks/browser-guard-require-select.sh +15 -15
- package/assets/hooks/commit-msg.sh +13 -3
- package/assets/hooks/conscience-guard.sh +9 -25
- package/assets/hooks/decide.sh +141 -0
- package/assets/hooks/deny-tail.sh +16 -11
- package/assets/hooks/dev-server-guard.sh +27 -20
- package/assets/hooks/dispatch.sh +47 -4
- package/assets/hooks/docs-guard.sh +31 -200
- package/assets/hooks/end-conversation-guard.sh +12 -21
- package/assets/hooks/epic-stop-guard.sh +54 -105
- package/assets/hooks/exam-guard.sh +32 -65
- package/assets/hooks/facts-docs.sh +221 -0
- package/assets/hooks/facts-flow.sh +173 -0
- package/assets/hooks/facts.sh +308 -0
- package/assets/hooks/flow-step-guard.sh +93 -0
- package/assets/hooks/git-guard-delivery-body.sh +4 -4
- package/assets/hooks/git-guard-delivery-conflict.sh +16 -10
- package/assets/hooks/git-guard-delivery-draft.sh +3 -3
- package/assets/hooks/git-guard-delivery-epic.sh +18 -9
- package/assets/hooks/git-guard-delivery-folder.sh +32 -7
- package/assets/hooks/git-guard-delivery-merge.sh +2 -2
- package/assets/hooks/git-guard-delivery-merged.sh +12 -1
- package/assets/hooks/git-guard-delivery-pipeline.sh +1 -1
- package/assets/hooks/git-guard-delivery-rerun.sh +32 -0
- package/assets/hooks/git-guard-delivery-signature.sh +82 -45
- package/assets/hooks/git-guard-delivery-task.sh +47 -0
- package/assets/hooks/git-guard-delivery.sh +112 -101
- package/assets/hooks/git-guard-discard.sh +8 -18
- package/assets/hooks/git-guard-main.sh +13 -19
- package/assets/hooks/git-guard-no-verify.sh +56 -16
- package/assets/hooks/git-guard-push-ahead.sh +46 -5
- package/assets/hooks/git-guard-push-marks.sh +227 -31
- package/assets/hooks/git-guard-push-tests.sh +51 -53
- package/assets/hooks/git-guard-tree-assignment.sh +7 -4
- package/assets/hooks/guard-note.sh +8 -6
- package/assets/hooks/handoff-entry-guard.sh +20 -39
- package/assets/hooks/handoff-write.sh +3 -1
- package/assets/hooks/hook-input.sh +0 -41
- package/assets/hooks/metric-marks.sh +19 -7
- package/assets/hooks/observe.sh +1 -1
- package/assets/hooks/override-write-guard.sh +27 -9
- package/assets/hooks/pre-push.sh +20 -10
- package/assets/hooks/prose-style-guard.sh +6 -19
- package/assets/hooks/pull-merges.sh +76 -0
- package/assets/hooks/push-set.sh +39 -7
- package/assets/hooks/qa-dataid-guard.sh +7 -17
- package/assets/hooks/record-turn.sh +52 -0
- package/assets/hooks/rerun-guard.sh +11 -16
- package/assets/hooks/reuse-first-guard.sh +7 -21
- package/assets/hooks/role-calls.sh +25 -3
- package/assets/hooks/rule-source-guard.sh +54 -21
- package/assets/hooks/skill-gate-rearm.sh +18 -5
- package/assets/hooks/skill-gate.sh +156 -20
- package/assets/hooks/skill-loaded.sh +18 -3
- package/assets/hooks/sql-guard-target.sh +2 -2
- package/assets/hooks/sql-guard-write.sh +12 -12
- package/assets/hooks/sql-guard.sh +58 -16
- package/assets/hooks/task-context-load.sh +3 -1
- package/assets/hooks/task-flow-context.sh +20 -22
- package/assets/hooks/task-flow-draft-guard.sh +25 -74
- package/assets/hooks/task-flow-guard.sh +28 -129
- package/assets/hooks/tree-assignment-guard.sh +25 -14
- package/assets/hooks/turn-entry-load.sh +3 -1
- package/assets/hooks/turn-exit-guard.sh +92 -452
- package/assets/hooks/turn-exit-role.sh +47 -0
- package/assets/hooks/turn-judge.md +103 -0
- package/assets/hooks/window-fill-guard.sh +22 -41
- package/assets/laws/work-conduct.md +9 -8
- package/assets/patterns/autonomous-work-run.md +35 -10
- package/assets/patterns/browser-verification-measure.md +10 -20
- package/assets/patterns/browser-verification-stand.md +30 -42
- package/assets/patterns/doc-style-human.md +0 -6
- package/assets/patterns/doc-style-sweep.md +7 -7
- package/assets/patterns/doc-style-trace.md +5 -4
- package/assets/patterns/doc-style-write.md +7 -7
- package/assets/patterns/epic-flow-declare.md +15 -8
- package/assets/patterns/git-workflow-commit.azure.md +9 -155
- package/assets/patterns/git-workflow-commit.github.md +11 -269
- package/assets/patterns/git-workflow-commit.gitlab.md +9 -161
- package/assets/patterns/git-workflow-docker.md +8 -231
- package/assets/patterns/git-workflow-freshness.md +9 -56
- package/assets/patterns/git-workflow-merge.md +7 -174
- package/assets/patterns/git-workflow-migration.md +5 -73
- package/assets/patterns/git-workflow-pr-body.github.md +6 -159
- package/assets/patterns/git-workflow-pr-ready.md +9 -69
- package/assets/patterns/git-workflow-pr.azure.md +14 -220
- package/assets/patterns/git-workflow-pr.github.md +13 -253
- package/assets/patterns/git-workflow-pr.gitlab.md +14 -241
- package/assets/patterns/git-workflow-restart.md +5 -41
- package/assets/patterns/git-workflow-secrets.md +10 -76
- package/assets/patterns/git-workflow-stack.md +9 -205
- package/assets/patterns/lib-layers-new.md +7 -3
- package/assets/patterns/queue-audit-read.github.md +9 -3
- package/assets/patterns/spec-driven-domain.md +50 -48
- package/assets/patterns/spec-driven-rule.md +18 -19
- package/assets/patterns/status-report-table.github.md +2 -2
- package/assets/patterns/task-flow-archive.md +15 -256
- package/assets/patterns/task-flow-close.md +16 -291
- package/assets/patterns/task-flow-cycle.md +13 -39
- package/assets/patterns/task-flow-graph.needs-graph.md +8 -58
- package/assets/patterns/task-flow-handoff.md +13 -161
- package/assets/patterns/task-flow-resume.md +19 -183
- package/assets/patterns/task-flow-start.md +9 -248
- package/assets/patterns/testing-e2e.md +14 -18
- package/assets/patterns/testing-unit.md +9 -13
- package/assets/patterns/turn-entry-map.md +15 -5
- package/assets/pitfalls/agent-kit-extend.md +200 -0
- package/assets/pitfalls/agent-kit.2.md +323 -0
- package/assets/pitfalls/angular-patterns.md +98 -0
- package/assets/pitfalls/autonomous-work.md +15 -0
- package/assets/pitfalls/browser-verification.md +265 -0
- package/assets/pitfalls/component-structure.md +98 -0
- package/assets/pitfalls/dependencies.md +92 -0
- package/assets/pitfalls/deploy-flow.azure.md +171 -0
- package/assets/pitfalls/deploy-flow.github.md +211 -0
- package/assets/pitfalls/deploy-flow.gitlab.md +173 -0
- package/assets/pitfalls/doc-style.2.md +286 -0
- package/assets/pitfalls/doc-style.md +3 -3
- package/assets/pitfalls/entity-conventions.needs-admin.md +96 -0
- package/assets/pitfalls/entity-models.md +89 -0
- package/assets/pitfalls/git-workflow-commit.azure.md +190 -0
- package/assets/pitfalls/git-workflow-commit.github.md +307 -0
- package/assets/pitfalls/git-workflow-commit.gitlab.md +196 -0
- package/assets/pitfalls/git-workflow-docker.md +275 -0
- package/assets/pitfalls/git-workflow-freshness.md +88 -0
- package/assets/pitfalls/git-workflow-hosting.azure.md +31 -0
- package/assets/pitfalls/git-workflow-hosting.github.md +32 -0
- package/assets/pitfalls/git-workflow-hosting.gitlab.md +31 -0
- package/assets/pitfalls/git-workflow-merge.md +220 -0
- package/assets/pitfalls/git-workflow-migration.md +103 -0
- package/assets/pitfalls/git-workflow-pr-body.github.md +185 -0
- package/assets/pitfalls/git-workflow-pr-ready.md +104 -0
- package/assets/pitfalls/git-workflow-pr.2.azure.md +172 -0
- package/assets/pitfalls/git-workflow-pr.2.github.md +184 -0
- package/assets/pitfalls/git-workflow-pr.2.gitlab.md +180 -0
- package/assets/pitfalls/git-workflow-pr.azure.md +159 -0
- package/assets/pitfalls/git-workflow-pr.github.md +107 -0
- package/assets/pitfalls/git-workflow-pr.gitlab.md +151 -0
- package/assets/pitfalls/git-workflow-push.azure.md +30 -0
- package/assets/pitfalls/git-workflow-push.github.md +30 -0
- package/assets/pitfalls/git-workflow-push.gitlab.md +30 -0
- package/assets/pitfalls/git-workflow-queue.azure.md +30 -0
- package/assets/pitfalls/git-workflow-queue.github.md +30 -0
- package/assets/pitfalls/git-workflow-queue.gitlab.md +30 -0
- package/assets/pitfalls/git-workflow-restart.md +72 -0
- package/assets/pitfalls/git-workflow-secrets.md +114 -0
- package/assets/pitfalls/git-workflow-stack.md +254 -0
- package/assets/pitfalls/git-workflow.2.azure.md +291 -0
- package/assets/pitfalls/git-workflow.2.github.md +294 -0
- package/assets/pitfalls/git-workflow.2.gitlab.md +278 -0
- package/assets/pitfalls/git-workflow.github.md +5 -9
- package/assets/pitfalls/lib-layers.md +114 -0
- package/assets/pitfalls/lists.md +117 -0
- package/assets/pitfalls/navigation.md +94 -0
- package/assets/pitfalls/reuse-first.md +201 -0
- package/assets/pitfalls/spec-driven.2.md +318 -0
- package/assets/pitfalls/spec-driven.md +9 -7
- package/assets/pitfalls/styling-bem.2.md +125 -0
- package/assets/pitfalls/task-flow-archive.md +264 -0
- package/assets/pitfalls/task-flow-close.2.md +165 -0
- package/assets/pitfalls/task-flow-close.md +167 -0
- package/assets/pitfalls/task-flow-cycle.md +73 -0
- package/assets/pitfalls/task-flow-graph.needs-graph.md +98 -0
- package/assets/pitfalls/task-flow-handoff.md +200 -0
- package/assets/pitfalls/task-flow-handover.md +30 -0
- package/assets/pitfalls/task-flow-owner.md +29 -0
- package/assets/pitfalls/task-flow-plan.md +29 -0
- package/assets/pitfalls/task-flow-resume.md +257 -0
- package/assets/pitfalls/task-flow-start.md +287 -0
- package/assets/pitfalls/task-flow.2.md +303 -0
- package/assets/pitfalls/task-flow.md +18 -29
- package/assets/pitfalls/testing.2.md +279 -0
- package/assets/pitfalls/testing.md +11 -12
- package/assets/pitfalls/turn-conduct.md +17 -18
- package/assets/pitfalls/typescript-conventions.md +161 -0
- package/assets/pitfalls/write-a-skill.md +128 -0
- package/assets/rules/angular-patterns.md +21 -86
- package/assets/rules/autonomous-work.md +37 -29
- package/assets/rules/browser-verification.md +28 -251
- package/assets/rules/component-structure.md +25 -87
- package/assets/rules/dependencies.md +20 -78
- package/assets/rules/deploy-flow.azure.md +27 -134
- package/assets/rules/deploy-flow.github.md +34 -196
- package/assets/rules/deploy-flow.gitlab.md +28 -137
- package/assets/rules/doc-style.md +32 -282
- package/assets/rules/entity-conventions.needs-admin.md +26 -82
- package/assets/rules/entity-models.md +14 -63
- package/assets/rules/epic-flow.md +5 -3
- package/assets/rules/git-workflow-hosting.azure.md +26 -0
- package/assets/rules/git-workflow-hosting.github.md +38 -0
- package/assets/rules/git-workflow-hosting.gitlab.md +27 -0
- package/assets/rules/git-workflow-push.azure.md +28 -0
- package/assets/rules/git-workflow-push.github.md +28 -0
- package/assets/rules/git-workflow-push.gitlab.md +28 -0
- package/assets/rules/git-workflow-queue.azure.md +23 -0
- package/assets/rules/git-workflow-queue.github.md +30 -0
- package/assets/rules/git-workflow-queue.gitlab.md +23 -0
- package/assets/rules/git-workflow.azure.md +21 -264
- package/assets/rules/git-workflow.github.md +24 -285
- package/assets/rules/git-workflow.gitlab.md +21 -258
- package/assets/rules/lib-layers.md +30 -103
- package/assets/rules/lists.md +21 -105
- package/assets/rules/navigation.md +10 -69
- package/assets/rules/queue-audit.github.md +5 -3
- package/assets/rules/reuse-first.md +20 -195
- package/assets/rules/spec-driven.md +35 -316
- package/assets/rules/status-report.md +5 -3
- package/assets/rules/styling-bem.md +20 -117
- package/assets/rules/task-flow-handover.md +24 -0
- package/assets/rules/task-flow-owner.md +34 -0
- package/assets/rules/task-flow-plan.md +38 -0
- package/assets/rules/task-flow.md +22 -289
- package/assets/rules/testing.md +32 -270
- package/assets/rules/turn-conduct.md +109 -111
- package/assets/rules/turn-entry.md +2 -2
- package/assets/rules/typescript-conventions.md +41 -147
- package/assets/samples/tasks/_template/plan.md +30 -6
- package/assets/samples/tasks/_template/progress.md +0 -1
- package/assets/skills/agent-kit-extend.md +25 -168
- package/assets/skills/agent-kit.md +27 -299
- package/assets/skills/write-a-skill.md +20 -106
- package/assets/task-flow/flow.js +188 -0
- package/assets/task-flow/flow.md +102 -0
- package/assets/task-flow/measure/agreement.mjs +24 -0
- package/assets/task-flow/measure/copy.mjs +22 -0
- package/assets/task-flow/measure/epic-of.mjs +50 -0
- package/assets/task-flow/measure/epic-text.mjs +35 -0
- package/assets/task-flow/measure/epic.mjs +114 -0
- package/assets/task-flow/measure/folder.mjs +16 -0
- package/assets/task-flow/measure/footprint.mjs +28 -0
- package/assets/task-flow/measure/grill.mjs +21 -0
- package/assets/task-flow/measure/host.mjs +8 -0
- package/assets/task-flow/measure/owner.mjs +20 -0
- package/assets/task-flow/measure/plan.mjs +27 -0
- package/assets/task-flow/measure/pr.mjs +20 -0
- package/assets/task-flow/measure/progress.mjs +50 -0
- package/assets/task-flow/measure/session.mjs +175 -0
- package/assets/task-flow/measure/task.mjs +23 -0
- package/assets/task-flow/measure/text.mjs +77 -0
- package/assets/task-flow/source/git.mjs +86 -0
- package/assets/task-flow/source/host.mjs +172 -0
- package/assets/task-flow/source/marks.mjs +56 -0
- package/assets/task-flow/source/owner.mjs +74 -0
- package/assets/task-flow/source/records.mjs +116 -0
- package/assets/task-flow/source/session.mjs +232 -0
- package/assets/task-flow/source/steps.mjs +28 -0
- package/assets/task-flow/source/tree.mjs +42 -0
- package/assets/templates/rule.md +2 -2
- package/bin/agent-kit.d.ts.map +1 -1
- package/bin/agent-kit.js +30 -0
- package/bin/agent-kit.js.map +1 -1
- package/lib/agent-checks.d.ts +55 -0
- package/lib/agent-checks.d.ts.map +1 -0
- package/lib/agent-checks.js +209 -0
- package/lib/agent-checks.js.map +1 -0
- package/lib/assets.d.ts.map +1 -1
- package/lib/assets.js +7 -2
- package/lib/assets.js.map +1 -1
- package/lib/cargo-prose.d.ts +2 -1
- package/lib/cargo-prose.d.ts.map +1 -1
- package/lib/cargo-prose.js.map +1 -1
- package/lib/cargo.d.ts +29 -0
- package/lib/cargo.d.ts.map +1 -1
- package/lib/cargo.js +27 -1
- package/lib/cargo.js.map +1 -1
- package/lib/cascade.d.ts.map +1 -1
- package/lib/cascade.js +3 -1
- package/lib/cascade.js.map +1 -1
- package/lib/commands.d.ts.map +1 -1
- package/lib/commands.js +78 -2
- package/lib/commands.js.map +1 -1
- package/lib/companion.d.ts +0 -5
- package/lib/companion.d.ts.map +1 -1
- package/lib/companion.js +1 -1
- package/lib/companion.js.map +1 -1
- package/lib/config.d.ts +18 -0
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +18 -1
- package/lib/config.js.map +1 -1
- package/lib/cost.d.ts +0 -8
- package/lib/cost.d.ts.map +1 -1
- package/lib/cost.js +4 -4
- package/lib/cost.js.map +1 -1
- package/lib/epic-window-send.d.ts +74 -0
- package/lib/epic-window-send.d.ts.map +1 -0
- package/lib/epic-window-send.js +166 -0
- package/lib/epic-window-send.js.map +1 -0
- package/lib/hooks-map.d.ts +4 -12
- package/lib/hooks-map.d.ts.map +1 -1
- package/lib/hooks-map.js +4 -27
- package/lib/hooks-map.js.map +1 -1
- package/lib/integrity.d.ts +3 -0
- package/lib/integrity.d.ts.map +1 -1
- package/lib/integrity.js +7 -0
- package/lib/integrity.js.map +1 -1
- package/lib/metric-lines.d.ts +2 -1
- package/lib/metric-lines.d.ts.map +1 -1
- package/lib/metric-lines.js +49 -1
- package/lib/metric-lines.js.map +1 -1
- package/lib/metric-send-mark.d.ts +6 -3
- package/lib/metric-send-mark.d.ts.map +1 -1
- package/lib/metric-send-mark.js +15 -5
- package/lib/metric-send-mark.js.map +1 -1
- package/lib/metric-send.d.ts +6 -2
- package/lib/metric-send.d.ts.map +1 -1
- package/lib/metric-send.js +47 -13
- package/lib/metric-send.js.map +1 -1
- package/lib/metrics.d.ts +17 -0
- package/lib/metrics.d.ts.map +1 -1
- package/lib/metrics.js +26 -15
- package/lib/metrics.js.map +1 -1
- package/lib/observations-cargo.d.ts +1 -5
- package/lib/observations-cargo.d.ts.map +1 -1
- package/lib/observations-cargo.js +2 -2
- package/lib/observations-cargo.js.map +1 -1
- package/lib/observations.d.ts +0 -2
- package/lib/observations.d.ts.map +1 -1
- package/lib/observations.js +3 -3
- package/lib/observations.js.map +1 -1
- package/lib/order.d.ts +0 -2
- package/lib/order.d.ts.map +1 -1
- package/lib/order.js +0 -4
- package/lib/order.js.map +1 -1
- package/lib/outcomes.d.ts +7 -9
- package/lib/outcomes.d.ts.map +1 -1
- package/lib/outcomes.js +8 -7
- package/lib/outcomes.js.map +1 -1
- package/lib/proposals.d.ts +0 -1
- package/lib/proposals.d.ts.map +1 -1
- package/lib/proposals.js +1 -1
- package/lib/proposals.js.map +1 -1
- package/lib/push-gate.d.ts +13 -0
- package/lib/push-gate.d.ts.map +1 -1
- package/lib/push-gate.js +11 -7
- package/lib/push-gate.js.map +1 -1
- package/lib/push-set-usefulness.d.ts +78 -0
- package/lib/push-set-usefulness.d.ts.map +1 -0
- package/lib/push-set-usefulness.js +225 -0
- package/lib/push-set-usefulness.js.map +1 -0
- package/lib/shipment.d.ts +2 -11
- package/lib/shipment.d.ts.map +1 -1
- package/lib/shipment.fixture.d.ts +0 -3
- package/lib/shipment.fixture.d.ts.map +1 -1
- package/lib/shipment.fixture.js +3 -3
- package/lib/shipment.fixture.js.map +1 -1
- package/lib/shipment.js +2 -2
- package/lib/shipment.js.map +1 -1
- package/lib/sync.d.ts +10 -0
- package/lib/sync.d.ts.map +1 -1
- package/lib/sync.js +14 -1
- package/lib/sync.js.map +1 -1
- package/lib/traits.d.ts +0 -3
- package/lib/traits.d.ts.map +1 -1
- package/lib/traits.js +2 -2
- package/lib/traits.js.map +1 -1
- package/lib/variants.d.ts +0 -1
- package/lib/variants.d.ts.map +1 -1
- package/lib/variants.js +1 -1
- package/lib/variants.js.map +1 -1
- package/lib/work-result.d.ts +43 -0
- package/lib/work-result.d.ts.map +1 -0
- package/lib/work-result.js +39 -0
- package/lib/work-result.js.map +1 -0
- package/package.json +1 -1
- package/assets/checks/signals/ui-kit.json +0 -11
- package/assets/hooks/claim-guard.sh +0 -212
- package/assets/hooks/grill-gate-ask.sh +0 -26
- package/assets/hooks/grill-gate-bypass.sh +0 -61
- package/assets/hooks/grill-gate-options.sh +0 -50
- package/assets/hooks/grill-gate.sh +0 -482
- package/assets/hooks/postmortem-guard.sh +0 -124
- package/assets/hooks/proposal-guard.sh +0 -154
- package/assets/hooks/stand-login-guard.sh +0 -107
- package/assets/hooks/turn-exit-epic.sh +0 -173
- package/assets/hooks/turn-exit-patterns.sh +0 -123
- package/assets/hooks/turn-exit-verdict.sh +0 -149
- package/assets/hooks/waiting-turn-guard.sh +0 -320
- package/assets/hooks/work-start-guard.sh +0 -175
|
@@ -19,35 +19,47 @@ demand, not with the rule.
|
|
|
19
19
|
| In the law | Here |
|
|
20
20
|
| --- | --- |
|
|
21
21
|
| turn | one pass of the agent: from the owner's message to the reply |
|
|
22
|
-
| a turn exit |
|
|
23
|
-
| the guard of turn exits | a guard at the turn's end:
|
|
22
|
+
| a turn exit | the end of the scenario or the owner's stop word; the other release cases of the task flow description |
|
|
23
|
+
| the guard of turn exits | a guard at the turn's end: asks the engine to measure the branch by the task flow description |
|
|
24
|
+
| the agent hook of the turn's end | a model at the turn's end: reads the owner's last message, the reply and the calls of the turn |
|
|
24
25
|
| a statement about the state of the tree | a word in the reply to the owner backed by a command of the same turn and its output |
|
|
25
|
-
| the session handover | a
|
|
26
|
+
| the session handover | a section of the progress retelling it for a new session; a file outside the tree where there is no task folder |
|
|
26
27
|
| the compaction threshold and the stop threshold | two window-fill numbers the tree sets itself; the first stands below the second |
|
|
27
28
|
|
|
28
29
|
## Turn exits
|
|
29
30
|
|
|
30
|
-
A turn ends
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
A turn ends when the scenario is over or when the owner's last word is a stop word. The owner put it
|
|
32
|
+
so: «Только твоё «стоп»». The exit guard measures the branch by the task flow description and holds
|
|
33
|
+
every other turn with the one move that comes next, unless a release case below is met.
|
|
34
|
+
|
|
35
|
+
<!-- flow:turn-end -->
|
|
36
|
+
The engine lets a turn end before the scenario does when a case is met, asked in this order:
|
|
37
|
+
|
|
38
|
+
- **1** · the end of the scenario — `any(measure.epic.finished, all(measure.copy.outsideEpic, measure.pr.handed))`
|
|
39
|
+
- **2** · a stop word of the owner — `measure.owner.saidStop`
|
|
40
|
+
- **3** · a background task of the session runs — `all(measure.session.waiting, not(measure.pr.handed))`
|
|
41
|
+
- **4** · no write to the tree, or a branch outside the scenario — `any(measure.copy.outOfScenario, all(not(measure.session.wrote), not(measure.owner.nudged)))`
|
|
42
|
+
- **5** · a role session — `measure.session.role`
|
|
43
|
+
- **6** · the host did not answer twice — `measure.host.silent`
|
|
44
|
+
- **8** · the menu did not reach the owner — `measure.session.menuLost`
|
|
45
|
+
<!-- /flow:turn-end -->
|
|
46
|
+
|
|
47
|
+
A question to the owner, a guard's refusal, a handover and handed-in work do not end a turn. A
|
|
48
|
+
question waits for its answer inside the turn, a refusal is answered by the next call, and handed-in
|
|
49
|
+
work is followed by the next task. A step that another guard refuses twice
|
|
50
|
+
goes to the owner as one menu with the options of the description: «отложить RT-N», «стоп».
|
|
35
51
|
|
|
36
52
|
The queue is asked by a command in the same turn: "there are no tasks" is a statement about the
|
|
37
|
-
tree, and the executor's memory does not confirm it.
|
|
38
|
-
piece of work while an independent one lies next to it ends with the work taken, and the question
|
|
39
|
-
goes in a line beside it.
|
|
53
|
+
tree, and the executor's memory does not confirm it.
|
|
40
54
|
|
|
41
|
-
Everything else is the turn going on
|
|
42
|
-
|
|
43
|
-
A transition from state to state — least of all: the next mandatory action is done in the same
|
|
44
|
-
turn, and a state boundary looks like a finished piece better than any milestone.
|
|
55
|
+
Everything else is the turn going on. A milestone does not end a turn: not a commit, not a read
|
|
56
|
+
agreement, not the boundary "read — now editing", not a green check.
|
|
57
|
+
A transition from state to state — least of all: the next mandatory action is done in the same turn.
|
|
45
58
|
|
|
46
|
-
Four
|
|
47
|
-
|
|
59
|
+
Four stops look like work and are not: a summary of someone else's step, a menu under an assigned
|
|
60
|
+
order, a declaration of intent, and a command named but not run.
|
|
48
61
|
|
|
49
|
-
A turn ending while an epic runs shows the owner their position by the table the
|
|
50
|
-
the order is written down, and the one it is followed for cannot otherwise see the queue's state.
|
|
62
|
+
A turn ending while an epic runs shows the owner their position by the epic's table: otherwise they cannot see the queue's state.
|
|
51
63
|
|
|
52
64
|
## Where it lives
|
|
53
65
|
|
|
@@ -60,32 +72,27 @@ One turn: what it ends with, what is checked before its end and what the owner i
|
|
|
60
72
|
|
|
61
73
|
```mermaid
|
|
62
74
|
flowchart TD
|
|
63
|
-
A[The turn is going] --> B{
|
|
64
|
-
B -->|
|
|
65
|
-
B -->|
|
|
66
|
-
B -->|
|
|
67
|
-
B -->|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
F --> I
|
|
74
|
-
H --> I
|
|
75
|
+
A[The turn is going] --> B{The engine measures the branch}
|
|
76
|
+
B -->|The scenario is over| L[The epic table shown]
|
|
77
|
+
B -->|The owner's last word is a stop word| I
|
|
78
|
+
B -->|Another release case of the description| I
|
|
79
|
+
B -->|None| D{The next move}
|
|
80
|
+
D -->|The executor's step| G[Done in the same turn: a question, a refusal, a handover never end it]
|
|
81
|
+
D -->|Another guard refuses it twice| M[One menu: «отложить RT-N», «стоп»]
|
|
82
|
+
M --> A
|
|
83
|
+
G --> A
|
|
84
|
+
L --> I{The reply speaks of the tree}
|
|
75
85
|
I -->|Yes| J[Every word carries a command of the same turn and its output]
|
|
76
86
|
I -->|No| K[The turn is over]
|
|
77
87
|
J --> K
|
|
78
|
-
G --> A
|
|
79
88
|
```
|
|
80
89
|
|
|
81
90
|
## How the law applies here
|
|
82
91
|
|
|
83
|
-
- **A promise to do the work in the next turn is an announcement of intent.** It
|
|
84
|
-
command named and not run
|
|
85
|
-
a stop less often.
|
|
92
|
+
- **A promise to do the work in the next turn is an announcement of intent.** It sounds politer than
|
|
93
|
+
a command named and not run, and so is recognised as a stop less often.
|
|
86
94
|
- **An order named by a number or by the word "all" is counted aloud before the turn ends.** The reply carries the count — how many out of how many. A turn where the count did
|
|
87
|
-
not add up does not end: it goes on with the next item of the order.
|
|
88
|
-
holds is written nowhere in the tree — only whoever read the order knows it.
|
|
95
|
+
not add up does not end: it goes on with the next item of the order.
|
|
89
96
|
- **The owner's word to work without stops holds until they cancel it themselves.** A turn ending
|
|
90
97
|
with waiting for that same word invents the cancellation. A new fact against the instruction is a
|
|
91
98
|
line about the price in the reply, not waiting; a decision the tree does not hold is asked as a
|
|
@@ -102,11 +109,12 @@ flowchart TD
|
|
|
102
109
|
lawful only where neither the rules nor the tree answer it; the list is written after all the
|
|
103
110
|
executor could close is struck out.
|
|
104
111
|
- **A menu under an assigned order.** A choice offered to the owner before the epic is over asks to
|
|
105
|
-
assign the order anew. No work left in the epic — say so
|
|
112
|
+
assign the order anew. No work left in the epic — say so, show its table and ask for the next
|
|
113
|
+
work.
|
|
106
114
|
- **No order at all is a lawful state, and it is said, not filled.** A queue card is not an order.
|
|
107
115
|
The turn names that there is no order and asks for one.
|
|
108
116
|
- **A standing order is written into the progress in the owner's words.** Read once, «merge every
|
|
109
|
-
PR» is lost at the first refusal;
|
|
117
|
+
PR» is lost at the first refusal; a decision along the way carries it, quoted.
|
|
110
118
|
- **Done work is shown on the running application built from it.** Host pages show delivery, not
|
|
111
119
|
«what did you do».
|
|
112
120
|
- **A declaration of intent.** "Taking the next task" is not taking it: the phrase lives to the end
|
|
@@ -137,15 +145,11 @@ flowchart TD
|
|
|
137
145
|
- **A stop is named in a message of its own.** Not in a line at the end of a report: there it drowns
|
|
138
146
|
— the owner reads a report as an account of the done. Three things are named: what stands, what it
|
|
139
147
|
waits for and what the owner can decide.
|
|
140
|
-
- **Turn exits are watched by a guard, not by the executor's memory.** It
|
|
141
|
-
the
|
|
142
|
-
|
|
143
|
-
- **A removed task folder lifts the state requirement
|
|
144
|
-
|
|
145
|
-
handing in, not its end. From there the turn is judged by the second sign.
|
|
146
|
-
- **Work without a branch and without a task folder is judged by the same guard by the second
|
|
147
|
-
sign.** It has no state, and the first sign has nowhere to come from — but a turn with no edit of
|
|
148
|
-
the tree does not end here either.
|
|
148
|
+
- **Turn exits are watched by a guard, not by the executor's memory.** It asks the engine, and the
|
|
149
|
+
engine measures the state of the branch: nothing is declared. What the reply says — a promise, a
|
|
150
|
+
report instead of the next step — the agent hook on the same event judges by meaning.
|
|
151
|
+
- **A removed task folder lifts the state requirement.** The progress leaves with the folder, taken
|
|
152
|
+
apart before the PR opens; a removed folder means the middle of handing in, not its end.
|
|
149
153
|
- **A taken task is not yet begun work, and the turn does not end on it.** Creating the branch,
|
|
150
154
|
moving the column and naming the number are preparation: the mandatory action of `задача-взята` is
|
|
151
155
|
not done by a single line. An epic branch, named by the header of its plan, carries no folder by
|
|
@@ -156,70 +160,61 @@ flowchart TD
|
|
|
156
160
|
- **A reply to the owner is not an action and does not stand last in a turn.** The order inside a
|
|
157
161
|
turn is one: work, the first step of the next, then text; what was done is said after the next
|
|
158
162
|
action, not instead of it.
|
|
159
|
-
- **The last action of a turn is only ever work.**
|
|
160
|
-
|
|
161
|
-
|
|
163
|
+
- **The last action of a turn is only ever work.** A file edit or a changing command stands last
|
|
164
|
+
among what the turn did. The exit guard does not read the last call: a turn whose scenario is not
|
|
165
|
+
over is held whatever stood last, unless a release case is met.
|
|
162
166
|
- **Waiting for someone else's step is never the last action of a turn.** While they are waited for,
|
|
163
167
|
the work stays where it stood. The last action is judged: waiting mid-turn is lawful, and so is a
|
|
164
|
-
launch in the background mid-turn. Standing last, it
|
|
168
|
+
launch in the background mid-turn. Standing last, it ends the turn only as a wait the record shows: a background task of the session with no end, younger than twenty minutes, once per task and not after the work is handed over. What does not depend on it is done first.
|
|
165
169
|
- **The handover is written even where the branch has no name.** All of it lies in the tree and is
|
|
166
170
|
reachable on a detached head; one file needs a name, and a short snapshot of the head gives it.
|
|
167
171
|
Otherwise compaction comes without a handover, and the next session starts from a blank.
|
|
168
|
-
- **A next step written into the progress is begun by the same turn.** The
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
- **A plan stage is declared closed only after its check command has passed.**
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
172
|
+
- **A next step written into the progress is begun by the same turn.** The held turn names the
|
|
173
|
+
current step and the command that measures it. A full report and a moved stage number do not
|
|
174
|
+
replace the step.
|
|
175
|
+
- **A plan stage is declared closed only after its check command has passed.** Every step of the
|
|
176
|
+
plan carries a check line: a command in backticks and the expected output. The engine runs it and
|
|
177
|
+
writes the mark of the step; a step marked done without its mark is refused.
|
|
178
|
+
- **The end of an epic is the end of the scenario, and the turn ends there.** The turn shows the
|
|
179
|
+
epic's tasks in the table of rule `status-report`, not the handover's; new work is taken by the
|
|
180
|
+
owner's word, given in the permission window the guard opens on the call that takes it — not
|
|
181
|
+
guessed from the conversation. On the main branch the epic is not read.
|
|
178
182
|
<!-- rt-when: ответ владельцу о состоянии работы -->
|
|
179
183
|
|
|
180
184
|
- **A step of the plan that is not done forbids a stop, and a report about the done is not an
|
|
181
|
-
exception.** The
|
|
182
|
-
|
|
185
|
+
exception.** The engine counts the steps by their marks, and a running stage holds the turn
|
|
186
|
+
whatever the report says.
|
|
183
187
|
- **The word about a stop the guard reads from the owner, not from the executor.** Otherwise the
|
|
184
188
|
stop is declared by whoever finds it convenient, and the ban holds until the first inconvenience.
|
|
185
|
-
- **Until the
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
- **The owner's
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
- **Until the scenario is over a turn ends only by the owner's stop word or by a release case.** A question, a refusal, a
|
|
190
|
+
handover and a second pass are the turn going on: the exit guard returns each with the next move
|
|
191
|
+
named. The other release cases of the description are not the executor's to choose.
|
|
192
|
+
- **The owner's word about a stop is read from the record of the session, not from the progress.**
|
|
193
|
+
A stop written on disk by the executor is a retelling. The guard reads the owner's last message,
|
|
194
|
+
typed or the free text of a menu answer, and a stop word holds only while that message is the last.
|
|
191
195
|
- **The session is ended by the owner and by nobody else.** The tool that closes the conversation is
|
|
192
196
|
refused by a guard always, with no lawful form of bypass: an assignment stands until the owner
|
|
193
197
|
cancels it, and a session that must close is closed by them.
|
|
194
|
-
- **A refusal of a guard ends the turn
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
- **The phrase "waiting for your word" is a stop declared by the executor
|
|
198
|
-
|
|
199
|
-
the
|
|
200
|
-
|
|
201
|
-
- **A statement about the tree's state is watched by the statement guard, not by the executor's
|
|
198
|
+
- **A refusal of a guard never ends the turn.** It is answered by the next call: the condition met,
|
|
199
|
+
another step taken, or the owner's menu put to them. A refused stop — the
|
|
200
|
+
closing tool — is no exit either.
|
|
201
|
+
- **The phrase "waiting for your word" is a stop declared by the executor.** Without the owner's stop
|
|
202
|
+
word, waiting for their word is a report, not work. A decision that is theirs goes to them as a
|
|
203
|
+
menu, and the turn waits for the answer inside itself. The agent hook judges it by meaning.
|
|
204
|
+
- **A statement about the tree's state is watched by the agent hook, not by the executor's
|
|
202
205
|
memory.** Everything the reply says about the tree carries a command and its output; said without
|
|
203
|
-
one, it is no statement — not "checked", not "cleared", not "done". The
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
there is nothing to judge by: no word and no command to compare with. This is the guard's known boundary; the articles below hold it, not the guard.
|
|
211
|
-
- **A turn about someone else's step is watched by the waiting guard, not by the executor's
|
|
212
|
-
memory.** It refuses a turn's end where someone else's step was spoken of and nothing was done on
|
|
213
|
-
the next task — no task created, no branch, no folder, no column moved. Someone else's step it
|
|
214
|
-
knows by two signs: a PR opened or a red run read in the turn.
|
|
206
|
+
one, it is no statement — not "checked", not "cleared", not "done". The hook reads the reply and
|
|
207
|
+
the results of the turn's calls.
|
|
208
|
+
- **A wrong conclusion from a right command is not judged.** About a sample judged by one file there
|
|
209
|
+
is nothing to compare with. This is the hook's known boundary; the articles below hold it.
|
|
210
|
+
- **A turn that handed work in does not end before the next task is begun.** Someone else's step —
|
|
211
|
+
the run, the review, the merge — goes without the executor. Handed-in work is a measured state, and
|
|
212
|
+
its exit is the next task of the epic taken.
|
|
215
213
|
- **A turn that handed work in carries it to a lifted draft.** A draft's merge button is locked by
|
|
216
214
|
the host, and in the PR list ready cannot be told from unfinished. The next task is taken on top
|
|
217
|
-
of that, not instead.
|
|
218
|
-
handed-in work.
|
|
219
|
-
- **The waiting guard's refusal is lifted by both actions at once.** The taken next task carries the
|
|
220
|
-
open-PR sign away, and the demand to ask the handed-in work's state never sounds after it.
|
|
215
|
+
of that, not instead.
|
|
221
216
|
- **Work left in the working tree does not end the turn.** A branch ahead of the remote ref with no
|
|
222
|
-
open PR is done work nobody sees
|
|
217
|
+
open PR is done work nobody sees, and the scenario goes on until the PR.
|
|
223
218
|
- **"Waiting for the run" is a statement about someone else's step, not a work state.** A run may be
|
|
224
219
|
green in an hour, or may never have started — and the second does not fix itself. The word demands
|
|
225
220
|
a command of the same turn that shows the run; said bare, the owner reads it as "the work is still
|
|
@@ -229,14 +224,13 @@ flowchart TD
|
|
|
229
224
|
repeated idly or not at all — the work does not move.
|
|
230
225
|
- **A run nobody started by hand is watched the same as a rerun, and the opened PR starts it.** The
|
|
231
226
|
pipeline wakes by itself: the turn holds no starting command, and one read of the state closes
|
|
232
|
-
nothing. Read as going, the run goes under a wait in the same turn
|
|
233
|
-
the pair "the request opened here, its run read as going".
|
|
227
|
+
nothing. Read as going, the run goes under a wait in the same turn.
|
|
234
228
|
- **A green run is carried to a lifted draft by the one who handed the work over, a red one is
|
|
235
229
|
fixed in the same branch.** The owner sees a locked button and reads it as work still going. The
|
|
236
230
|
wait runs in the background, next to the next work.
|
|
237
231
|
- **Waiting for one's own measurement is done with one wait, not a notification on every step.** A
|
|
238
232
|
notification is for where every event is acted on; where the outcome matters — one wait.
|
|
239
|
-
- **A guard's refusal
|
|
233
|
+
- **A guard's refusal closes every other road to the refused edit.** None is sought: not a shell
|
|
240
234
|
command, not a neighbouring tool, not an edit of the guard itself. The edit is done once the
|
|
241
235
|
refusal's condition is met, or not at all — then the owner is told the refusal, not a result.
|
|
242
236
|
- **A command refused by a gate is repeated whole, not by its tail.** A gate refuses the call before
|
|
@@ -247,10 +241,9 @@ flowchart TD
|
|
|
247
241
|
For a call with a reading twin, the kind is chosen by the action, not the command's name.
|
|
248
242
|
- **A turn in which a question was put to the owner does not end until laws and rules were read in
|
|
249
243
|
that same turn.** Reading is any of three roads: loading a rule, reading a file of laws or rules,
|
|
250
|
-
a search over them.
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
rules already say".
|
|
244
|
+
a search over them. What was found lands in the grill section "What the rules already say". The
|
|
245
|
+
agent hook of the question tool holds a question a rule or a spec answers plainly; whether the
|
|
246
|
+
reading was done in the same turn no check counts.
|
|
254
247
|
- **The owner's answer is sought in their own messages before the rules.** The law says a question
|
|
255
248
|
with a written answer is not put to the owner, and the most reachable record lies in the
|
|
256
249
|
conversation: the owner's first message and their answers to past rounds.
|
|
@@ -271,11 +264,10 @@ flowchart TD
|
|
|
271
264
|
- **The sign of irreversibility is taken from the list, not derived by argument.** The list was
|
|
272
265
|
drawn up by someone who already weighed reversibility, and an argument cancels it silently. Actions outside the list the executor does not gate.
|
|
273
266
|
- **A turn in which the executor admitted a miss does not end until the incident record exists.**
|
|
274
|
-
The
|
|
275
|
-
the miss, the form — the layout template.
|
|
276
|
-
admitted in words outside the set the guard lets through.
|
|
267
|
+
The agent hook refuses at the turn's end. The records directory is named by the rule's companion,
|
|
268
|
+
the file name is the date and the miss, the form — the layout template.
|
|
277
269
|
- **A session begun from a handover enters the work by the same rule as any other.** The handover
|
|
278
|
-
|
|
270
|
+
was written by a past session, no check reads it, and it describes yesterday: everything in it is
|
|
279
271
|
checked against the tree. The entry order is four steps in the resume pattern; a guard watches it,
|
|
280
272
|
not memory.
|
|
281
273
|
- **The state of unfinished work comes into the context at session start.** The plan and the
|
|
@@ -304,12 +296,18 @@ flowchart TD
|
|
|
304
296
|
|
|
305
297
|
## What of the law is not here
|
|
306
298
|
|
|
307
|
-
Nothing checks the completeness of what is said to the owner: the
|
|
308
|
-
|
|
309
|
-
|
|
299
|
+
Nothing checks the completeness of what is said to the owner: the agent hook judges whether a result
|
|
300
|
+
of the turn shows a statement; a wrong conclusion from a right command it cannot judge — there is
|
|
301
|
+
nothing to compare with.
|
|
302
|
+
|
|
303
|
+
What a turn said is judged by a model, and a model can let a case pass. The hook is told to let a
|
|
304
|
+
doubtful turn end: a false refusal costs the owner a repeated answer, a missed one is visible in the
|
|
305
|
+
reply. A broken or timed-out hook lets every turn end, and that shows only as the absence of its
|
|
306
|
+
mark in the transcripts.
|
|
310
307
|
|
|
311
|
-
|
|
312
|
-
|
|
308
|
+
The exit guard measures, it does not judge meaning. An engine that fails, runs past its limit or
|
|
309
|
+
cannot be called releases the turn and writes the failure to the journal; the next turn begins with
|
|
310
|
+
that line.
|
|
313
311
|
|
|
314
312
|
## Patterns
|
|
315
313
|
|
|
@@ -19,7 +19,7 @@ into the session.
|
|
|
19
19
|
| --- | --- |
|
|
20
20
|
| session entry | what the startup hook puts into the context before the first reply |
|
|
21
21
|
| what the past session handed over | the "Session handover" section in the progress of this branch; for work without a task folder — a file named after the branch in the handovers directory. The hook writes it before context compaction |
|
|
22
|
-
| the order of conducting work | the turn map — the states with their mandatory actions and the
|
|
22
|
+
| the order of conducting work | the turn map — the states with their mandatory actions and the two ends of a turn |
|
|
23
23
|
| a launch | first launch, resume, context compaction, clear |
|
|
24
24
|
|
|
25
25
|
## Where it lives
|
|
@@ -41,7 +41,7 @@ flowchart TD
|
|
|
41
41
|
B2 -->|No| D[Nothing is said about a handover]
|
|
42
42
|
C --> E{The turn map resource is laid out}
|
|
43
43
|
D --> E
|
|
44
|
-
E -->|Yes| F[The map goes next: states, actions,
|
|
44
|
+
E -->|Yes| F[The map goes next: states, actions, two ends of a turn]
|
|
45
45
|
E -->|No| G[Nothing is said about a map]
|
|
46
46
|
F --> H[The hook exits with zero: the launch is refused on no outcome]
|
|
47
47
|
G --> H
|
|
@@ -7,160 +7,54 @@ description: Rule under the code-structure law. Load when editing any .ts except
|
|
|
7
7
|
|
|
8
8
|
# Code structure — how it works here
|
|
9
9
|
|
|
10
|
-
Rule under the law `docs/constitution/code-structure.md`.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## What it is called here
|
|
14
|
-
|
|
15
|
-
| In the law | Here |
|
|
16
|
-
| ----------------------------- | -------------------------------------------------------------------- |
|
|
17
|
-
| the kind sign in the name | a prefix: `I` on an interface, `E` on an enum, `T` on a type |
|
|
18
|
-
| a watched source | the `$` suffix on an observable and `Source` on a subject |
|
|
19
|
-
| a private field | `#field`, not `private field` |
|
|
20
|
-
| a backend procedure | a class with the `@ConnectProcedure()` decorator, one per procedure |
|
|
21
|
-
|
|
22
|
-
## Where it lives
|
|
23
|
-
|
|
24
|
-
In this tree — the table in `implementation.md` next to it. Paths live there, not here: the rule
|
|
25
|
-
travels between repositories, the layout does not, and a path named in the rule lies in the
|
|
26
|
-
first tree that keeps its code differently.
|
|
27
|
-
|
|
28
|
-
## Flow
|
|
29
|
-
|
|
30
|
-
The flow of declaring a symbol: what sets the name, where the type comes from and what is done
|
|
31
|
-
with a removed declaration.
|
|
32
|
-
|
|
33
|
-
```mermaid
|
|
34
|
-
flowchart TD
|
|
35
|
-
A[A symbol is declared] --> B[The kind shows in the name prefix, and the file suffix promises what lies inside]
|
|
36
|
-
B --> C{The type is already declared somewhere}
|
|
37
|
-
C -->|Yes| D[Taken from the package where it is declared: an own copy diverges from the original silently]
|
|
38
|
-
C -->|No| E[Declared here]
|
|
39
|
-
D --> F{The value arrives in the wrong shape}
|
|
40
|
-
E --> F
|
|
41
|
-
F -->|Yes| G[The cast goes by the named way; a two-step one is forbidden]
|
|
42
|
-
F -->|No| H{The declaration is removed}
|
|
43
|
-
G --> H
|
|
44
|
-
H -->|Yes| I[The deprecation mark is set together with a walk over all consumers]
|
|
45
|
-
H -->|No| J[The file stays within the length limit, complexity is asked from the plugin, not recalled]
|
|
46
|
-
I --> J
|
|
47
|
-
```
|
|
10
|
+
Rule under the law `docs/constitution/code-structure.md`. Cold part: `pitfalls.md` — the whole text,
|
|
11
|
+
every section and article with its reasons.
|
|
48
12
|
|
|
49
13
|
## How the law applies here
|
|
50
14
|
|
|
51
|
-
- **The kind of a declaration shows in the name prefix, and three linter rules hold that.**
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
- **A
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
- **
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
written in place is neither found across the tree nor edited in one go. The enum lives in the
|
|
74
|
-
`util` layer of the domain that owns the set, and what is shared by several applications — in
|
|
75
|
-
the shared lib. A single address, a separator and a signature sign do not become an enum: they
|
|
76
|
-
have no closed set, and they are declared as a file constant with a telling name.
|
|
77
|
-
<!-- rt-when: *.ts -->
|
|
78
|
-
|
|
79
|
-
- **A set that must be complete is declared as a full record over the key type, not a partial
|
|
80
|
-
one.** A partial declaration makes a missing key lawful, and the shortage shows on the screen
|
|
81
|
-
rather than at the build. The set that must answer for every key of another one is declared by
|
|
82
|
-
that key type whole, and an unfilled key stops compiling. The type is silent about the value —
|
|
83
|
-
an empty string and a copy of the key pass it — so the completeness of values is held by a test
|
|
84
|
-
that walks the whole set, written by the same change as the declaration.
|
|
85
|
-
<!-- rt-when: *.ts -->
|
|
15
|
+
- **The kind of a declaration shows in the name prefix, and three linter rules hold that.**
|
|
16
|
+
<!-- rt-when: *.ts -->
|
|
17
|
+
- **A watched source is named by a suffix.**
|
|
18
|
+
<!-- rt-when: *.ts -->
|
|
19
|
+
- **A file name suffix promises a declaration of that kind inside.**
|
|
20
|
+
<!-- rt-when: *.ts -->
|
|
21
|
+
- **A file is no longer than 500 lines, and all lines count — blank ones and comments too.**
|
|
22
|
+
<!-- rt-when: *.ts -->
|
|
23
|
+
- **A value from a closed set arrives as an enum `E<Name>`, not as a string or a number at the place
|
|
24
|
+
of use.**
|
|
25
|
+
<!-- rt-when: *.ts -->
|
|
26
|
+
- **A set that must be complete is declared as a full record over the key type, not a partial one.**
|
|
27
|
+
<!-- rt-when: *.ts -->
|
|
28
|
+
- **A type is taken from the package where it is declared.**
|
|
29
|
+
<!-- rt-when: *.ts -->
|
|
30
|
+
- **A value declared by one side of an exchange is not recomputed by the other side but taken from
|
|
31
|
+
the first.**
|
|
32
|
+
<!-- rt-when: *.ts -->
|
|
33
|
+
- **The two-step cast `as unknown as` is forbidden by a linter rule.**
|
|
34
|
+
<!-- rt-when: *.ts -->
|
|
35
|
+
- **A deprecation mark is set together with a walk over the consumers.**
|
|
36
|
+
<!-- rt-when: *.ts -->
|
|
86
37
|
|
|
87
|
-
|
|
88
|
-
diverges from the original silently, and only one of them compiles.
|
|
89
|
-
<!-- rt-when: *.ts -->
|
|
90
|
-
|
|
91
|
-
- **A value declared by one side of an exchange is not recomputed by the other side but taken
|
|
92
|
-
from the first.** Two computations of one value diverge silently: the tree trait was computed by
|
|
93
|
-
both the send and the mark — each with its own copy — the copies diverged, and the mark never
|
|
94
|
-
once found a single record of its own. Both sides answered as usual all the while, and the miss
|
|
95
|
-
was found only from a third side: by reading what actually landed.
|
|
96
|
-
<!-- rt-when: *.ts -->
|
|
97
|
-
|
|
98
|
-
- **The two-step cast `as unknown as` is forbidden by a linter rule.** Instead — an honest type,
|
|
99
|
-
narrowing by a check or reading the field by shape (`Reflect.get`); a place where nothing else
|
|
100
|
-
works is marked with a spot disable and the reason on the same line.
|
|
101
|
-
<!-- rt-when: *.ts -->
|
|
102
|
-
|
|
103
|
-
- **A deprecation mark is set together with a walk over the consumers.** All rules of
|
|
104
|
-
`eslint-plugin-sonarjs` are raised to refusal at once, and a mark on a type paints every place
|
|
105
|
-
that still calls it: one `@deprecated` per file gave seventeen findings in foreign domains.
|
|
106
|
-
<!-- rt-when: *.ts -->
|
|
107
|
-
|
|
108
|
-
## What of the law is not here
|
|
109
|
-
|
|
110
|
-
A one-step cast stays unchecked — that is `Q-CS-4` in the law: of seventy-six casts eight are
|
|
111
|
-
mandatory, and a blanket ban would refuse them.
|
|
38
|
+
## Pitfalls
|
|
112
39
|
|
|
113
|
-
|
|
114
|
-
|
|
40
|
+
- **Function complexity limits are asked from the plugin, not recalled.**
|
|
41
|
+
- **A decision is moved into a pure function of the util layer before the handler is written.**
|
|
42
|
+
- **A file an edit pushed past the 500-line limit is split, not squeezed.**
|
|
115
43
|
|
|
116
|
-
|
|
117
|
-
fall under it at all — that is `Q-CS-3` in the law. Of the two mapper forms accepted here — a
|
|
118
|
-
class on the front end and pure functions on the backend — the rule accepts both: it judges the
|
|
119
|
-
name, not the structure, and that there are two forms remains the question `Q-S-1` in the
|
|
120
|
-
shared-code law.
|
|
44
|
+
## Names and techniques
|
|
121
45
|
|
|
122
|
-
|
|
123
|
-
|
|
46
|
+
- Prefix `I` on an interface, `E` on an enum, `T` on a type.
|
|
47
|
+
- Suffix `$` on an observable, `Source` on a subject.
|
|
48
|
+
- A private field is `#field`, not `private field`; `protected` where `viewChild` needs it.
|
|
49
|
+
- An enum lives in the owner domain's `util`; a value with no closed set is a file constant.
|
|
50
|
+
- Completeness of values is held by a test over the whole set, in the same change.
|
|
51
|
+
- Use an honest type, narrowing or `Reflect.get`; else a spot disable with its reason.
|
|
52
|
+
- On `libs/api`, `apps/api` no signals or `inject`: NestJS constructor DI.
|
|
53
|
+
- No `as Type` in a mapper; use `this.typeCast`.
|
|
54
|
+
- Remove an unused parameter; do not hide it behind an underscore.
|
|
55
|
+
- Do not annotate a Prisma aggregate with a type of your own.
|
|
56
|
+
- Enable a linter rule of your own together with fixing all it catches.
|
|
124
57
|
|
|
125
58
|
## Patterns
|
|
126
59
|
|
|
127
|
-
- `ts-procedure` —
|
|
128
|
-
registration.
|
|
129
|
-
|
|
130
|
-
## Pitfalls
|
|
131
|
-
|
|
132
|
-
- **Function complexity limits are asked from the plugin, not recalled.** Where the tree raised
|
|
133
|
-
the `sonarjs` rules at once, to refusal, the branching and nesting numbers come as plugin
|
|
134
|
-
defaults and are not written by a line of their own in the config: they change with its
|
|
135
|
-
version while looking like a tree agreement. Over one task they were asked three times, each
|
|
136
|
-
time anew, and twice named from memory — both times wrong.
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
node -e 'const s = require("eslint-plugin-sonarjs");
|
|
140
|
-
for (const n of ["cyclomatic-complexity", "cognitive-complexity", "nested-control-flow"])
|
|
141
|
-
console.log(n, JSON.stringify(s.rules[n].meta.defaultOptions));'
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
- **A decision is moved into a pure function of the util layer before the handler is written.** A
|
|
145
|
-
choice over a closed set becomes a table keyed by the enumeration, and a chain of field checks
|
|
146
|
-
becomes a list of checks. The handler calls them and keeps its branchings for its own flow: the
|
|
147
|
-
complexity linter refused one file twice because both lay right in the handler and spent its limit.
|
|
148
|
-
- **A file an edit pushed past the 500-line limit is split, not squeezed.** Joining comments or
|
|
149
|
-
dropping blank lines lowers the count and leaves the file just as long to read, and the next
|
|
150
|
-
edit hits the limit again. What the file does on its own moves out next to it: a mapping, a set of
|
|
151
|
-
derived values.
|
|
152
|
-
|
|
153
|
-
- A cast through `as Type` in a mapper is forbidden but watched by nothing: it accepts any value
|
|
154
|
-
and compiles. Instead — `this.typeCast`.
|
|
155
|
-
- An unused parameter is removed, not renamed: an underscore before the name hides the finding,
|
|
156
|
-
but the parameter stays in the signature.
|
|
157
|
-
- A Prisma aggregate is not annotated with its own type: its generated type is wider than the
|
|
158
|
-
query result, and the annotation lies.
|
|
159
|
-
- A linter rule of one's own is enabled together with converting everyone it catches: enabled on
|
|
160
|
-
top of what has accumulated, it gives a red run on files the edit did not touch.
|
|
161
|
-
- `#field` is visible only inside the class and is not accepted by `viewChild` — there the field
|
|
162
|
-
is declared `protected`.
|
|
163
|
-
- The linter does not count a logical assignment as a read of a private field: where `??=` is the
|
|
164
|
-
only access to the field, the unused-private-members rule answers "is defined but never used".
|
|
165
|
-
The field is live, and the message says the opposite, and whoever read the refusal goes to
|
|
166
|
-
remove the declaration. The replacement — an explicit early return and an assignment after it.
|
|
60
|
+
- `ts-procedure` — a Connect procedure on the backend.
|