@turri-dev/cli 0.4.3-next.7ada234 → 0.4.3-next.853c640
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 +26 -4
- package/dist/banner.js +259 -0
- package/dist/capture-cli.js +50 -68
- package/dist/chat-commands.js +6 -6
- package/dist/chat-models.js +17 -15
- package/dist/chat-tab-header.js +0 -1
- package/dist/chat-tabs.js +1 -1
- package/dist/chat-terminal.js +114 -73
- package/dist/chat-waiting.js +0 -20
- package/dist/cli-options.js +11 -7
- package/dist/cli-root.js +141 -0
- package/dist/cli.js +49 -55
- package/dist/conform-cli.js +4 -6
- package/dist/cultivate-cli.js +65 -97
- package/dist/doctor-cli.js +99 -0
- package/dist/drift-cli.js +2 -7
- package/dist/entry-renderers.js +107 -0
- package/dist/extension.js +14 -3379
- package/dist/init-config-cli.js +218 -0
- package/dist/launch-cli.js +55 -91
- package/dist/lineage-cli.js +2 -4
- package/dist/loop-cli.js +118 -237
- package/dist/panel-view.js +409 -0
- package/dist/parse-cli.js +5 -2
- package/dist/pi-launch.js +37 -13
- package/dist/pi-themes.js +2 -2
- package/dist/plain-code-blocks.js +1 -1
- package/dist/print-mode.js +20 -0
- package/dist/quiet.js +7 -106
- package/dist/regenerate/diff-view.js +6 -87
- package/dist/regenerate/jobs-tree.js +2 -17
- package/dist/regenerate/spec-map-view.js +3 -68
- package/dist/regenerate-cli.js +7 -11
- package/dist/skill-progress.js +25 -0
- package/dist/skill-report.js +52 -0
- package/dist/terminal-marks.js +21 -0
- package/dist/terminal-notifications.js +74 -19
- package/dist/terminal-view.js +239 -0
- package/dist/turri-versions.js +64 -6
- package/docs/README.md +3 -3
- package/docs/capture.md +79 -180
- package/docs/chats.md +4 -4
- package/docs/claude-subscription.md +1 -1
- package/docs/config.md +7 -9
- package/docs/development.md +30 -64
- package/docs/headless.md +3 -1
- package/docs/hosting.md +3 -251
- package/docs/installation.md +5 -3
- package/docs/launch.md +1 -1
- package/docs/sentinel.md +3 -3
- package/docs/using.md +6 -6
- package/package.json +13 -31
- package/dist/ask.d.ts +0 -90
- package/dist/ask.js +0 -170
- package/dist/background-skills.d.ts +0 -56
- package/dist/background-skills.js +0 -129
- package/dist/bedrock-region.d.ts +0 -66
- package/dist/bedrock-region.js +0 -144
- package/dist/brand.d.ts +0 -13
- package/dist/btw.d.ts +0 -69
- package/dist/btw.js +0 -174
- package/dist/capture/agents.d.ts +0 -406
- package/dist/capture/agents.js +0 -379
- package/dist/capture/area.d.ts +0 -58
- package/dist/capture/area.js +0 -197
- package/dist/capture/assemble.d.ts +0 -112
- package/dist/capture/assemble.js +0 -453
- package/dist/capture/capture.d.ts +0 -116
- package/dist/capture/capture.js +0 -1315
- package/dist/capture/chat.d.ts +0 -29
- package/dist/capture/chat.js +0 -94
- package/dist/capture/checks.d.ts +0 -142
- package/dist/capture/checks.js +0 -649
- package/dist/capture/config.d.ts +0 -13
- package/dist/capture/config.js +0 -66
- package/dist/capture/interface.d.ts +0 -71
- package/dist/capture/interface.js +0 -199
- package/dist/capture/map.d.ts +0 -56
- package/dist/capture/map.js +0 -530
- package/dist/capture/models.d.ts +0 -4
- package/dist/capture/models.js +0 -16
- package/dist/capture/plan.d.ts +0 -7
- package/dist/capture/plan.js +0 -13
- package/dist/capture/progress.d.ts +0 -111
- package/dist/capture/progress.js +0 -266
- package/dist/capture/python-interface.d.ts +0 -3
- package/dist/capture/python-interface.js +0 -17
- package/dist/capture/report.d.ts +0 -75
- package/dist/capture/report.js +0 -268
- package/dist/capture/runners.d.ts +0 -6
- package/dist/capture/runners.js +0 -59
- package/dist/capture/scripts.d.ts +0 -26
- package/dist/capture/scripts.js +0 -38
- package/dist/capture/state.d.ts +0 -310
- package/dist/capture/state.js +0 -43
- package/dist/capture/trial.d.ts +0 -34
- package/dist/capture/trial.js +0 -89
- package/dist/capture-cli.d.ts +0 -1
- package/dist/chat-commands.d.ts +0 -17
- package/dist/chat-idle.d.ts +0 -7
- package/dist/chat-idle.js +0 -20
- package/dist/chat-models.d.ts +0 -22
- package/dist/chat-records.d.ts +0 -50
- package/dist/chat-records.js +0 -107
- package/dist/chat-scope.d.ts +0 -14
- package/dist/chat-scope.js +0 -15
- package/dist/chat-skills.d.ts +0 -17
- package/dist/chat-skills.js +0 -18
- package/dist/chat-tab-header.d.ts +0 -16
- package/dist/chat-tabs.d.ts +0 -26
- package/dist/chat-terminal.d.ts +0 -24
- package/dist/chat-ui.d.ts +0 -33
- package/dist/chat-waiting.d.ts +0 -67
- package/dist/chats.d.ts +0 -346
- package/dist/chats.js +0 -1022
- package/dist/cli-options.d.ts +0 -24
- package/dist/cli.d.ts +0 -9
- package/dist/config-edit.d.ts +0 -83
- package/dist/config-edit.js +0 -393
- package/dist/config.d.ts +0 -428
- package/dist/config.js +0 -816
- package/dist/conform-cli.d.ts +0 -1
- package/dist/conformance-switch.d.ts +0 -25
- package/dist/conformance-switch.js +0 -86
- package/dist/cultivate-cli.d.ts +0 -1
- package/dist/doctor-tool.d.ts +0 -11
- package/dist/doctor-tool.js +0 -33
- package/dist/drift-cli.d.ts +0 -1
- package/dist/environment.d.ts +0 -37
- package/dist/environment.js +0 -109
- package/dist/extension.d.ts +0 -209
- package/dist/genome.d.ts +0 -77
- package/dist/genome.js +0 -288
- package/dist/graph.d.ts +0 -52
- package/dist/graph.js +0 -247
- package/dist/host-session.d.ts +0 -112
- package/dist/host-session.js +0 -103
- package/dist/host.d.ts +0 -40
- package/dist/host.js +0 -54
- package/dist/identity.d.ts +0 -7
- package/dist/identity.js +0 -75
- package/dist/init-config.d.ts +0 -172
- package/dist/init-config.js +0 -867
- package/dist/installed-providers.d.ts +0 -40
- package/dist/installed-providers.js +0 -98
- package/dist/jellyfish.d.ts +0 -40
- package/dist/judge.d.ts +0 -25
- package/dist/judge.js +0 -62
- package/dist/launch-agent.d.ts +0 -62
- package/dist/launch-agent.js +0 -339
- package/dist/launch-cli.d.ts +0 -1
- package/dist/launch-session.d.ts +0 -68
- package/dist/launch-session.js +0 -225
- package/dist/launch-tools.d.ts +0 -28
- package/dist/launch-tools.js +0 -72
- package/dist/launch-track.d.ts +0 -175
- package/dist/launch-track.js +0 -497
- package/dist/lineage-cli.d.ts +0 -1
- package/dist/loop-cli.d.ts +0 -35
- package/dist/loop-tools.d.ts +0 -103
- package/dist/loop-tools.js +0 -361
- package/dist/model-check.d.ts +0 -72
- package/dist/model-check.js +0 -162
- package/dist/module-report.d.ts +0 -9
- package/dist/new-project.d.ts +0 -10
- package/dist/new-project.js +0 -42
- package/dist/notice.d.ts +0 -115
- package/dist/notice.js +0 -61
- package/dist/parse-cli.d.ts +0 -1
- package/dist/parse-tool.d.ts +0 -9
- package/dist/parse-tool.js +0 -33
- package/dist/pi-launch.d.ts +0 -1
- package/dist/pi-settings.d.ts +0 -4
- package/dist/pi-themes.d.ts +0 -3
- package/dist/pi.d.ts +0 -248
- package/dist/pi.js +0 -889
- package/dist/picture-row.d.ts +0 -10
- package/dist/plain/check.d.ts +0 -63
- package/dist/plain/check.js +0 -236
- package/dist/plain/concepts.d.ts +0 -37
- package/dist/plain/concepts.js +0 -283
- package/dist/plain/cycles.d.ts +0 -21
- package/dist/plain/cycles.js +0 -190
- package/dist/plain/errors.d.ts +0 -26
- package/dist/plain/errors.js +0 -50
- package/dist/plain/files.d.ts +0 -47
- package/dist/plain/files.js +0 -161
- package/dist/plain/graph.d.ts +0 -107
- package/dist/plain/graph.js +0 -194
- package/dist/plain/highlight.d.ts +0 -43
- package/dist/plain/highlight.js +0 -196
- package/dist/plain/index.d.ts +0 -18
- package/dist/plain/index.js +0 -18
- package/dist/plain/liquid.d.ts +0 -22
- package/dist/plain/liquid.js +0 -124
- package/dist/plain/markdown.d.ts +0 -103
- package/dist/plain/markdown.js +0 -330
- package/dist/plain/module-concepts.d.ts +0 -32
- package/dist/plain/module-concepts.js +0 -80
- package/dist/plain/parser.d.ts +0 -163
- package/dist/plain/parser.js +0 -930
- package/dist/plain/plain.tmLanguage.json +0 -150
- package/dist/plain/project.d.ts +0 -48
- package/dist/plain/project.js +0 -155
- package/dist/plain/spec.d.ts +0 -152
- package/dist/plain/spec.js +0 -265
- package/dist/plain/stdlib.d.ts +0 -16
- package/dist/plain/stdlib.js +0 -48
- package/dist/plain/test-plain-file.d.ts +0 -59
- package/dist/plain/test-plain-file.js +0 -232
- package/dist/plain-code-blocks.d.ts +0 -14
- package/dist/plain-files.d.ts +0 -21
- package/dist/plain-files.js +0 -156
- package/dist/pointer-hover.d.ts +0 -12
- package/dist/question-dialog.d.ts +0 -60
- package/dist/questioning.d.ts +0 -55
- package/dist/questioning.js +0 -109
- package/dist/quiet.d.ts +0 -34
- package/dist/regenerate/activity.d.ts +0 -227
- package/dist/regenerate/activity.js +0 -250
- package/dist/regenerate/agent-env.d.ts +0 -51
- package/dist/regenerate/agent-env.js +0 -315
- package/dist/regenerate/agent-shell.d.ts +0 -54
- package/dist/regenerate/agent-shell.js +0 -121
- package/dist/regenerate/arbiter.d.ts +0 -68
- package/dist/regenerate/arbiter.js +0 -133
- package/dist/regenerate/audit.d.ts +0 -69
- package/dist/regenerate/audit.js +0 -212
- package/dist/regenerate/base-folder.d.ts +0 -70
- package/dist/regenerate/base-folder.js +0 -186
- package/dist/regenerate/cases.d.ts +0 -12
- package/dist/regenerate/cases.js +0 -149
- package/dist/regenerate/change-view.d.ts +0 -23
- package/dist/regenerate/change-view.js +0 -153
- package/dist/regenerate/chunk-plan.d.ts +0 -217
- package/dist/regenerate/chunk-plan.js +0 -937
- package/dist/regenerate/codebase.d.ts +0 -21
- package/dist/regenerate/codebase.js +0 -75
- package/dist/regenerate/command-check.d.ts +0 -66
- package/dist/regenerate/command-check.js +0 -577
- package/dist/regenerate/compaction.d.ts +0 -13
- package/dist/regenerate/compaction.js +0 -20
- package/dist/regenerate/confine.d.ts +0 -69
- package/dist/regenerate/confine.js +0 -311
- package/dist/regenerate/conform.d.ts +0 -66
- package/dist/regenerate/conform.js +0 -132
- package/dist/regenerate/conformance-agents.d.ts +0 -388
- package/dist/regenerate/conformance-agents.js +0 -1162
- package/dist/regenerate/conformance.d.ts +0 -191
- package/dist/regenerate/conformance.js +0 -1035
- package/dist/regenerate/conversation-writes.d.ts +0 -10
- package/dist/regenerate/conversation-writes.js +0 -100
- package/dist/regenerate/credentials.d.ts +0 -18
- package/dist/regenerate/credentials.js +0 -88
- package/dist/regenerate/debug-log.d.ts +0 -56
- package/dist/regenerate/debug-log.js +0 -236
- package/dist/regenerate/debugger.d.ts +0 -36
- package/dist/regenerate/debugger.js +0 -133
- package/dist/regenerate/delivery.d.ts +0 -2
- package/dist/regenerate/diagnose-job.d.ts +0 -2
- package/dist/regenerate/diagnose-job.js +0 -40
- package/dist/regenerate/diagnose.d.ts +0 -46
- package/dist/regenerate/diagnose.js +0 -92
- package/dist/regenerate/diff-view.d.ts +0 -64
- package/dist/regenerate/drift.d.ts +0 -120
- package/dist/regenerate/drift.js +0 -285
- package/dist/regenerate/environment-error.d.ts +0 -167
- package/dist/regenerate/environment-error.js +0 -342
- package/dist/regenerate/failure-reports.d.ts +0 -28
- package/dist/regenerate/failure-reports.js +0 -79
- package/dist/regenerate/job-log.d.ts +0 -30
- package/dist/regenerate/job-log.js +0 -105
- package/dist/regenerate/job-panel.d.ts +0 -20
- package/dist/regenerate/job-panel.js +0 -54
- package/dist/regenerate/jobs-tree.d.ts +0 -76
- package/dist/regenerate/jobs.d.ts +0 -231
- package/dist/regenerate/jobs.js +0 -522
- package/dist/regenerate/lanes.d.ts +0 -16
- package/dist/regenerate/lanes.js +0 -32
- package/dist/regenerate/launch.d.ts +0 -256
- package/dist/regenerate/launch.js +0 -689
- package/dist/regenerate/ledger-view.d.ts +0 -87
- package/dist/regenerate/ledger-view.js +0 -325
- package/dist/regenerate/ledger.d.ts +0 -368
- package/dist/regenerate/ledger.js +0 -357
- package/dist/regenerate/lineage.d.ts +0 -105
- package/dist/regenerate/lineage.js +0 -485
- package/dist/regenerate/list-arguments.d.ts +0 -21
- package/dist/regenerate/list-arguments.js +0 -121
- package/dist/regenerate/loop.d.ts +0 -423
- package/dist/regenerate/loop.js +0 -2087
- package/dist/regenerate/masking.d.ts +0 -19
- package/dist/regenerate/masking.js +0 -95
- package/dist/regenerate/model-names.d.ts +0 -33
- package/dist/regenerate/model-names.js +0 -92
- package/dist/regenerate/notes.d.ts +0 -159
- package/dist/regenerate/notes.js +0 -446
- package/dist/regenerate/os-sandbox.d.ts +0 -93
- package/dist/regenerate/os-sandbox.js +0 -283
- package/dist/regenerate/panel-dock.d.ts +0 -23
- package/dist/regenerate/paths.d.ts +0 -110
- package/dist/regenerate/paths.js +0 -190
- package/dist/regenerate/plain-palette.d.ts +0 -34
- package/dist/regenerate/prompt.d.ts +0 -230
- package/dist/regenerate/prompt.js +0 -741
- package/dist/regenerate/pulse-files.d.ts +0 -14
- package/dist/regenerate/pulse-files.js +0 -63
- package/dist/regenerate/records.d.ts +0 -132
- package/dist/regenerate/records.js +0 -327
- package/dist/regenerate/regenerate.d.ts +0 -106
- package/dist/regenerate/regenerate.js +0 -660
- package/dist/regenerate/regression.d.ts +0 -58
- package/dist/regenerate/regression.js +0 -188
- package/dist/regenerate/renames.d.ts +0 -42
- package/dist/regenerate/renames.js +0 -185
- package/dist/regenerate/requires.d.ts +0 -117
- package/dist/regenerate/requires.js +0 -377
- package/dist/regenerate/resources.d.ts +0 -57
- package/dist/regenerate/resources.js +0 -162
- package/dist/regenerate/scripts-being-written.d.ts +0 -19
- package/dist/regenerate/scripts-being-written.js +0 -30
- package/dist/regenerate/self-check.d.ts +0 -29
- package/dist/regenerate/self-check.js +0 -119
- package/dist/regenerate/services.d.ts +0 -28
- package/dist/regenerate/services.js +0 -158
- package/dist/regenerate/shell.d.ts +0 -91
- package/dist/regenerate/shell.js +0 -320
- package/dist/regenerate/side-panel.d.ts +0 -64
- package/dist/regenerate/spec-map-view.d.ts +0 -147
- package/dist/regenerate/spec-map.d.ts +0 -160
- package/dist/regenerate/spec-map.js +0 -596
- package/dist/regenerate/spec-steps.d.ts +0 -180
- package/dist/regenerate/spec-steps.js +0 -729
- package/dist/regenerate/standing.d.ts +0 -28
- package/dist/regenerate/standing.js +0 -30
- package/dist/regenerate/state.d.ts +0 -21
- package/dist/regenerate/state.js +0 -10
- package/dist/regenerate/steering.d.ts +0 -56
- package/dist/regenerate/steering.js +0 -119
- package/dist/regenerate/stop-report.d.ts +0 -43
- package/dist/regenerate/stop-report.js +0 -160
- package/dist/regenerate/submit-work.d.ts +0 -44
- package/dist/regenerate/submit-work.js +0 -76
- package/dist/regenerate/test-kinds.d.ts +0 -85
- package/dist/regenerate/test-kinds.js +0 -171
- package/dist/regenerate/test-scripts.d.ts +0 -240
- package/dist/regenerate/test-scripts.js +0 -847
- package/dist/regenerate/testing-steps.d.ts +0 -52
- package/dist/regenerate/testing-steps.js +0 -129
- package/dist/regenerate/testing.d.ts +0 -150
- package/dist/regenerate/testing.js +0 -438
- package/dist/regenerate/transcript-view.d.ts +0 -21
- package/dist/regenerate/unit-gate.d.ts +0 -27
- package/dist/regenerate/unit-gate.js +0 -20
- package/dist/regenerate/unit-review.d.ts +0 -152
- package/dist/regenerate/unit-review.js +0 -361
- package/dist/regenerate/web.d.ts +0 -61
- package/dist/regenerate/web.js +0 -256
- package/dist/regenerate/workspace.d.ts +0 -12
- package/dist/regenerate/workspace.js +0 -99
- package/dist/regenerate-cli.d.ts +0 -1
- package/dist/reopen.d.ts +0 -29
- package/dist/reopen.js +0 -47
- package/dist/resume-line.d.ts +0 -5
- package/dist/review/live.d.ts +0 -72
- package/dist/review/live.js +0 -166
- package/dist/rules.d.ts +0 -20
- package/dist/rules.js +0 -47
- package/dist/run-report.d.ts +0 -88
- package/dist/run-report.js +0 -338
- package/dist/screen-padding.d.ts +0 -28
- package/dist/self-invocation.d.ts +0 -36
- package/dist/self-invocation.js +0 -137
- package/dist/sentinel-chat.d.ts +0 -19
- package/dist/sentinel-chat.js +0 -226
- package/dist/sentinel-check.d.ts +0 -36
- package/dist/sentinel-check.js +0 -78
- package/dist/sentinel.d.ts +0 -107
- package/dist/sentinel.js +0 -601
- package/dist/settings.d.ts +0 -45
- package/dist/settings.js +0 -378
- package/dist/setup.d.ts +0 -97
- package/dist/setup.js +0 -436
- package/dist/skill-progress.d.ts +0 -46
- package/dist/skill.d.ts +0 -102
- package/dist/skill.js +0 -147
- package/dist/skills.d.ts +0 -54
- package/dist/skills.js +0 -111
- package/dist/spawn-async.d.ts +0 -18
- package/dist/spawn-async.js +0 -35
- package/dist/stack.d.ts +0 -80
- package/dist/stack.js +0 -206
- package/dist/stdlib.d.ts +0 -43
- package/dist/stdlib.js +0 -118
- package/dist/surface.d.ts +0 -5
- package/dist/surface.js +0 -18
- package/dist/terminal-images.d.ts +0 -2
- package/dist/terminal-notifications.d.ts +0 -37
- package/dist/test-plain-files.d.ts +0 -41
- package/dist/test-plain-files.js +0 -172
- package/dist/tools.d.ts +0 -101
- package/dist/tools.js +0 -242
- package/dist/turri-versions.d.ts +0 -71
- package/genome/capture/capture.md +0 -26
- package/genome/capture/check-conventions.md +0 -5
- package/genome/capture/check-reference.md +0 -12
- package/genome/capture/compact.md +0 -7
- package/genome/capture/concepts.md +0 -3
- package/genome/capture/divide.md +0 -9
- package/genome/capture/feature.md +0 -45
- package/genome/capture/interface.md +0 -9
- package/genome/capture/modules.md +0 -25
- package/genome/capture/outline.md +0 -11
- package/genome/capture/python-interface.py +0 -111
- package/genome/capture/readability.md +0 -12
- package/genome/capture/reference.md +0 -10
- package/genome/capture/runners/python-requirements.sh +0 -67
- package/genome/capture/split.md +0 -9
- package/genome/capture/survey.md +0 -39
- package/genome/capture/trial.md +0 -18
- package/genome/capture/verify.md +0 -7
- package/genome/rules/bullet-continuation.md +0 -61
- package/genome/rules/concise-specs-examples.md +0 -460
- package/genome/rules/concise-specs-integration-examples.md +0 -281
- package/genome/rules/concise-specs.md +0 -80
- package/genome/rules/definitions.md +0 -107
- package/genome/rules/examples/integration-embedded-testing/run_conformance_tests_java.sh +0 -161
- package/genome/rules/examples/integration-embedded-testing/run_unittests_java.sh +0 -50
- package/genome/rules/exported-concepts.md +0 -39
- package/genome/rules/func-specs.md +0 -164
- package/genome/rules/impl-reqs.md +0 -68
- package/genome/rules/import-modules.md +0 -49
- package/genome/rules/integration-embedded-testing.md +0 -273
- package/genome/rules/integration-embedded.md +0 -171
- package/genome/rules/integration-standalone.md +0 -135
- package/genome/rules/integrations.md +0 -136
- package/genome/rules/linked-resources.md +0 -76
- package/genome/rules/module-structure.md +0 -112
- package/genome/rules/project-model.md +0 -69
- package/genome/rules/required-concepts.md +0 -44
- package/genome/rules/requires-modules.md +0 -81
- package/genome/rules/semantic-ids.md +0 -49
- package/genome/rules/stdlib.md +0 -37
- package/genome/rules/test-plain-files.md +0 -138
- package/genome/rules/test-reqs.md +0 -57
- package/genome/rules/turri-regeneration.md +0 -66
- package/genome/skills/analyze-2-func-specs/SKILL.md +0 -116
- package/genome/skills/analyze-func-specs/SKILL.md +0 -137
- package/genome/skills/break-down-func-spec/SKILL.md +0 -229
- package/genome/skills/consolidate-concepts/SKILL.md +0 -192
- package/genome/skills/convert-old-syntax/SKILL.md +0 -68
- package/genome/skills/convert-old-syntax/references/rubric.md +0 -11
- package/genome/skills/debug-specs/SKILL.md +0 -194
- package/genome/skills/implement-conformance-testing-script/SKILL.md +0 -247
- package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_cypress.ps1 +0 -337
- package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_golang.ps1 +0 -111
- package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_java.sh +0 -151
- package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.ps1 +0 -103
- package/genome/skills/implement-conformance-testing-script/assets/run_conformance_tests_python.sh +0 -146
- package/genome/skills/implement-unit-testing-script/SKILL.md +0 -171
- package/genome/skills/implement-unit-testing-script/assets/run_unittests_flutter.ps1 +0 -87
- package/genome/skills/implement-unit-testing-script/assets/run_unittests_golang.ps1 +0 -73
- package/genome/skills/implement-unit-testing-script/assets/run_unittests_java.sh +0 -82
- package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.ps1 +0 -81
- package/genome/skills/implement-unit-testing-script/assets/run_unittests_python.sh +0 -102
- package/genome/skills/implement-unit-testing-script/assets/run_unittests_react.ps1 +0 -87
- package/genome/skills/refactor-module/SKILL.md +0 -218
- package/genome/skills/resolve-section-ownership/SKILL.md +0 -64
- package/genome/skills/resolve-spec-conflict/SKILL.md +0 -102
- package/stdlib/backend/common.plain +0 -25
- package/stdlib/backend/conformance/common.plain +0 -12
- package/stdlib/backend/conformance/go-gin.plain +0 -9
- package/stdlib/backend/conformance/go-nethttp.plain +0 -9
- package/stdlib/backend/conformance/java-springboot.plain +0 -9
- package/stdlib/backend/conformance/python-django.plain +0 -9
- package/stdlib/backend/conformance/python-fastapi.plain +0 -9
- package/stdlib/backend/conformance/python-flask.plain +0 -9
- package/stdlib/backend/conformance/rust-axum.plain +0 -9
- package/stdlib/backend/conformance/typescript-express.plain +0 -9
- package/stdlib/backend/conformance/typescript-fastify.plain +0 -9
- package/stdlib/backend/conformance/typescript-nestjs.plain +0 -9
- package/stdlib/backend/go-gin.plain +0 -18
- package/stdlib/backend/go-nethttp.plain +0 -18
- package/stdlib/backend/java-springboot.plain +0 -19
- package/stdlib/backend/python-django.plain +0 -19
- package/stdlib/backend/python-fastapi.plain +0 -23
- package/stdlib/backend/python-flask.plain +0 -23
- package/stdlib/backend/rust-axum.plain +0 -17
- package/stdlib/backend/typescript-express.plain +0 -19
- package/stdlib/backend/typescript-fastify.plain +0 -19
- package/stdlib/backend/typescript-nestjs.plain +0 -19
- package/stdlib/cli/common.plain +0 -17
- package/stdlib/cli/conformance/common.plain +0 -11
- package/stdlib/cli/conformance/go-cobra.plain +0 -9
- package/stdlib/cli/conformance/go-flag.plain +0 -9
- package/stdlib/cli/conformance/java-picocli.plain +0 -9
- package/stdlib/cli/conformance/python-argparse.plain +0 -9
- package/stdlib/cli/conformance/python-click.plain +0 -9
- package/stdlib/cli/conformance/python-typer.plain +0 -9
- package/stdlib/cli/conformance/rust-clap.plain +0 -9
- package/stdlib/cli/conformance/typescript-commander.plain +0 -9
- package/stdlib/cli/go-cobra.plain +0 -14
- package/stdlib/cli/go-flag.plain +0 -14
- package/stdlib/cli/java-picocli.plain +0 -15
- package/stdlib/cli/python-argparse.plain +0 -18
- package/stdlib/cli/python-click.plain +0 -16
- package/stdlib/cli/python-typer.plain +0 -16
- package/stdlib/cli/rust-clap.plain +0 -14
- package/stdlib/cli/typescript-commander.plain +0 -17
- package/stdlib/frontend/angular.plain +0 -17
- package/stdlib/frontend/common.plain +0 -17
- package/stdlib/frontend/conformance/angular.plain +0 -5
- package/stdlib/frontend/conformance/common.plain +0 -11
- package/stdlib/frontend/conformance/react-vite.plain +0 -5
- package/stdlib/frontend/conformance/sveltekit-spa.plain +0 -5
- package/stdlib/frontend/conformance/vue-vite.plain +0 -5
- package/stdlib/frontend/react-vite.plain +0 -16
- package/stdlib/frontend/sveltekit-spa.plain +0 -16
- package/stdlib/frontend/vue-vite.plain +0 -16
- package/stdlib/lang/go.plain +0 -13
- package/stdlib/lang/java.plain +0 -12
- package/stdlib/lang/python.plain +0 -18
- package/stdlib/lang/rust.plain +0 -12
- package/stdlib/lang/typescript.plain +0 -13
- package/stdlib/library/common.plain +0 -15
- package/stdlib/library/conformance/common.plain +0 -9
- package/stdlib/library/conformance/go.plain +0 -9
- package/stdlib/library/conformance/java-gradle.plain +0 -9
- package/stdlib/library/conformance/java-maven.plain +0 -9
- package/stdlib/library/conformance/python.plain +0 -9
- package/stdlib/library/conformance/rust.plain +0 -9
- package/stdlib/library/conformance/typescript.plain +0 -9
- package/stdlib/library/go.plain +0 -12
- package/stdlib/library/java-gradle.plain +0 -13
- package/stdlib/library/java-maven.plain +0 -13
- package/stdlib/library/python.plain +0 -13
- package/stdlib/library/rust.plain +0 -12
- package/stdlib/library/typescript.plain +0 -15
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Rules for authoring ***plain for REST API integrations
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Rules for writing integrations in `***plain`
|
|
6
|
-
|
|
7
|
-
When writing or editing a `.plain` file that describes an **integration** against a REST API (synchronous JSON/HTTP request-response plus webhook callbacks), always follow these rules. Non-REST integrations (gRPC, GraphQL, SOAP, message brokers, raw TCP, file drops) are out of scope of these rules.
|
|
8
|
-
|
|
9
|
-
## Scope of "integration" ***plain
|
|
10
|
-
- An integration `.plain` module describes how the project talks to a **third-party or internal REST API**
|
|
11
|
-
- The integration may be **embedded** (lives as a library/module inside an existing host codebase) — see [`integration-embedded.md`](integration-embedded.md) for the additional rules that apply
|
|
12
|
-
- Or **standalone** (a service, daemon, CLI, scheduled job, or container) — see [`integration-standalone.md`](integration-standalone.md) for the additional rules that apply
|
|
13
|
-
- The contract surface, edge-case coverage, live-API cross-check, and `resources/` layout described below apply to **both** shapes — the shape-specific rule files add to them, never replace them
|
|
14
|
-
|
|
15
|
-
## Contract artifacts live in `resources/` (hard rule)
|
|
16
|
-
|
|
17
|
-
**Every structural contract the integration deals with — endpoint definitions, request/response schemas, error envelopes, webhook payloads, pagination envelopes, rate-limit headers, the integration's own I/O contract — lives in `resources/` as a linked resource.** Concepts and functional specs **reference** these files; they never restate fields, types, status codes, or header names inline.
|
|
18
|
-
|
|
19
|
-
Pick the right format per artifact:
|
|
20
|
-
|
|
21
|
-
| Artifact | Format | Conventional path |
|
|
22
|
-
|----------|--------|-------------------|
|
|
23
|
-
| Provider's REST surface | OpenAPI 3.1 (YAML or JSON) | `resources/<provider>.openapi.yaml` |
|
|
24
|
-
| Webhook payload (per event type) | JSON Schema Draft 2020-12 | `resources/webhooks/<event>.schema.json` |
|
|
25
|
-
| Rich webhook contracts (multi-channel) | AsyncAPI 2.6+ | `resources/webhooks.asyncapi.yaml` |
|
|
26
|
-
| Integration's own I/O contract | JSON Schema or OpenAPI | `resources/contract/<entry-point>.schema.json` |
|
|
27
|
-
| Configuration surface | JSON Schema | `resources/config.schema.json` |
|
|
28
|
-
| Error code → category mapping | YAML enum | `resources/error-map.yaml` |
|
|
29
|
-
| Rate-limit header inventory | YAML enum | `resources/rate-limit-headers.yaml` |
|
|
30
|
-
| Retry policy parameters | YAML enum | `resources/retry-policy.yaml` |
|
|
31
|
-
| Provider behavior with no machine-readable home | Markdown | `resources/<provider>-notes.md` |
|
|
32
|
-
|
|
33
|
-
Rules that flow from this:
|
|
34
|
-
|
|
35
|
-
- **Provider behavior is recorded, not specified.** How the provider itself works — its quota accounting, consistency guarantees, documented quirks, and any place the live API diverges from its docs — is true and worth capturing, but it is not a requirement on the software being built. Whatever has a machine-readable home in the table above goes there; the rest goes in `resources/<provider>-notes.md`. A functional spec never states provider behavior; it states what the integration does in the face of it.
|
|
36
|
-
- **Concepts carry references, not data.** An endpoint concept names the endpoint and points at its OpenAPI `paths.<path>.<method>` entry; it does not duplicate the request/response shape in concept attributes. Same for webhook concepts, error-model concepts, pagination concepts, etc.
|
|
37
|
-
- **Functional specs consume linked resources.** A functional spec describes **behavior** ("call endpoint X, parse the response, classify errors, retry on 5xx") and links to the resource that supplies the **shape**. Field names, types, and validation rules live in the resource file.
|
|
38
|
-
- **Schemas are versioned by file path.** When the provider releases a new API version, copy the new OpenAPI file to a new path (e.g. `resources/<provider>.v2.openapi.yaml`); never mutate the v1 file in place.
|
|
39
|
-
- **The coding agent generates language-native types from the resources.** For embedded integrations the coding agent reads JSON Schema / OpenAPI components and emits Pydantic / TypeScript / Go types in `plain_modules/`. The ***plain declares **which** schema to generate from, **where** the generated type should land, and **what host base class** it must subclass — but never restates the schema's fields.
|
|
40
|
-
|
|
41
|
-
A single `.plain` module can (and typically will) reference many resources. That is the intended pattern; do not try to collapse them into one mega-file.
|
|
42
|
-
|
|
43
|
-
## Live API must be cross-checked against the documentation
|
|
44
|
-
|
|
45
|
-
Documentation lies — it goes stale, omits undocumented fields, describes a different API version, papers over breaking changes. Every integration's ***plain must be grounded in what the API really returns, not what the docs claim it returns.
|
|
46
|
-
|
|
47
|
-
- **Discover the documentation links with web search first, then `fetch` all of them.** Documentation moves, gets reorganized, and is versioned — so never assume a doc URL from memory. Begin every topic by issuing **web searches with human-readable queries** to find the canonical pages, then `fetch` **every** relevant link the search surfaces — the endpoint reference, the auth guide, the webhook catalog, the error reference, the pagination/rate-limit docs, the changelog. The search step finds *which* URLs are authoritative and current; the `fetch` step retrieves their actual content. Do not stop at the first hit — fetch the full set so a topic is grounded in all of its sources, not a single page.
|
|
48
|
-
- If the environment has **no web-search tool** (only URL-based `fetch` is available), say so explicitly, construct the URL from the provider's well-known documentation root and crawl outward by `fetch`-ing that root and following its links, and ask the user for the canonical URL whenever you cannot reach the right page that way. Never substitute memory for the search-then-fetch step.
|
|
49
|
-
- **Always `fetch` the provider's documentation — even if you already "know" the API.** The only acceptable source of truth for what the API looks like *today* is the provider's own live documentation, retrieved with `fetch` at authoring time. This applies without exception — there is no API well-known enough to skip this step, and ***plain authored from memory is authored against the wrong contract. Concretely:
|
|
50
|
-
- Before authoring **any** endpoint, auth, error, pagination, or webhook concept, **web-search to locate the relevant documentation page(s), then `fetch` each one** and quote concrete details (status codes, field names, header names, error formats) directly from the fetched content into the resources under `resources/`. Never paraphrase from memory.
|
|
51
|
-
- If a documentation page is unreachable (paywall, login wall, JS-only render that `fetch` can't see), say so explicitly and ask the user for the canonical content rather than filling the gap from memory.
|
|
52
|
-
- **The fetched documentation is then cross-checked against the live API** — see the rest of this section.
|
|
53
|
-
- **Validate credentials against the live API** before authoring the ***plain that depends on them. A 2xx on a low-risk read-only endpoint (`/v1/me`, `/account`, `/whoami`, `/health`) is the gate. On 401/403, stop and resolve before continuing. The credentials should be validated against the live API before any ***plain that depends on them is authored.
|
|
54
|
-
- **Issue the minimum cross-check coverage** with `fetch`: one discovery / schema endpoint if available, one list endpoint per primary entity in scope, one single-object retrieval per primary entity, one empty/boundary response, one 404, one 400/422, and one deliberate 401.
|
|
55
|
-
- **Where the docs and the live API disagree, the live API wins** — the resource records what the API actually returns, and nothing records the disagreement itself.
|
|
56
|
-
- **Only `GET` / `HEAD` / `OPTIONS` on the cross-check.** Mutating calls (`POST`, `PATCH`, `PUT`, `DELETE`) require explicit per-call user confirmation and must target a sandbox account.
|
|
57
|
-
- **Credentials are never written to `.plain` files or summaries.** Reference them by env-var name only.
|
|
58
|
-
|
|
59
|
-
## `:ConformanceTests:` always run against the live integration (hard rule)
|
|
60
|
-
|
|
61
|
-
Integrations exist to talk to a real third-party (or internal) API. Their `:ConformanceTests:` therefore **always run against the live integration** — no VCR cassettes, no recorded fixtures, no `nock` / `WireMock` / `MSW` mocks for the calls under test. A "green" conformance run that never touched the provider proves nothing about the integration.
|
|
62
|
-
|
|
63
|
-
- The integration's `:ConformanceTests:` **must** make real network calls to the provider (typically a sandbox / staging environment, occasionally production for read-only paths). Recorded responses may back unit tests, but they are **not** a substitute for live conformance
|
|
64
|
-
- The only exceptions are paths that **cannot** be exercised live safely:
|
|
65
|
-
- **Rate-limit (429) tests** — must not exhaust the live quota; use a local mock for that specific endpoint
|
|
66
|
-
- **Deliberately destructive failure modes** (forced 5xx) the provider doesn't let you trigger — same; mock the specific endpoint Document each exception explicitly in `***test reqs***`; everything else is live by default
|
|
67
|
-
|
|
68
|
-
### Secrets come from the environment
|
|
69
|
-
|
|
70
|
-
Live conformance needs credentials. The integration's ***plain must pin every credential as **an env var name, never a literal value**, and the conformance script must read those env vars at runtime:
|
|
71
|
-
|
|
72
|
-
- **Author the env-var names in `***test reqs***`** (using `:ConformanceTests:`) and again in the auth concept. Examples: `STRIPE_API_KEY`, `GITHUB_TOKEN`, `SALESFORCE_CLIENT_ID` + `SALESFORCE_CLIENT_SECRET`. Use names that match what the provider's own docs use, so a user copying values from the provider console doesn't need to translate
|
|
73
|
-
- **The user supplies the values out-of-band**, either:
|
|
74
|
-
- in a `.env` file at the project root (`.env` is gitignored; the project ships `.env.example` with the names but no values), or
|
|
75
|
-
- exported in the shell that invokes the test scripts (CI uses the same names from its secret store)
|
|
76
|
-
- **`run_conformance_tests_<lang>` reads the env vars at runtime.** If a required var is missing, the script must fail fast with `Error: <NAME> is required for :ConformanceTests:` and exit `69` (per the testing-script exit-code conventions). Never default to a placeholder, never use a value baked into the script
|
|
77
|
-
- **The script may optionally load a `.env` file** before running the suite — typical pattern is to look for `.env` in the project root and `source` / `dotenv -e` it if present, but never fail when it's absent (since CI provides the vars directly via the shell). If a `.env` loader is used, the script must verify each required var is set **after** loading, not before
|
|
78
|
-
- **The conformance suite reads the same env-var names** the integration's runtime reads — so a credential that works at runtime is the same credential that exercises the suite
|
|
79
|
-
- **Credentials never appear in `.plain` files, commits, summaries, logs, or fixtures.** The cross-check (see *Live API must be cross-checked*) already requires redacting credentials from saved fixtures; the same rule applies to conformance logs
|
|
80
|
-
|
|
81
|
-
The `.plain` file should make this discoverable. A minimal `***test reqs***` block for an integration looks like:
|
|
82
|
-
|
|
83
|
-
```plain
|
|
84
|
-
- :ConformanceTests: run against the live :ProviderName: sandbox — no mocking of provider calls.
|
|
85
|
-
- Credentials are read from the environment, never from a file checked into the repo.
|
|
86
|
-
- The conformance script reads `<PROVIDER>_API_KEY` (and any additional secrets) from the shell or from a `.env` file at the project root.
|
|
87
|
-
- The script must verify every required env var is set after the optional `.env` load and fail fast with a clear error if any is missing.
|
|
88
|
-
- The 429 (rate-limit) and forced-5xx paths use a local mock for that specific endpoint; every other path is live.
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## Embedded vs standalone — pick the shape early
|
|
92
|
-
|
|
93
|
-
Every integration is either **embedded** (lives as a library/module inside an existing host codebase) or **standalone** (a service, daemon, CLI, scheduled job, or container). The choice is captured as a concept (`integration-shape: embedded | standalone`) so later functional specs can reference it.
|
|
94
|
-
|
|
95
|
-
The contract artifact itself is **identical** across both shapes: a JSON Schema (or OpenAPI) file under `resources/contract/`. What changes is **what the coding agent emits from it** and **what extra context the ***plain carries**:
|
|
96
|
-
|
|
97
|
-
- **Embedded** → the coding agent generates a host-language class from the schema and wires it into the host's import path. The host codebase dictates the tech stack — see [`integration-embedded.md`](integration-embedded.md) for the full ruleset
|
|
98
|
-
- **Standalone** → the coding agent treats the schema as the public artifact: it generates an internal implementation in `plain_modules/` and ships the schema verbatim for external consumers. The integration owns its stack — see [`integration-standalone.md`](integration-standalone.md) for the full ruleset
|
|
99
|
-
|
|
100
|
-
## Edge-case coverage is a hard floor, not a stretch goal
|
|
101
|
-
|
|
102
|
-
A production-ready integration's ***plain captures every corner case the API can throw at the integration. Each of the following must be in the ***plain (or explicitly recorded as "not applicable" / "not in scope" with the user's acknowledgement) before the integration is considered complete:
|
|
103
|
-
|
|
104
|
-
- **Provider, purpose, canonical documentation URL(s)** as concepts
|
|
105
|
-
- **Endpoints in scope** in `resources/<provider>.openapi.yaml`, one `paths.<path>.<method>` entry per endpoint; endpoint concepts link to the OpenAPI entry
|
|
106
|
-
- **Auth scheme**, credential source pinned by env-var name, refresh policy, scopes — with `components.securitySchemes` in the OpenAPI matching
|
|
107
|
-
- **Environments** (sandbox / staging / production) and the switch mechanism — reflected in `servers` of the OpenAPI file
|
|
108
|
-
- **API version pinning** strategy (URL path, header, `Accept`, query string) and the deprecation policy
|
|
109
|
-
- **Request serialization** (content type, date format, numeric precision, custom headers) in `components.schemas` / `components.parameters`
|
|
110
|
-
- **Pagination model** as `components.schemas.PageEnvelope` plus `resources/pagination.yaml` (style, defaults, safety cap)
|
|
111
|
-
- **Rate-limit model** as `resources/rate-limit-headers.yaml` + `resources/rate-limits.yaml` + `components.schemas.RateLimitError`
|
|
112
|
-
- **Error model** as `components.schemas.ErrorEnvelope` + `resources/error-map.yaml`, with one functional spec per error category
|
|
113
|
-
- **Retry policy** in `resources/retry-policy.yaml`
|
|
114
|
-
- **Transient vs. permanent exception classification** — every error the integration can raise is classified as either *transient* (retryable per the retry policy above) or *permanent* (surfaced to the caller immediately). The classification lives in `resources/error-map.yaml` (per-status-code) and in the integration's own exception hierarchy concept, and the two must agree. Concretely:
|
|
115
|
-
- **Transient by default**: network-level errors (`ConnectionError` / equivalent, DNS failure, socket timeout, TLS handshake failure, connection reset), HTTP 408, 425, 429, 500, 502, 503, 504, and any provider-specific application-level error codes the docs / live API mark as retryable (e.g. Stripe's `lock_timeout`, AWS `ThrottlingException`)
|
|
116
|
-
- **Permanent by default**: every other 4xx (400, 401, 403, 404, 405, 409, 410, 415, 422, …), schema-validation failures on otherwise-2xx responses, signature-verification failures on webhooks, and any provider error code the docs / live API mark as non-retryable
|
|
117
|
-
- **Integration exception hierarchy**: the integration exposes a base exception class (e.g. `<Provider>Error`) with two direct subclasses, `<Provider>TransientError` (raised after the retry policy gives up on a transient condition) and `<Provider>PermanentError` (raised immediately on a permanent condition). Every concrete exception inherits from exactly one of those two — callers branch on the base class, never on individual subclasses
|
|
118
|
-
- **The classification is data-driven**, not code-driven — `resources/error-map.yaml` is the source of truth, the coding agent reads it to generate the exception hierarchy and the `is_transient(error) -> bool` predicate. ***plain never enumerates status codes inline
|
|
119
|
-
- **Discrepancies found during the live-API cross-check override the docs** — if the docs say a code is transient but the live API never recovers from it (or vice versa), the live behavior wins and the divergence is recorded in `error-map.yaml` plus a note in the error-model concept ("docs claim X retryable, live API returns Y permanently; we follow the live API")
|
|
120
|
-
- **Idempotency strategy** in `resources/idempotency.yaml` + idempotency header in `components.parameters`
|
|
121
|
-
- **Webhook contracts** as `resources/webhooks/<event>.schema.json` per event type + `resources/webhook-signing.yaml`
|
|
122
|
-
- **Data mapping** (entity schemas + transformations / exclusions) as entity schemas + `resources/data-mapping.yaml`
|
|
123
|
-
- **Compliance / data-sensitivity** constraints (PII, PHI, payment data, data residency, log redaction, audit logs)
|
|
124
|
-
- **Observability** (log fields, provider request IDs, metrics, tracing propagation)
|
|
125
|
-
|
|
126
|
-
## Anti-patterns (do not do these)
|
|
127
|
-
|
|
128
|
-
- **Restating an OpenAPI / JSON Schema field list in a concept or functional spec.** The schema lives in `resources/`; the ***plain links to it
|
|
129
|
-
- **Pasting a webhook payload, error envelope, or list-endpoint response inline.** Describe its shape in the applicable schema under `resources/` and link that schema
|
|
130
|
-
- **Inlining a host base class body into the contract spec.** Add the host file as a linked resource under `resources/host/` and reference it by FQN
|
|
131
|
-
- **Embedding credentials, tokens, or signing keys in a `.plain` file or in a summary** — credentials are referenced by env-var name only
|
|
132
|
-
- **Authoring against unverified credentials.** Validate first; if the user has no credentials yet, flag it in the module's frontmatter description and re-validate once credentials arrive
|
|
133
|
-
- **`requires`-ing a separate-stack module** (a Python backend `requires`-ing a React frontend, or vice versa) — see [`requires-modules.md`](requires-modules.md). Use a shared API schema in `resources/` instead
|
|
134
|
-
- **Authoring the integration's functional specs from the docs first and "reconciling" with the live API later.** Probe the API as you reach each topic; the live response is the source of truth from the moment it's captured
|
|
135
|
-
- **Writing any integration's ***plain from memory of the provider's API instead of web-searching for its documentation and `fetch`-ing every relevant page first.** No matter how well-known the API (Stripe, GitHub, Slack, Salesforce, AWS, OpenAI, …), the canonical pages must be located with web search and then retrieved with `fetch` at authoring time — see *Live API must be cross-checked against the documentation*. Authoring from memory bakes in whatever version of the API was current during training, which is always older than the version the integration will actually call
|
|
136
|
-
- **Guessing a documentation URL from memory and `fetch`-ing it without searching first.** A remembered URL may 404, redirect to a stale version, or miss the page that actually documents the topic. Search to find the authoritative, current links, then fetch the full set
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Rules for linking external resources from .plain files
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Rules for linked resources in `.plain` files
|
|
6
|
-
|
|
7
|
-
***plain can reference external files using markdown link syntax. turri reads the linked file's bytes verbatim and feeds them to the coding agent alongside the ***plain. That mechanism only works for a specific shape of target — violating any of the rules below is one of the most common and disruptive mistakes in `.plain` authoring.
|
|
8
|
-
|
|
9
|
-
## Hard constraint: a linked resource is always a single file on disk - text, or a PNG or JPEG image
|
|
10
|
-
|
|
11
|
-
A linked resource **must not** be any of the following:
|
|
12
|
-
|
|
13
|
-
1. **A folder / directory.** `[integrations](src/integrations/)`, `[host project](../host_project/)` are invalid — turri cannot ingest a directory. Pick the single most representative file inside (a `README.md`, an exemplar source file, a manifest) and link **that**.
|
|
14
|
-
2. **A URL / external location.** `[Stripe docs](https://stripe.com/docs/api)`, any `http://` / `https://` / `ftp://` / `git://` / `s3://` / `gs://` target. Linked resources are local-file only. If a URL's content is essential, fetch it once, save the response to a text file under `resources/`, and link the saved file.
|
|
15
|
-
3. **A binary file other than a PNG or JPEG image.** GIF, WEBP, SVG, PDF, DOCX, XLSX, ZIP, MP3, MP4, compiled binaries (`.exe`, `.so`, `.class`, `.wasm`), and anything else that isn't human-readable text in its raw form. Binary content cannot be meaningfully consumed by the coding agent — transcribe it into a text-based form first (a PDF spec becomes a Markdown extract or the underlying JSON Schema / OpenAPI, an architecture diagram becomes a Mermaid block).
|
|
16
|
-
- **PNG and JPEG images (`.png`, `.jpg`, `.jpeg`) are the exception**: a UI mockup, a screenshot of the look to match, a diagram. The coding agents are shown the image itself, so the coding model must be one that reads images - the regeneration stops, saying so, when it is not. Each image is at most 5 MB.
|
|
17
|
-
- An image says what something looks like, not what it does: the behaviour still belongs in the ***plain's text. Link a mockup from a concept (`:CheckoutPage:` looks as [checkout mockup](resources/checkout.png) shows) and keep the rules - what each button does, which fields are required - in the functional specs.
|
|
18
|
-
- Where the model may not read images, or a detail must be exact (a colour code, a spacing, a label), say it in text as well; the image is the reference, not the only source.
|
|
19
|
-
4. **Another `.plain` file.** `[Auth Module](auth.plain)` is invalid. To reference another module, use the `require` or `import` frontmatter directives. Do not link it as a markdown resource; turri will flag this as a syntax error.
|
|
20
|
-
|
|
21
|
-
## Never use a URL or folder path as a *reference* in prose
|
|
22
|
-
- The hard constraint above is enforced only on markdown links. A bare URL or folder path in prose (concept body, functional-spec text, implementation reqs, test reqs) passes validation and is fed to the coding agent verbatim as part of the ***plain's text
|
|
23
|
-
- That is exactly why it is dangerous as a *reference*: the coding agent cannot fetch the URL or open the folder, so it sees only the address, not the content behind it. To a human reader the line looks grounded in a source; to the coding agent it is a *ghost dependency*, and the ***plain silently drifts from whatever the URL actually says
|
|
24
|
-
- A URL or path in prose is fine when the *text itself* is the complete fact:
|
|
25
|
-
- **Runtime values** the produced software uses — the base URL an integration calls, a database connection path, a CLI argument default, an output directory layout
|
|
26
|
-
- **Provenance notes** for a snapshotted resource — recording the canonical URL a file saved under `resources/` was fetched from
|
|
27
|
-
- Litmus test: "Would the coding agent benefit from reading the bytes at this URL / folder?" If yes, save it to a file and link the file. If no (the address itself is the fact), it can stay as plain text
|
|
28
|
-
|
|
29
|
-
## Structured protocol artifacts must be linked, never transcribed
|
|
30
|
-
- JSON Schema, OpenAPI / Swagger, GraphQL SDL, Protobuf `.proto`, Avro / Thrift schemas, XML XSDs, AsyncAPI specs, JSON-RPC method definitions, wire-protocol descriptions, payload examples — anything with a formal machine-readable shape — belongs in a file under `resources/` (or another directory within the project)
|
|
31
|
-
- The ***plain line should describe the *role* of the artifact ("the request body conforms to ...", "the public API surface is defined in ...") rather than its contents
|
|
32
|
-
- Reasons: one source of truth (no drift between prose and schema); the coding agent and the generated code can both consume the file directly; schema changes show up cleanly as diffs
|
|
33
|
-
|
|
34
|
-
```plain
|
|
35
|
-
***definitions***
|
|
36
|
-
|
|
37
|
-
- :TaskCreateRequest: is the JSON payload for creating a task.
|
|
38
|
-
- It is defined by [resources/task_create_request.schema.json](resources/task_create_request.schema.json).
|
|
39
|
-
- :TasksAPI: is the public HTTP surface for tasks.
|
|
40
|
-
- It is defined by [resources/tasks_openapi.yaml](resources/tasks_openapi.yaml).
|
|
41
|
-
|
|
42
|
-
***functional specs***
|
|
43
|
-
|
|
44
|
-
# add-task
|
|
45
|
-
A :User: can add a :Task: by POSTing :TaskCreateRequest: to the `POST /tasks` endpoint of :TasksAPI:.
|
|
46
|
-
- The endpoint responds per :TasksAPI:.
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Each linked resource is referenced from exactly one place
|
|
50
|
-
- Linking the same file from two functional specs (or from a functional spec **and** an implementation requirement) creates two independent sources of truth — any later edit silently diverges
|
|
51
|
-
- If a resource needs to inform multiple parts of the project, **don't repeat the link** — attach the resource to a **concept** in `***definitions***` and reference the concept token (`:ConceptName:`) elsewhere
|
|
52
|
-
- If you're about to paste the same `[name](path)` link a second time, **stop** — create the concept first
|
|
53
|
-
|
|
54
|
-
```plain
|
|
55
|
-
***definitions***
|
|
56
|
-
|
|
57
|
-
- :TaskModalSpec: is the user-interface contract for the task modal.
|
|
58
|
-
- It is fully described in [task_modal_specification.yaml](task_modal_specification.yaml).
|
|
59
|
-
|
|
60
|
-
***functional specs***
|
|
61
|
-
|
|
62
|
-
# add-task
|
|
63
|
-
A :User: can add a :Task: using :TaskModalSpec:.
|
|
64
|
-
|
|
65
|
-
# edit-task
|
|
66
|
-
A :User: can edit a :Task: using :TaskModalSpec:.
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## When to link
|
|
70
|
-
- Link content too long or too structured to state inline, or used from more than one place (through a concept, as above); state a short fact in the text instead
|
|
71
|
-
- Never link generated code - it lives in `plain_modules/`, not `resources/`
|
|
72
|
-
|
|
73
|
-
## File location and path resolution
|
|
74
|
-
- Paths are resolved relative to the directory where `turri` is run (the current working directory)
|
|
75
|
-
- Relative paths may traverse into parent directories — `[resource](../../resources/resource.md)` is valid — as long as they resolve to a real text file on disk
|
|
76
|
-
- The conventional location is a `resources/` directory; keep the resource inside the project so the path stays stable from wherever `turri` is run
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: File-level structure of .plain modules — frontmatter, sections, ordering, and section ownership
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Rules for `.plain` module structure
|
|
6
|
-
|
|
7
|
-
When creating a new `.plain` file or reviewing the structure of a whole file, always follow these rules. Section *content* rules live in the per-section rule files linked below — this file covers only file-level structure.
|
|
8
|
-
|
|
9
|
-
## File skeleton
|
|
10
|
-
- A `.plain` file is one **module**: optional YAML frontmatter between `---` markers, followed by sections marked with `***section name***` headers
|
|
11
|
-
- The frontmatter, when present, must be the first thing in the file
|
|
12
|
-
- Every content line inside `***definitions***`, `***implementation reqs***`, and `***test reqs***` is a `- ` list item - see `bullet-continuation.md`
|
|
13
|
-
- Every functional spec in `***functional specs***` is a `# <func-id>` heading followed by its body - see `func-specs.md` and `semantic-ids.md`
|
|
14
|
-
- Every line must be as short and plain as its content allows — see `concise-specs.md`
|
|
15
|
-
|
|
16
|
-
## Frontmatter fields
|
|
17
|
-
|
|
18
|
-
| Field | Purpose | Rule file |
|
|
19
|
-
|---|---|---|
|
|
20
|
-
| `description` | One-line summary of the module; recommended on every module | — |
|
|
21
|
-
| `import` | Pull definitions, implementation reqs, and test reqs from import modules | `import-modules.md` |
|
|
22
|
-
| `requires` | Attach the module to the build chain of another root module | `requires-modules.md` |
|
|
23
|
-
| `exported_concepts` | Declare which of this module's concepts are visible to modules that `require` it | `exported-concepts.md` |
|
|
24
|
-
| `required_concepts` | Declare concepts an import module expects the importing module to define | `required-concepts.md` |
|
|
25
|
-
|
|
26
|
-
## Sections
|
|
27
|
-
- A module has exactly four top-level section markers: `***definitions***`, `***implementation reqs***`, `***test reqs***`, and `***functional specs***`
|
|
28
|
-
- Each section appears **at most once** per file; all are optional (which ones are allowed depends on the module kind below)
|
|
29
|
-
- `***conformance tests***` and `***acceptance tests***` never appear in a module, not even nested under a functional spec; they are the two sections of a test plain file (see `test-plain-files.md`)
|
|
30
|
-
- Write sections in canonical order: `***definitions***` → `***implementation reqs***` → `***test reqs***` → `***functional specs***`
|
|
31
|
-
- Definitions come first because every concept must be defined before it is referenced
|
|
32
|
-
- Functional specs come last because each one builds on those before it
|
|
33
|
-
|
|
34
|
-
## Module kinds
|
|
35
|
-
- A **root module** lives at the repository root and carries behavior: it contains `***functional specs***`
|
|
36
|
-
- To be regenerated, a root module needs at least one functional spec plus the implementation reqs to build it — its own or from an `import`ed module (implementation reqs are not inherited through `requires`). A frontmatter-only file is a valid scaffold, but it cannot be regenerated until a functional spec is added
|
|
37
|
-
- A **requires module** is a root module that is used by another root module via `requires` directive (see `requires-modules.md`)
|
|
38
|
-
- An **import module** provides shared content that other modules pull in via `import`: it contains only `***definitions***`, `***implementation reqs***`, and/or `***test reqs***` — never `***functional specs***`, never `requires` (see `import-modules.md`)
|
|
39
|
-
- A **test plain file** is not a module: it holds the scenarios of one functional spec of a root module, its frontmatter `module:` and `func_id:` bind it to that functional spec, it lives in `tests/<module>/`, and it has none of a module's sections (see `test-plain-files.md`)
|
|
40
|
-
|
|
41
|
-
## Section ownership (where a fact lives)
|
|
42
|
-
- turri reads each kind of fact **only from its owning section** — a fact placed in the wrong section is silently ignored, not flagged
|
|
43
|
-
- Before writing any requirement, place it by content:
|
|
44
|
-
- To move facts that are already misplaced, or to split a bullet carrying several kinds of fact, use the `resolve-section-ownership` skill
|
|
45
|
-
|
|
46
|
-
| Content | Owning section | Rule file |
|
|
47
|
-
|---|---|---|
|
|
48
|
-
| Concepts (`:CamelCaseToken:`) | `***definitions***` | `definitions.md` |
|
|
49
|
-
| HOW the software is built — tech stack, architecture, coding standards — and **everything about `:UnitTests:`** | `***implementation reqs***` | `impl-reqs.md` |
|
|
50
|
-
| **Everything about `:ConformanceTests:`** — framework, run command, mocking and network policy | `***test reqs***` | `test-reqs.md` |
|
|
51
|
-
| WHAT the software does — observable, language-agnostic behavior | `***functional specs***` | `func-specs.md` |
|
|
52
|
-
| Test scenarios of one functional spec, conformance and acceptance | its test plain file, `tests/<module>/<func-id>.plain` | `test-plain-files.md` |
|
|
53
|
-
|
|
54
|
-
## Comments
|
|
55
|
-
- Lines beginning with `>` are ignored when regenerating
|
|
56
|
-
|
|
57
|
-
```plain
|
|
58
|
-
> This is a comment in ***plain.
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
- Comments explain the ***plain to human authors — never use a comment to carry a requirement the coding agent must implement
|
|
62
|
-
|
|
63
|
-
## Liquid templates
|
|
64
|
-
- `.plain` files are processed with [Liquid](https://shopify.github.io/liquid/) before parsing — the full Liquid syntax (variables, filters, conditionals, loops) is available in any section
|
|
65
|
-
- Expansion is **textual** and happens before the ***plain is interpreted — unlike `import`, which includes another module semantically (see `import-modules.md`)
|
|
66
|
-
|
|
67
|
-
```plain
|
|
68
|
-
{% assign max_tags = 3 %}
|
|
69
|
-
|
|
70
|
-
***functional specs***
|
|
71
|
-
|
|
72
|
-
# create-widget
|
|
73
|
-
A :Widget: can be created with up to {{ max_tags }} tags.
|
|
74
|
-
{% if max_tags > 1 %}
|
|
75
|
-
|
|
76
|
-
# list-widget-tags
|
|
77
|
-
A :Widget: can have its tags listed.
|
|
78
|
-
{% endif %}
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
## Format
|
|
82
|
-
|
|
83
|
-
```plain
|
|
84
|
-
---
|
|
85
|
-
description: Command-line task manager.
|
|
86
|
-
import:
|
|
87
|
-
- airplain
|
|
88
|
-
---
|
|
89
|
-
|
|
90
|
-
***definitions***
|
|
91
|
-
|
|
92
|
-
- :Task: is an activity tracked by the application.
|
|
93
|
-
- Name (required)
|
|
94
|
-
|
|
95
|
-
- :TaskList: is the collection of all :Task: items. Initially empty.
|
|
96
|
-
|
|
97
|
-
***implementation reqs***
|
|
98
|
-
|
|
99
|
-
- :Implementation: keeps :TaskList: in memory.
|
|
100
|
-
|
|
101
|
-
***test reqs***
|
|
102
|
-
|
|
103
|
-
- :ConformanceTests: must not access the network.
|
|
104
|
-
|
|
105
|
-
***functional specs***
|
|
106
|
-
|
|
107
|
-
# add-task
|
|
108
|
-
A :Task: can be added to the :TaskList:.
|
|
109
|
-
|
|
110
|
-
# show-task-list
|
|
111
|
-
The :TaskList: is displayed.
|
|
112
|
-
```
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: The ***plain project model - the ***plain as source of truth, the repository layout, generated output, template parameters, and what an earlier test failing after a regeneration means
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# The ***plain project model
|
|
6
|
-
|
|
7
|
-
This rule covers the project as a whole. Section content is owned by the per-section rule files; file structure by `module-structure.md`.
|
|
8
|
-
|
|
9
|
-
## Source of truth
|
|
10
|
-
|
|
11
|
-
- The `.plain` files are the source of truth. They state what the software does, how it is built, and how it is tested; the code is generated from them
|
|
12
|
-
- Every change to the software is a change to a `.plain` file, which the next regeneration builds. A fix made anywhere else is lost the next time the code is regenerated
|
|
13
|
-
|
|
14
|
-
## Repository layout
|
|
15
|
-
|
|
16
|
-
```text
|
|
17
|
-
*.plain # root modules: what the software does
|
|
18
|
-
template/*.plain # import modules: shared definitions and reqs
|
|
19
|
-
tests/<module>/<func-id>.plain # test plain files: the scenarios of each functional spec
|
|
20
|
-
resources/ # files ***plain links to: schemas, API specs, fixtures
|
|
21
|
-
test_scripts/ # unit and conformance runners, found by turri (not linked)
|
|
22
|
-
config.turri.yaml # the project's build decisions: models, the scripts in use
|
|
23
|
-
plain_modules/ # generated - one folder per module
|
|
24
|
-
<module>/code/ # implementation and unit tests
|
|
25
|
-
<module>/tests/ # the whole conformance suite of the module
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Follow `module-structure.md`, `import-modules.md` and `linked-resources.md` for what these directories may contain and how ***plain refers to them.
|
|
29
|
-
|
|
30
|
-
## The config records the build decisions
|
|
31
|
-
|
|
32
|
-
`config.turri.yaml`, at the project root beside the ***plain, is where the project's decisions about how it is built live: the models, and the scripts it uses (`unittests-script:`, `conformance-tests-script:`, `prepare-environment-script:`). turri can find a script by its name, but the config is what a person reads to see how the project is set up, and what they change.
|
|
33
|
-
|
|
34
|
-
- Settle a decision, write it into the config in the same step - never leave it to be inferred from what is on disk. A testing script you write or keep is named by its key, by path from the root (`unittests-script: test_scripts/run_unittests_python.sh`)
|
|
35
|
-
- Change only the keys you settled. Where the file has a key's example commented out, uncomment that line and set it; keep every other line and comment as it is
|
|
36
|
-
- A project whose parts are on different stacks gives a module its own `config.turri.<module>.yaml` beside it, with that module's scripts - it builds the module and every module built on it that has no file of its own; what they share stays in `config.turri.yaml`. Name the file after the module at the bottom of the chain it builds - two files among the modules one requires is an error
|
|
37
|
-
- In the conversation, a setting is changed with the `settings` tool, which checks what it writes; an agent without it writes the key in the file itself
|
|
38
|
-
- A project with only a `config.yaml` has it copied to `config.turri.yaml` first, and each `config.<name>.yaml` to `config.turri.<name>.yaml`; `config.yaml` may be another tool's, and is never written
|
|
39
|
-
- Say in your summary which lines you wrote
|
|
40
|
-
|
|
41
|
-
## Generated output is read-only
|
|
42
|
-
|
|
43
|
-
Everything under `plain_modules/` is generated - `code/` and `tests/` alike. Read it, run it, debug it; never edit it. Fix the ***plain instead, in the section that owns the fact:
|
|
44
|
-
|
|
45
|
-
- behaviour, implementation or unit-test guidance → definitions, functional specs, or implementation reqs
|
|
46
|
-
- how conformance and acceptance tests are written and run → test reqs
|
|
47
|
-
- what a conformance or acceptance test checks → the scenarios in its functional spec's test plain file (`test-plain-files.md`)
|
|
48
|
-
|
|
49
|
-
Then regenerate.
|
|
50
|
-
|
|
51
|
-
## Template inclusion with parameters
|
|
52
|
-
|
|
53
|
-
Besides frontmatter `import`, a template can be included with parameters:
|
|
54
|
-
|
|
55
|
-
```plain
|
|
56
|
-
{% include "python-console-app-template.plain", main_executable_file_name: "my_app.py" %}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Parameters are key-value pairs; the template reads them as `{{ variable_name }}`. Templates live in `template/`. One is worth writing only for text more than one `.plain` file repeats, differing only in values the parameters carry; text used once stays inline.
|
|
60
|
-
|
|
61
|
-
## When an earlier test fails after a regeneration
|
|
62
|
-
|
|
63
|
-
Each functional spec is written knowing the ones before it and none after it - a required module's functional specs count as before - so a functional spec may rely on what earlier ones say, never on later ones. This is about what a functional spec may assume, not what a change costs (`turri-regeneration.md`). After each regeneration every conformance test so far runs again. A test that passed before and fails now means one of:
|
|
64
|
-
|
|
65
|
-
1. the new code does not satisfy its functional spec;
|
|
66
|
-
2. the test does not test its scenario accurately;
|
|
67
|
-
3. the new functional spec and an earlier one conflict.
|
|
68
|
-
|
|
69
|
-
turri triages the first two and repairs the code. The third is a problem in the ***plain: resolve it in the `.plain` files with `resolve-spec-conflict`, and trace a misbehaving build back to its ***plain with `debug-specs` - never by editing generated output.
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Rules for using required_concepts in .plain files
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Rules for `required_concepts`
|
|
6
|
-
|
|
7
|
-
When adding or editing `required_concepts` in a `.plain` file's frontmatter, always follow these rules:
|
|
8
|
-
|
|
9
|
-
## What required_concepts does
|
|
10
|
-
- `required_concepts` declares concepts that any module importing this file **must** define
|
|
11
|
-
- It creates a contract: the import module references these concepts but does not define them — the importing module is responsible for providing definitions
|
|
12
|
-
- This is used exclusively on import modules
|
|
13
|
-
|
|
14
|
-
## When to use it
|
|
15
|
-
- Use `required_concepts` when an import module references concepts that vary per project or per importing module
|
|
16
|
-
- The import module can reference these concepts in its definitions, implementation reqs, or test reqs — but their actual definitions come from whoever imports the file
|
|
17
|
-
|
|
18
|
-
## Importing module must satisfy the contract
|
|
19
|
-
- Every concept listed in `required_concepts` must be defined somewhere visible to the importing module — in its own `***definitions***` section or in another module it imports
|
|
20
|
-
- If the importing module does not define a required concept, the module is invalid
|
|
21
|
-
- Check `required_concepts` of all imported modules before finalizing a module
|
|
22
|
-
|
|
23
|
-
## Do not define required concepts locally
|
|
24
|
-
- The import module that declares `required_concepts` must **not** define those concepts itself
|
|
25
|
-
- The whole point is that the importing module provides the definition
|
|
26
|
-
|
|
27
|
-
## Format
|
|
28
|
-
|
|
29
|
-
```plain
|
|
30
|
-
---
|
|
31
|
-
required_concepts: [":AppName:", ":AppConfig:"]
|
|
32
|
-
description: Imported module that requires AppName and AppConfig to be defined by the importer
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
***definitions***
|
|
36
|
-
- :MainFile: is the entry point for :AppName:.
|
|
37
|
-
|
|
38
|
-
***implementation reqs***
|
|
39
|
-
- :MainFile: should load :AppConfig: on startup.
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
In this example, `:AppName:` and `:AppConfig:` are referenced but not defined — the module that imports this import module must define them.
|
|
43
|
-
|
|
44
|
-
List concepts as a YAML array with each concept in `:ConceptName:` notation.
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Rules for creating and using requires modules in .plain files
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Rules for requires modules
|
|
6
|
-
|
|
7
|
-
When creating or editing a `.plain` file that uses `requires`, or one that is referenced in another `.plain` file's `requires` directive, always follow these rules:
|
|
8
|
-
|
|
9
|
-
## What requires does
|
|
10
|
-
|
|
11
|
-
- `requires` attaches the current module to the project's **build chain**: the required module is built first, and its generated code is copied as the starting point for the current module
|
|
12
|
-
- The copied code is the required module's **accumulated** output — it already contains the code of all of that module's own ancestors
|
|
13
|
-
- The `***functional specs***` of the required module **and of all its ancestors** become visible as **previous functional specs** — this visibility **is transitive** down the whole chain
|
|
14
|
-
- Of a required module's definitions, only the concepts listed in its `exported_concepts` are visible; the module's other definitions stay internal. Each exported concept arrives with its full definition text
|
|
15
|
-
- Export visibility **is not transitive**: an ancestor's exports are visible only if that ancestor is itself listed in `requires`
|
|
16
|
-
- The test plain files of a required module stay with that module; the current module never holds scenarios for a required module's functional spec (see `test-plain-files.md`)
|
|
17
|
-
|
|
18
|
-
## Chain topology
|
|
19
|
-
|
|
20
|
-
- All modules connected by `requires` form a single **tree** with a common root: code accumulates along each branch, and branches never reconverge
|
|
21
|
-
- **Diamond joins are prohibited.** A module must not require two modules from divergent branches — there is no way to merge two divergent codebases into one starting point
|
|
22
|
-
- When `requires` lists multiple modules, every entry must lie on **one root-to-tip ancestor path**: each listed module must be an ancestor of the deepest one
|
|
23
|
-
- The **deepest entry is the attachment point** — it alone determines the build order and the starting code. The other entries add nothing to ordering; they exist **only** to make those ancestors' `exported_concepts` visible
|
|
24
|
-
- Branching outward is fine: two modules may each require the same parent, creating independent branches (and therefore independent top modules)
|
|
25
|
-
|
|
26
|
-
## Tech stack must match (hard rule)
|
|
27
|
-
|
|
28
|
-
- Because the required module's generated code is copied as the starting point and the coding agent continues building on top of it with a single toolchain, two modules can only be linked with `requires` when they target the **same language, framework, and runtime**
|
|
29
|
-
- A runtime / network dependency between systems is **not** a reason to use `requires`
|
|
30
|
-
- Example of the mistake: a React frontend that talks to a Python/FastAPI backend over HTTP must **not** `requires: [backend]` — the stacks differ
|
|
31
|
-
- Model that pair as two independent root modules (each with its own test scripts) and express the contract through a shared API schema in `resources/` or shared concepts in an `import`ed module — never through `requires`
|
|
32
|
-
|
|
33
|
-
## Building upon but not necessarily extension
|
|
34
|
-
|
|
35
|
-
- The current module does not need to functionally extend the required module — it may address a completely different concern
|
|
36
|
-
- Even so, the two are never independent artifacts: the current module's output physically contains the required module's code, because both are stages of one accumulating codebase
|
|
37
|
-
- Use `requires` to place a module at the right point in that lineage, whether or not it builds on the required module's functional specs
|
|
38
|
-
|
|
39
|
-
## Conflict prevention
|
|
40
|
-
|
|
41
|
-
- The current module's functional specs must not conflict with the functional specs of **any module in its ancestor chain** — all of them are previous functional specs
|
|
42
|
-
- The coding agent sees the whole chain's functional specs as prior requirements/context when regenerating the current module
|
|
43
|
-
- Review the ancestor chain's functional specs before adding new ones
|
|
44
|
-
|
|
45
|
-
## Exports are the only visible definitions
|
|
46
|
-
|
|
47
|
-
- Only concepts listed in a required module's `exported_concepts` are available, and only for modules explicitly listed in `requires`
|
|
48
|
-
- Each exported concept is available with its full definition text
|
|
49
|
-
- Other concepts from required modules are internal and invisible
|
|
50
|
-
- To reference a concept exported by an ancestor deeper in the chain, list that ancestor in `requires` as well
|
|
51
|
-
- If you need shared definitions across branches or stacks, use `import` for that — not `requires`
|
|
52
|
-
|
|
53
|
-
## File locations
|
|
54
|
-
|
|
55
|
-
- Modules that use `requires` live at the **repository root** — they are functional modules with functional specs
|
|
56
|
-
- `requires` paths point to other root-level modules (e.g., `auth`, `messaging`)
|
|
57
|
-
- Never `require` an import module — import modules are for `import` only
|
|
58
|
-
|
|
59
|
-
## Format
|
|
60
|
-
|
|
61
|
-
```plain
|
|
62
|
-
---
|
|
63
|
-
requires:
|
|
64
|
-
- auth
|
|
65
|
-
import:
|
|
66
|
-
- airplain
|
|
67
|
-
description: Module built on top of auth, importing shared definitions
|
|
68
|
-
---
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
A module can list multiple required modules **only when they lie on one ancestor path**. Here `messaging` itself requires `auth`, so `auth` is an ancestor of `messaging`; the module attaches after `messaging` and lists `auth` only to see its exports:
|
|
72
|
-
|
|
73
|
-
```plain
|
|
74
|
-
---
|
|
75
|
-
requires:
|
|
76
|
-
- auth
|
|
77
|
-
- messaging
|
|
78
|
-
import:
|
|
79
|
-
- airplain
|
|
80
|
-
---
|
|
81
|
-
```
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Syntax, uniqueness and use of func-ids and scenario-ids in .plain files
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Rules for func-ids and scenario-ids
|
|
6
|
-
|
|
7
|
-
Every functional spec in `***functional specs***` and every scenario in a test plain file carries an id: its name, given by the author and never by its position. turri knows a functional spec by its func-id - in the code record, in its pulses, in the conformance tests' labels and in what it tells the person - and a scenario by its scenario-id. Always follow these rules when writing or reading one.
|
|
8
|
-
|
|
9
|
-
## Two kinds of id
|
|
10
|
-
|
|
11
|
-
| id | Written as | Names | Unique within |
|
|
12
|
-
|---|---|---|---|
|
|
13
|
-
| func-id | a `# <func-id>` heading in `***functional specs***` of a module | one functional spec | its module |
|
|
14
|
-
| scenario-id | a `# <scenario-id>` heading in `***conformance tests***` or `***acceptance tests***` of a test plain file | one scenario | its functional spec, across every test plain file bound to it |
|
|
15
|
-
|
|
16
|
-
## Syntax
|
|
17
|
-
- Lowercase letters, digits and hyphens only: `add-task`, `export-csv-2`, `ctrl-d-exit`
|
|
18
|
-
- The heading is `# ` (a hash and one space) followed by the id and nothing else
|
|
19
|
-
- Make the id short kebab-case from what the functional spec or scenario means (`add-task`, never `spec-3`)
|
|
20
|
-
|
|
21
|
-
## Uniqueness
|
|
22
|
-
- A func-id is unique in its module; two modules may use the same func-id
|
|
23
|
-
- A scenario-id is unique among its functional spec's scenarios, once every test plain file bound to it is merged; two functional specs may use the same scenario-id
|
|
24
|
-
- Before adding an id, search the module (or the functional spec's test plain files) for the same heading; a duplicate is an error `turri parse` reports
|
|
25
|
-
|
|
26
|
-
## Stability
|
|
27
|
-
- An id is an identity, not a label: a functional spec keeps its func-id for as long as it exists, even when its text changes
|
|
28
|
-
- A pure rename is cheap: a func-id renamed with nothing else changed - its body, its links and its scenarios as they were, only the `# <func-id>` heading and `func_id:` in its test plain files - is renamed by turri in its records and its tests' labels, and nothing is regenerated. The same holds for a scenario-id renamed with its text as it was
|
|
29
|
-
- A rename together with any other change rebuilds: to turri it is one functional spec taken out and another added, its code built anew and its tests written anew (`turri-regeneration.md`). So rename in a ***plain diff of its own, never in the same edit as a change to the body or the scenarios
|
|
30
|
-
- Rename only when the person asks, then rename `func_id:` in every test plain file bound to it, and the file with it
|
|
31
|
-
- Never renumber or reorder ids: the order of the headings in the module is the order of its functional specs, and the id carries no order
|
|
32
|
-
|
|
33
|
-
## Naming a functional spec
|
|
34
|
-
- Name a functional spec by its func-id - `<module>:<func-id>` outside its module (`todo:add-task`) - in questions to the person, in what you show them and in turri's tools; never by its position ("the third functional spec")
|
|
35
|
-
- Pick the func-id before writing the functional spec, check that it is unique in the module, then write the heading and the body (see `func-specs.md`)
|
|
36
|
-
- Everything about one functional spec is found through its func-id: its heading, the test plain files whose frontmatter names it, and the conformance tests labelled with it
|
|
37
|
-
- A conformance or acceptance test carries the scenario-id of the scenario it implements: when one fails, its label leads back to the scenario
|
|
38
|
-
|
|
39
|
-
## Format
|
|
40
|
-
|
|
41
|
-
```plain
|
|
42
|
-
***functional specs***
|
|
43
|
-
|
|
44
|
-
# add-task
|
|
45
|
-
A :User: can add a :Task:. Only valid :Task: items are added.
|
|
46
|
-
|
|
47
|
-
# delete-task
|
|
48
|
-
A :User: can delete a :Task:.
|
|
49
|
-
```
|
package/genome/rules/stdlib.md
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: The ***plain standard library - import modules for a backend, a frontend, a command-line tool or a library, on a known stack
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Rules for the standard library
|
|
6
|
-
|
|
7
|
-
turri ships a standard library of import modules that settle everything about a generic piece of software on one stack except what it does: its language and framework, its layout, its configuration, how it handles errors, how it logs, how it stops, and how it is tested. A module that imports one writes only what is its own - its concepts and its functional specs - and a requirement only for what its stack does not settle.
|
|
8
|
-
|
|
9
|
-
```plain
|
|
10
|
-
---
|
|
11
|
-
import:
|
|
12
|
-
- stdlib/backend/python-flask
|
|
13
|
-
---
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## How it is built up
|
|
17
|
-
|
|
18
|
-
- Each stack imports its language's template - `stdlib/lang/python` - and its kind's `common` - `stdlib/backend/common` - so importing the stack brings all three.
|
|
19
|
-
- Each stack's conformance tests are a template of their own, `stdlib/<kind>/conformance/<stack>`, which imports `stdlib/<kind>/conformance/common`.
|
|
20
|
-
- The `common` of a kind settles what every stack of it shares. For a backend: settings from the environment, checked at start; handler, service and repository layers; domain errors turned into one error body `{"error": {"code", "message"}}` with fixed codes and statuses; JSON logs with a request id; shutdown on a signal. For a command-line tool: `Error: <message>` on standard error, exit codes 0, 1, 2 and 130, logs on standard error with `--verbose` and `--debug`. For a frontend: one API layer with an `ApiError`, errors shown in place or at the root, one logger module. For a library: one public entry point, one base error type, no output of its own.
|
|
21
|
-
|
|
22
|
-
## When to use it
|
|
23
|
-
|
|
24
|
-
- When the person wants a backend, a frontend, a command-line tool or a library, import the stack that fits instead of writing its implementation reqs yourself.
|
|
25
|
-
- Pick the stack from what the person said, the project's other modules, and what the module talks to. With nothing to go on: `stdlib/backend/python-fastapi`, `stdlib/frontend/react-vite`, `stdlib/cli/python-typer`, `stdlib/library/python`.
|
|
26
|
-
- Import the stack alone. Nothing about testing exists until the person asks for it: the first time they ask for tests in a module, import the stack's conformance template, `stdlib/<kind>/conformance/<stack>` - the module's test reqs - then write the conformance testing script if the project has none for the stack, then the scenarios, in that order (*Writing scenarios* in `test-plain-files.md`).
|
|
27
|
-
- Read the templates a module imports before writing its ***plain - the folder is named below - and write no requirement they already make (see `concise-specs.md`).
|
|
28
|
-
- Write a functional spec's errors in the templates' terms: a backend's failure by its status and `error.code` - `not_found`, `conflict`, `validation_error`, `unauthenticated`, `forbidden`, or a code of the module's own - and a command-line tool's by its exit code and message.
|
|
29
|
-
- Add a requirement on top for what the module needs beyond its stack - storage, an outside service, a library it must use. When the module differs from its stack on something the stack settles - another framework, another layout - write the stack yourself instead: an import cannot be taken back in part. For a language with no stack of the kind wanted, import its `stdlib/lang/<language>` and write the rest.
|
|
30
|
-
- `stdlib/` is a reserved name. An import that starts with it is always the standard library's template, and a project module at such a path - `stdlib/backend/python-fastapi.plain` in the module's folder, its `template/` folder or `PLAIN_TEMPLATE_DIRS` - is an error. Never write a module under a `stdlib/` folder of the project; a project's own shared template goes in `template/` under a name of its own.
|
|
31
|
-
|
|
32
|
-
## What it does not do
|
|
33
|
-
|
|
34
|
-
- It defines no concepts: its requirements are on the predefined `:Implementation:`, `:UnitTests:` and `:ConformanceTests:` only, so it never collides with the module's own definitions.
|
|
35
|
-
- It holds no storage: a module with a database says which, and how it is reached, on top.
|
|
36
|
-
- It holds no testing scripts. The module still needs its unit testing script, written with the `implement-unit-testing-script` skill for the stack's language and test framework; its conformance testing script is written with `implement-conformance-testing-script` when its first tests are asked for. Each runs the static checks of what it tests - the formatter, linter and type checker its language template names, on the code or on the conformance tests - and they count as the tests do.
|
|
37
|
-
- It names its stack's toolchain - Python 3.12, Node.js 24, Java 21, Go 1.25, Rust - which the agents use from the machine turri runs on; they install none, so `turri doctor` says when the machine lacks it.
|