mulmoterminal 7.3.0 → 8.1.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 +15 -0
- package/blueprints/adopt/checks/adopt.mjs +106 -0
- package/blueprints/adopt/checks/base.mjs +12 -0
- package/blueprints/adopt/checks/report.mjs +22 -0
- package/blueprints/adopt/checks/setup.d.mts +4 -0
- package/blueprints/adopt/checks/setup.mjs +47 -0
- package/blueprints/adopt/hearing.json +42 -0
- package/blueprints/adopt/kinds.json +18 -0
- package/blueprints/adopt/manifest.json +23 -0
- package/blueprints/adopt/presets/help-pages/export.md +9 -0
- package/blueprints/adopt/presets/help-pages/login.md +9 -0
- package/blueprints/adopt/presets.json +15 -0
- package/blueprints/adopt/skills/apply/SKILL.md +47 -0
- package/blueprints/adopt/skills/survey/SKILL.md +35 -0
- package/blueprints/adopt/steps.json +20 -0
- package/blueprints/adopt/templates/chaff.yml +29 -0
- package/blueprints/ask/manifest.json +1 -0
- package/blueprints/ask/presets/kyuka/kitei.md +17 -0
- package/blueprints/ask/presets/kyuka/tebiki.md +13 -0
- package/blueprints/ask/presets.json +11 -0
- package/blueprints/compare/manifest.json +1 -0
- package/blueprints/compare/presets/ryohi-kaitei/kyu.txt +22 -0
- package/blueprints/compare/presets/ryohi-kaitei/shin.txt +22 -0
- package/blueprints/compare/presets.json +16 -1
- package/blueprints/docs/checks/chaff.mjs +2 -1
- package/blueprints/docs/checks/chaff.sh +1 -1
- package/blueprints/docs/checks/config.d.mts +3 -0
- package/blueprints/docs/checks/config.mjs +18 -0
- package/blueprints/docs/checks/markdown.d.mts +1 -0
- package/blueprints/docs/checks/markdown.mjs +14 -0
- package/blueprints/docs/skills/workspace/SKILL.md +1 -1
- package/blueprints/glossary/checks/base.mjs +12 -0
- package/blueprints/glossary/checks/glossary.mjs +106 -0
- package/blueprints/glossary/checks/report.mjs +43 -0
- package/blueprints/glossary/checks/terms.d.mts +11 -0
- package/blueprints/glossary/checks/terms.mjs +140 -0
- package/blueprints/glossary/hearing.json +19 -0
- package/blueprints/glossary/manifest.json +22 -0
- package/blueprints/glossary/presets/shanai-yogo/kitei.txt +14 -0
- package/blueprints/glossary/presets/shanai-yogo/tebiki.md +17 -0
- package/blueprints/glossary/presets.json +11 -0
- package/blueprints/glossary/skills/apply/SKILL.md +62 -0
- package/blueprints/glossary/skills/collect/SKILL.md +51 -0
- package/blueprints/glossary/steps.json +20 -0
- package/blueprints/polish/checks/kind.d.mts +4 -0
- package/blueprints/polish/checks/kind.mjs +17 -1
- package/blueprints/polish/checks/targets.mjs +6 -5
- package/blueprints/polish/hearing.json +27 -3
- package/blueprints/polish/kinds.json +5 -2
- package/blueprints/polish/manifest.json +1 -0
- package/blueprints/polish/presets/english-blog/post.md +19 -0
- package/blueprints/polish/presets/shayo/kitei.md +26 -0
- package/blueprints/polish/presets/tejun/tejun.md +15 -0
- package/blueprints/polish/presets.json +39 -0
- package/blueprints/polish/skills/polish/SKILL.md +2 -1
- package/blueprints/polish/skills/report/SKILL.md +9 -1
- package/blueprints/polish/skills/survey/SKILL.md +6 -2
- package/blueprints/polish/viewpoints.json +56 -1
- package/blueprints/review/manifest.json +1 -0
- package/blueprints/review/presets/riyo-kiyaku/kiyaku.md +37 -0
- package/blueprints/review/presets.json +12 -0
- package/blueprints/style/hearing.json +4 -2
- package/blueprints/style/manifest.json +13 -2
- package/blueprints/style/skills/report/SKILL.md +1 -1
- package/blueprints/style/skills/rules/SKILL.md +4 -3
- package/blueprints/summarize/checks/parts.d.mts +0 -1
- package/blueprints/summarize/checks/parts.mjs +0 -14
- package/blueprints/summarize/checks/report.mjs +1 -2
- package/blueprints/summarize/manifest.json +1 -0
- package/blueprints/summarize/presets/chat-kento/kento.md +27 -0
- package/blueprints/summarize/presets.json +18 -1
- package/blueprints/verify/checks/extract.mjs +4 -4
- package/blueprints/verify/checks/facts.d.mts +3 -1
- package/blueprints/verify/checks/facts.mjs +9 -3
- package/blueprints/verify/checks/factsView.mjs +5 -1
- package/blueprints/verify/checks/rules.d.mts +7 -1
- package/blueprints/verify/checks/rules.mjs +45 -2
- package/blueprints/verify/manifest.json +1 -0
- package/blueprints/verify/presets/mitsumori/mitsumori.md +23 -0
- package/blueprints/verify/presets.json +12 -0
- package/blueprints/verify/skills/extract/SKILL.md +8 -0
- package/blueprints/verify/skills/report/SKILL.md +6 -2
- package/blueprints/write/hearing.json +2 -1
- package/blueprints/write/manifest.json +7 -2
- package/common/blueprint/hearing.ts +62 -0
- package/common/blueprint/originals.ts +39 -0
- package/common/dirConfigForm.ts +43 -0
- package/common/dirConfigSource.ts +2 -0
- package/common/headerStatusColors.ts +25 -0
- package/common/whatsNew.ts +18 -0
- package/dist/assets/{abnfDiagram-O67JEVCF-BnQ6PasO.js → abnfDiagram-O67JEVCF-ClxVnRku.js} +1 -1
- package/dist/assets/architecture-7GRP2DOG-DbBbO1l3.js +1 -0
- package/dist/assets/{architectureDiagram-NJMV4G6O-BKtC0YZv.js → architectureDiagram-NJMV4G6O-DPbRnCKN.js} +1 -1
- package/dist/assets/{blockDiagram-BEXU5L5S-az-TvPjp.js → blockDiagram-BEXU5L5S-422fI4GC.js} +1 -1
- package/dist/assets/{c4Diagram-YGBWAQC7-xDds9K_k.js → c4Diagram-YGBWAQC7-htmTlUTG.js} +1 -1
- package/dist/assets/channel-BAfBdDqJ.js +1 -0
- package/dist/assets/{chunk-3FUC2YCW-DLr3D6jO.js → chunk-3FUC2YCW-BbDEpgy0.js} +1 -1
- package/dist/assets/{chunk-5DYCD2WN-5H5gAWR8.js → chunk-5DYCD2WN-D97hkTCQ.js} +1 -1
- package/dist/assets/{chunk-742MDFTN-CcavS_nS.js → chunk-742MDFTN-B3Mnh8e7.js} +1 -1
- package/dist/assets/{chunk-7INBJB4K-DplkzUdE.js → chunk-7INBJB4K-B5lqXrqb.js} +1 -1
- package/dist/assets/{chunk-7M6MHVWA-D4sIxByI.js → chunk-7M6MHVWA-DghPQFUI.js} +1 -1
- package/dist/assets/{chunk-7PRAP22T-sPfItgkT.js → chunk-7PRAP22T-BdAaGYkh.js} +1 -1
- package/dist/assets/{chunk-GTNCS2PH-o55BwD7R.js → chunk-GTNCS2PH-DKvFKim8.js} +1 -1
- package/dist/assets/{chunk-GWA4HPMP-DsJRcpHG.js → chunk-GWA4HPMP-RTEdPAf3.js} +1 -1
- package/dist/assets/{chunk-MBY4JIJT-BCFvhNqi.js → chunk-MBY4JIJT-x_wqlXNe.js} +1 -1
- package/dist/assets/{chunk-NETBCI7D-GQGQ0f8K.js → chunk-NETBCI7D-8Cs1NIno.js} +1 -1
- package/dist/assets/{chunk-O7XYJQB3-CNBOCJb8.js → chunk-O7XYJQB3-Dz4vrOLX.js} +1 -1
- package/dist/assets/{chunk-UA2S7LBM-DVKHgPob.js → chunk-UA2S7LBM-Dwd6YCa2.js} +1 -1
- package/dist/assets/{chunk-WEXAMYUT-CuAljQbF.js → chunk-WEXAMYUT-rY_Nsr-S.js} +1 -1
- package/dist/assets/{chunk-Z7XXMR3K-ChACA7mW.js → chunk-Z7XXMR3K-pt-6PBwB.js} +1 -1
- package/dist/assets/{chunk-ZIGJFQKS-BWf0ZX3U.js → chunk-ZIGJFQKS-DzYvLxms.js} +1 -1
- package/dist/assets/{classDiagram-v2-NBCMYWYE-2EURLE58.js → classDiagram-v2-NBCMYWYE-DAAHQYjw.js} +1 -1
- package/dist/assets/{cynefin-OW5HDTMX-C5kb1EwK.js → cynefin-OW5HDTMX-DTPNG3DO.js} +1 -1
- package/dist/assets/{cynefinDiagram-VND7K2PF-DMytcOCT.js → cynefinDiagram-VND7K2PF-BiNAmBAf.js} +1 -1
- package/dist/assets/{dagre-6A5THRUB-CUUE8Q1U.js → dagre-6A5THRUB-C3aACS4M.js} +1 -1
- package/dist/assets/{diagram-22UHCM2B-CC1W7G0a.js → diagram-22UHCM2B-1moWpahw.js} +1 -1
- package/dist/assets/{diagram-3UASUU5V-DMERag7H.js → diagram-3UASUU5V-CgsKz1ze.js} +1 -1
- package/dist/assets/{diagram-ATOU4E4O-DAMncBlv.js → diagram-ATOU4E4O-CtIrEsFG.js} +1 -1
- package/dist/assets/{diagram-CDSNMT55-C69-LfJU.js → diagram-CDSNMT55-BntC2VUx.js} +1 -1
- package/dist/assets/{diagram-MLGK6HIB-Qc95cLSN.js → diagram-MLGK6HIB-Cdh5tBhw.js} +1 -1
- package/dist/assets/{diagram-MPIPVDR6-DrmRWZxC.js → diagram-MPIPVDR6-CQz7IrSH.js} +1 -1
- package/dist/assets/{dist-B84r2Zu4.js → dist--0LHNaYl.js} +1 -1
- package/dist/assets/{dist-C9QzqYij.js → dist-CkDbiiOe.js} +1 -1
- package/dist/assets/{dist-BFtxixYt.js → dist-DANd2aqA.js} +1 -1
- package/dist/assets/{dist-CZ9-VOqZ.js → dist-DqudlEKF.js} +1 -1
- package/dist/assets/{dist-DF-Vjhnj.js → dist-PySjWJXd.js} +1 -1
- package/dist/assets/{ebnfDiagram-ZINNZB2B-DbzDNXYn.js → ebnfDiagram-ZINNZB2B-CZaPrV3v.js} +1 -1
- package/dist/assets/{elk-276RUBZZ-CLrfQluT.js → elk-276RUBZZ-5V_Op3XR.js} +1 -1
- package/dist/assets/{erDiagram-OPXOYQCR-B1BCJu2j.js → erDiagram-OPXOYQCR-flX7Jn68.js} +1 -1
- package/dist/assets/eventmodeling-NTZA5JFV-B5Bz1qEf.js +1 -0
- package/dist/assets/flowDiagram-KWPJA3E3-CChoJefx.js +1 -0
- package/dist/assets/{ganttDiagram-FUAMR5RP-D0VKOYxQ.js → ganttDiagram-FUAMR5RP-2KqutibO.js} +1 -1
- package/dist/assets/{gitGraph-4MIJSDKK-CzOJUjdw.js → gitGraph-4MIJSDKK-DVTDAI2J.js} +1 -1
- package/dist/assets/{gitGraphDiagram-X574FWY7-vDZYUYtS.js → gitGraphDiagram-X574FWY7-Btc5-wfa.js} +1 -1
- package/dist/assets/{index-K_24iRwq.js → index-8Aw0tzeQ.js} +361 -361
- package/dist/assets/index-BcxXAO6O.css +1 -0
- package/dist/assets/{info-A6RAGUB7-B9K2IdSh.js → info-A6RAGUB7-BX4xPahk.js} +1 -1
- package/dist/assets/{infoDiagram-VRGFBTTK-CXpbV_l5.js → infoDiagram-VRGFBTTK-ng2eNzlm.js} +1 -1
- package/dist/assets/{ishikawaDiagram-OU5B5YK6-CerjLKSu.js → ishikawaDiagram-OU5B5YK6-CnNc1uHK.js} +1 -1
- package/dist/assets/{journeyDiagram-ZHPQQLJL-CYE7e5SQ.js → journeyDiagram-ZHPQQLJL-BHr492DG.js} +1 -1
- package/dist/assets/{kanban-definition-PNTS6WVX-hTQifntC.js → kanban-definition-PNTS6WVX-CD4FdLFL.js} +1 -1
- package/dist/assets/{line-DHCgFjyl.js → line-DwxnhfoI.js} +1 -1
- package/dist/assets/{mermaid-parser.core-Ci8-dBWZ.js → mermaid-parser.core-DEnlY2ci.js} +3 -3
- package/dist/assets/{mermaid.core-D1g_MhHe.js → mermaid.core-B7u-t6P9.js} +4 -4
- package/dist/assets/{mindmap-definition-NLK3R4M7-3-mAUeFh.js → mindmap-definition-NLK3R4M7-BdIcteCE.js} +1 -1
- package/dist/assets/{packet-AYTQ26CC-Bi4OEG7f.js → packet-AYTQ26CC-DHisXteY.js} +1 -1
- package/dist/assets/{pegDiagram-GJSIUBJH-BvlMXL59.js → pegDiagram-GJSIUBJH-DDOrA3Ua.js} +1 -1
- package/dist/assets/{pie-WAS4IAKB-D0Bzfos1.js → pie-WAS4IAKB-Ba76QqEP.js} +1 -1
- package/dist/assets/{pieDiagram-5QR66LMP-ByI7bRXL.js → pieDiagram-5QR66LMP-CNlravvW.js} +1 -1
- package/dist/assets/{quadrantDiagram-O4NWA36T-DHt1QBiU.js → quadrantDiagram-O4NWA36T-B0D-BZQ2.js} +1 -1
- package/dist/assets/{radar-RG4KPBEZ-DNfkRPMH.js → radar-RG4KPBEZ-BCNuh25J.js} +1 -1
- package/dist/assets/{railroad-74A4TZTK-1yUJUd_D.js → railroad-74A4TZTK-CMJcxNfL.js} +1 -1
- package/dist/assets/railroad-abnf-HS5TGJTU-B2S-Bbzp.js +1 -0
- package/dist/assets/railroad-ebnf-LZEXJU2U-DlnwWMr4.js +1 -0
- package/dist/assets/railroad-peg-WCYAUIDC-C3FYE35J.js +1 -0
- package/dist/assets/{railroadDiagram-XR7U4H2S-y8FT2bjZ.js → railroadDiagram-XR7U4H2S-BpB8nxWt.js} +1 -1
- package/dist/assets/{requirementDiagram-PLB6GJNP-DCE3eASQ.js → requirementDiagram-PLB6GJNP-CsB3aqu0.js} +1 -1
- package/dist/assets/{sankeyDiagram-IPEJSGJF-DkfyNgDg.js → sankeyDiagram-IPEJSGJF-BKGvK8Jv.js} +1 -1
- package/dist/assets/{sequenceDiagram-PO4LG4MO-DFeaLdZP.js → sequenceDiagram-PO4LG4MO-Cr9hkQye.js} +1 -1
- package/dist/assets/{stateDiagram-v2-GCMORJYK-DXKYQ2gY.js → stateDiagram-v2-GCMORJYK-C7gWKveV.js} +1 -1
- package/dist/assets/{swimlanes-2SLR337P-BpbeyLoP.js → swimlanes-2SLR337P-iRnomZ6W.js} +1 -1
- package/dist/assets/swimlanesDiagram-TC7HE7FX-DliugZOm.js +8 -0
- package/dist/assets/{timeline-definition-EJHVYXUP-CHZxYKup.js → timeline-definition-EJHVYXUP-CvM8Zt_H.js} +1 -1
- package/dist/assets/{treeView-Q6P3EWNA-DnkPtA3-.js → treeView-Q6P3EWNA-B-3825bR.js} +1 -1
- package/dist/assets/{treemap-WGGIJYW6-DLBjcQqV.js → treemap-WGGIJYW6-wYDmmCoC.js} +1 -1
- package/dist/assets/{usecaseDiagram-POWQR4AR-ChaNA2Rg.js → usecaseDiagram-POWQR4AR-COfhzrb4.js} +1 -1
- package/dist/assets/{vennDiagram-UO4OBE2U-pLa46WbE.js → vennDiagram-UO4OBE2U-DQz5w2Ad.js} +1 -1
- package/dist/assets/{wardley-WFR3VGLG-RCPsNr08.js → wardley-WFR3VGLG-D0qPa5yM.js} +1 -1
- package/dist/assets/{wardleyDiagram-VNRHLVJA-BIvz-wXl.js → wardleyDiagram-VNRHLVJA-B0Ffm6Eo.js} +1 -1
- package/dist/assets/{xychartDiagram-PMCCYNJV-GkaA0v7z.js → xychartDiagram-PMCCYNJV-mcCWc9NA.js} +1 -1
- package/dist/index.html +2 -2
- package/docs/guide/en/v7.3.0.md +41 -4
- package/docs/guide/en/v8.0.0.md +119 -0
- package/docs/guide/en/v8.1.0.md +77 -0
- package/docs/guide/ja/v7.3.0.md +40 -4
- package/docs/guide/ja/v8.0.0.md +107 -0
- package/docs/guide/ja/v8.1.0.md +74 -0
- package/package.json +1 -1
- package/server/backends/sharedApp/context.ts +2 -1
- package/server/backends/sharedApp/declare.ts +8 -3
- package/server/backends/sharedApp/headlessPreview.ts +64 -24
- package/server/backends/sharedApp/participate/app.ts +2 -1
- package/server/backends/sharedApp/signInStep.ts +5 -0
- package/server/backends/sharedApp/unpublish.ts +2 -1
- package/server/blueprint/originals.ts +52 -0
- package/server/blueprint/routes.ts +66 -4
- package/server/config/config-schema.ts +8 -2
- package/server/config/dir-config-edit.ts +89 -0
- package/server/config/dir-config-write.ts +66 -0
- package/server/config/dir-config.ts +36 -9
- package/server/config/header-button-routes.ts +14 -73
- package/server/config/header-chip-routes.ts +12 -28
- package/server/config/header-entry-changes.ts +105 -0
- package/server/infra/shared-app-tool.ts +9 -1
- package/server/routes/app-routes.ts +15 -8
- package/server/routes/dir-config-entries-route.ts +85 -0
- package/server/routes/dir-config-write-route.ts +83 -0
- package/server/routes/dir-routes.ts +4 -1
- package/server/skills/mulmoterminal-config/SKILL.md +3 -2
- package/server/skills/mulmoterminal-dirs/SKILL.md +6 -1
- package/server/skills/mulmoterminal-header/SKILL.md +2 -2
- package/server/skills/mulmoterminal-model/SKILL.md +2 -1
- package/server/skills/mulmoterminal-notify/SKILL.md +9 -8
- package/server/whatsNew/routes.ts +45 -3
- package/dist/assets/architecture-7GRP2DOG-WG-E0vWg.js +0 -1
- package/dist/assets/channel-Dyz5xJeN.js +0 -1
- package/dist/assets/eventmodeling-NTZA5JFV-DO2IaAYE.js +0 -1
- package/dist/assets/flowDiagram-KWPJA3E3-Os30OifC.js +0 -1
- package/dist/assets/index-DyqFaGZi.css +0 -1
- package/dist/assets/railroad-abnf-HS5TGJTU-D3EYjt_F.js +0 -1
- package/dist/assets/railroad-ebnf-LZEXJU2U-8aE6RTc7.js +0 -1
- package/dist/assets/railroad-peg-WCYAUIDC-CFCfxkTd.js +0 -1
- package/dist/assets/swimlanesDiagram-TC7HE7FX-BL6ovFkZ.js +0 -8
package/README.md
CHANGED
|
@@ -1059,6 +1059,20 @@ they came from. It also names the keys it **dropped** (a color that isn't `#rrgg
|
|
|
1059
1059
|
of range) and the keys it doesn't read at all (`badgeColour`, a global-only setting) — which is
|
|
1060
1060
|
what tells "I never set that" apart from "I set it and it didn't take".
|
|
1061
1061
|
|
|
1062
|
+
**Changing it there.** Under the values, **Change here** is a form for the name, the seven chrome
|
|
1063
|
+
colors, how the header shows a running session (`headerStatusTint`) and its colour per status
|
|
1064
|
+
(`headerStatusColors`), the terminal theme and palette (`colors`), font size, font family, grid priority, the model its
|
|
1065
|
+
sessions start on (`provider` / `model`), the closing summary (`appendSystemPrompt`) and extra
|
|
1066
|
+
directories (`addDirs`), its icon, terminal background, and attention sounds (`sound` / `sounds`), and its header buttons,
|
|
1067
|
+
chips and command-palette entries (`buttons` / `chips` / `commands`) with the same editors the global
|
|
1068
|
+
lists use, its Skill menu (`skills`, in order), Mulmo menu decks (`decks`) and per-worktree variables
|
|
1069
|
+
(`worktreeEnv`) — every key the file can hold. **This checkout only** moves a key into
|
|
1070
|
+
`.mulmoterminal.local.json` (and **Share** moves it back). A cell's path menu has **This directory's
|
|
1071
|
+
settings**, which opens Settings on that directory. Each change is written to
|
|
1072
|
+
the directory's file at once and applies without a restart; **Use global** takes the key out
|
|
1073
|
+
again. A key `.mulmoterminal.local.json` already holds is written there. Keys the form doesn't
|
|
1074
|
+
show are left as they are, and a file that isn't a JSON object is not touched — fix it in Files.
|
|
1075
|
+
|
|
1062
1076
|
---
|
|
1063
1077
|
|
|
1064
1078
|
## Running
|
|
@@ -2083,6 +2097,7 @@ From a shell: `mulmoterminal room read <room>` · `room post <room> <text…> [-
|
|
|
2083
2097
|
| -------- | ------- |
|
|
2084
2098
|
| `GET\|POST /api/config` | User UI config (`cwdPresets`, `soundFile`, `soundKinds`, `sounds`, `prRepos`, `launchers`, `quickCommands`, `userMcpServers`, `providers`). |
|
|
2085
2099
|
| `GET /api/sound?kind=` · `/api/dir-sound?cwd=&kind=` · `/api/sound-preset/:id` · `/api/dir-config?cwd=` | Custom / per-directory / preset attention sound + per-dir config. `kind` selects a config entry, never a path. |
|
|
2100
|
+
| `PUT /api/dir-config` | The Settings form's save: `{ cwd, set: { key: value }, unset: [key] }` for the keys the form edits (`common/dirConfigForm.ts`), each validated like the Files pane's editor. Other keys and their order are kept; a file that isn't a JSON object answers 422 and is not written. Answers with the new `dir-config-detail`. |
|
|
2086
2101
|
| `GET /api/dir-config-detail?cwd=` | The same per-dir config, **plus** the settings a running terminal doesn't need (`provider`, `model`, `skills`, `addDirs`, header button/chip **labels**), **plus** which keys the file set and how each fared (applied / dropped in validation / not a setting at all). Read-only; backs the Settings modal's **Directory settings** preview. Unlike the other `?cwd=` routes this one does **not** fall back to the default workspace — it reports on the directory it was asked about, so a path that no longer exists comes back as `exists:false`. Sound paths and button commands stay server-side. |
|
|
2087
2102
|
| `GET /api/launch-options` | The Anthropic-compatible backends this server can reach, each with its models and — when it can't — the reason. Reports the **name** of the env var a key is read from, never the key. |
|
|
2088
2103
|
| `GET /api/update-status` | What is running and whether anything newer exists: `install` (`npm` / `git`), `version`, `commit` (a checkout's short HEAD sha), `latest` (npm, only when newer) and the one-line `notice`. Backs the header's **Update** badge and the Settings version line. Served from memory, recomputed at startup and every 3 hours — a long-running server started with `npx mulmoterminal@latest` is current when it starts, so only a later check can tell it a release shipped. `ready` is false until the first check lands. |
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// The adopt usecase's two checks. `survey`: .blueprint/adopt.json records the genre the person chose and how many
|
|
2
|
+
// findings chaff reports on the places today, measured again here; nothing in the repository has changed yet.
|
|
3
|
+
// `apply`: chaff.yaml names that genre and keeps what it had, .chaff-baseline.json shelves today's findings so chaff
|
|
4
|
+
// now reports none, and the workflow — when asked for — reports only what is new, with no more rights than that.
|
|
5
|
+
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
6
|
+
import { join } from "node:path";
|
|
7
|
+
import { fromBase } from "./base.mjs";
|
|
8
|
+
import { placesIn, workflowProblems } from "./setup.mjs";
|
|
9
|
+
const { actionable, fail, findingsIn, readJson, runChaff } = await import(fromBase("chaff.mjs"));
|
|
10
|
+
const { lostLines } = await import(fromBase("config.mjs"));
|
|
11
|
+
|
|
12
|
+
const RECORD = ".blueprint/adopt.json";
|
|
13
|
+
const READABLE = ".blueprint/adopt.txt";
|
|
14
|
+
const CHECKED = ".blueprint/.adopt-checked";
|
|
15
|
+
const CONFIG = "chaff.yaml";
|
|
16
|
+
const BASELINE = ".chaff-baseline.json";
|
|
17
|
+
const WORKFLOW = ".github/workflows/chaff.yml";
|
|
18
|
+
const WITH_CI = "GitHub の PR に指摘を出すワークフローを作る";
|
|
19
|
+
|
|
20
|
+
const answers = readJson(".blueprint/answers.json", "the interview answers");
|
|
21
|
+
const { places, refused } = placesIn(answers.places);
|
|
22
|
+
if (refused.length > 0) fail(`these places are outside this folder: ${refused.join(", ")}`);
|
|
23
|
+
if (places.length === 0) fail("the answer names no place to check");
|
|
24
|
+
const absent = places.filter((place) => !existsSync(place));
|
|
25
|
+
if (absent.length > 0) fail(`not in this folder: ${absent.join(", ")}`);
|
|
26
|
+
const kinds = JSON.parse(readFileSync(join(process.env.BLUEPRINT_USECASE, "kinds.json"), "utf8")).kinds;
|
|
27
|
+
const genre = kinds.find((kind) => kind.option === answers.kind)?.genre;
|
|
28
|
+
if (!genre) fail(`the answer kind ${JSON.stringify(answers.kind)} is not one of the kinds in kinds.json`);
|
|
29
|
+
|
|
30
|
+
const textOrNull = (file) => (existsSync(file) ? readFileSync(file, "utf8") : null);
|
|
31
|
+
const findingsNow = (extra) => places.flatMap((place) => findingsIn(place, extra).filter(actionable));
|
|
32
|
+
const byRule = (findings) =>
|
|
33
|
+
Object.entries(findings.reduce((counts, finding) => ({ ...counts, [finding.rule]: (counts[finding.rule] ?? 0) + 1 }), {})).sort(
|
|
34
|
+
([a, x], [b, y]) => y - x || a.localeCompare(b),
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const survey = () => {
|
|
38
|
+
const record = readJson(RECORD, '{ "genre", "findings" }');
|
|
39
|
+
const measured = findingsNow(["--genre", genre]);
|
|
40
|
+
if (record?.genre !== genre) fail(`${RECORD}: "genre" must be ${genre}, the genre of the kind the person chose`);
|
|
41
|
+
if (record?.findings !== measured.length) fail(`${RECORD}: "findings" is ${record?.findings}, but chaff reports ${measured.length} as ${genre} now`);
|
|
42
|
+
writeFileSync(
|
|
43
|
+
READABLE,
|
|
44
|
+
[`genre: ${genre}`, `findings: ${measured.length}`, ...byRule(measured).map(([rule, count]) => ` ${rule}: ${count}`), ""].join("\n"),
|
|
45
|
+
);
|
|
46
|
+
writeFileSync(CHECKED, JSON.stringify({ config: textOrNull(CONFIG), workflow: existsSync(WORKFLOW), findings: measured.length }) + "\n");
|
|
47
|
+
console.log(`${measured.length} finding(s) today as ${genre}`);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const recorded = () => {
|
|
51
|
+
try {
|
|
52
|
+
return JSON.parse(readFileSync(CHECKED, "utf8"));
|
|
53
|
+
} catch {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const workflowSide = (checked) => {
|
|
59
|
+
if (answers.ci === WITH_CI) {
|
|
60
|
+
if (!existsSync(WORKFLOW)) return [`${WORKFLOW} is missing`];
|
|
61
|
+
const template = readFileSync(join(process.env.BLUEPRINT_USECASE, "templates", "chaff.yml"), "utf8");
|
|
62
|
+
return workflowProblems(readFileSync(WORKFLOW, "utf8"), template, places).map((problem) => `${WORKFLOW}: ${problem}`);
|
|
63
|
+
}
|
|
64
|
+
return !checked.workflow && existsSync(WORKFLOW) ? [`${WORKFLOW} was added, but the person chose no workflow`] : [];
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const apply = () => {
|
|
68
|
+
const checked = existsSync(CHECKED) ? recorded() : null;
|
|
69
|
+
if (checked === null || typeof checked !== "object") fail("the survey step's record is missing: run that step again");
|
|
70
|
+
if (!existsSync(CONFIG)) fail(`${CONFIG} is missing`);
|
|
71
|
+
const run = runChaff(["rules", "--json"]);
|
|
72
|
+
if (run.code !== 0) fail(`chaff could not load ${CONFIG}:\n${run.stderr}`);
|
|
73
|
+
const detected = JSON.parse(run.stdout).detected?.genre;
|
|
74
|
+
const baseline = existsSync(BASELINE) ? readJson(BASELINE, '{ "entries" }') : null;
|
|
75
|
+
const left = findingsNow([]);
|
|
76
|
+
// The shelf is the survey's, taken under this chaff.yaml: shown with what it shelves, chaff reports what was measured.
|
|
77
|
+
const shelved = findingsNow(["--show-baseline"]);
|
|
78
|
+
const problems = [
|
|
79
|
+
...(detected === genre ? [] : [`${CONFIG} gives genre ${detected}, not ${genre}`]),
|
|
80
|
+
...lostLines(checked.config, readFileSync(CONFIG, "utf8"), ["genre"]).map((line) => `${CONFIG} lost a line it had: ${line.trim()}`),
|
|
81
|
+
...(baseline === null ? [`${BASELINE} is missing: run chaff baseline on the places`] : []),
|
|
82
|
+
...(baseline !== null && (baseline.entries?.length ?? 0) < checked.findings
|
|
83
|
+
? [`${BASELINE} shelves ${baseline.entries?.length ?? 0} finding(s), fewer than the ${checked.findings} measured`]
|
|
84
|
+
: []),
|
|
85
|
+
...(shelved.length === checked.findings
|
|
86
|
+
? []
|
|
87
|
+
: [
|
|
88
|
+
`with its baseline shown, chaff reports ${shelved.length} finding(s) under ${CONFIG}, not the ${checked.findings} measured: the settings or the shelf are not the ones the person approved`,
|
|
89
|
+
]),
|
|
90
|
+
...(left.length === 0
|
|
91
|
+
? []
|
|
92
|
+
: [
|
|
93
|
+
`chaff still reports ${left.length} finding(s) the baseline does not shelve: ${byRule(left)
|
|
94
|
+
.map(([rule, count]) => `${rule} ${count}`)
|
|
95
|
+
.join(", ")}`,
|
|
96
|
+
]),
|
|
97
|
+
...workflowSide(checked),
|
|
98
|
+
];
|
|
99
|
+
if (problems.length > 0) fail(problems.join("\n"));
|
|
100
|
+
console.log(`chaff is set up: today's ${checked.findings} finding(s) shelved, only new ones will be reported`);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const mode = process.argv[2];
|
|
104
|
+
if (mode === "survey") survey();
|
|
105
|
+
else if (mode === "apply") apply();
|
|
106
|
+
else fail(`usage: adopt.mjs survey | apply (got ${JSON.stringify(mode)})`);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// The docs base holds the helpers every usecase on it shares (running chaff, reading Markdown sections).
|
|
2
|
+
// A usecase loads them from BLUEPRINT_BASE, which the executor sets for every check.
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { pathToFileURL } from "node:url";
|
|
5
|
+
|
|
6
|
+
if (!process.env.BLUEPRINT_BASE) {
|
|
7
|
+
console.error("BLUEPRINT_BASE is not set: run this check through the blueprint executor");
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** The URL of a module in the docs base's checks/, for `await import(...)`. */
|
|
12
|
+
export const fromBase = (file) => pathToFileURL(join(process.env.BLUEPRINT_BASE, "checks", file)).href;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// The report tells the person what was set up and how chaff behaves from now on: it names chaff.yaml, the baseline,
|
|
2
|
+
// and the workflow when one was made.
|
|
3
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
4
|
+
import { fromBase } from "./base.mjs";
|
|
5
|
+
const { fail, readJson } = await import(fromBase("chaff.mjs"));
|
|
6
|
+
const { missingSections } = await import(fromBase("markdown.mjs"));
|
|
7
|
+
|
|
8
|
+
const REPORT = ".blueprint/adopt-report.md";
|
|
9
|
+
const WITH_CI = "GitHub の PR に指摘を出すワークフローを作る";
|
|
10
|
+
|
|
11
|
+
if (!existsSync(REPORT)) fail(`${REPORT} is missing`);
|
|
12
|
+
const text = readFileSync(REPORT, "utf8");
|
|
13
|
+
const missing = missingSections(text, [
|
|
14
|
+
["入れたもの", "What was set up"],
|
|
15
|
+
["棚に上げた指摘", "Shelved findings"],
|
|
16
|
+
["これから", "From now on"],
|
|
17
|
+
]);
|
|
18
|
+
if (missing.length > 0) fail(`${REPORT} lacks sections: ${missing.join(", ")}`);
|
|
19
|
+
const ci = readJson(".blueprint/answers.json", "the interview answers").ci === WITH_CI;
|
|
20
|
+
const named = ["chaff.yaml", ".chaff-baseline.json", ...(ci ? [".github/workflows/chaff.yml"] : [])].filter((file) => !text.includes(file));
|
|
21
|
+
if (named.length > 0) fail(`${REPORT} does not name: ${named.join(", ")}`);
|
|
22
|
+
console.log("the report names what was set up");
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Types for setup.mjs, which the pack runs with plain node and the specs import.
|
|
2
|
+
export declare const placesIn: (answer: unknown) => { places: string[]; refused: string[] };
|
|
3
|
+
export declare const workflowFor: (template: string, places: readonly string[]) => string;
|
|
4
|
+
export declare const workflowProblems: (workflow: string, template: string, places: readonly string[]) => string[];
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// What adopting chaff in a folder of documents has to leave behind: the places chaff watches, and the workflow that
|
|
2
|
+
// reports on them. The workflow is the pack's template filled in with the places, exactly: a workflow is judged
|
|
3
|
+
// by being that one known file, not by reading arbitrary YAML for what might be unsafe in it.
|
|
4
|
+
import { posix } from "node:path";
|
|
5
|
+
|
|
6
|
+
// A place goes into the workflow's command line unquoted, so only characters with no meaning to a shell are allowed:
|
|
7
|
+
// letters and digits of any script, and . _ - / — never a leading - (it would read as an option).
|
|
8
|
+
const SAFE = /^[\p{L}\p{N}._/-]+$/u;
|
|
9
|
+
|
|
10
|
+
/** The places the answer names, one a line, as paths inside this folder; a line that leaves it or is unsafe is `refused`. */
|
|
11
|
+
export const placesIn = (answer) => {
|
|
12
|
+
const lines = String(answer ?? "")
|
|
13
|
+
.split("\n")
|
|
14
|
+
.map((line) => line.trim())
|
|
15
|
+
.filter((line) => line !== "");
|
|
16
|
+
const inside = (line) => {
|
|
17
|
+
const path = posix.normalize(line.replaceAll("\\", "/"));
|
|
18
|
+
if (posix.isAbsolute(path) || /^[A-Za-z]:/u.test(path) || path === ".." || path.startsWith("../")) return null;
|
|
19
|
+
const trimmed = path.replace(/\/$/u, "") || ".";
|
|
20
|
+
return SAFE.test(trimmed) && !trimmed.startsWith("-") ? trimmed : null;
|
|
21
|
+
};
|
|
22
|
+
return {
|
|
23
|
+
places: [...new Set(lines.map(inside).filter((path) => path !== null))],
|
|
24
|
+
refused: lines.filter((line) => inside(line) === null),
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** The workflow the pack writes for `places`: its template with the places in the chaff run. */
|
|
29
|
+
export const workflowFor = (template, places) => String(template).replace("{{PATHS}}", places.join(" "));
|
|
30
|
+
|
|
31
|
+
// Line endings and trailing spaces aside (a line's trailing \r goes with its spaces): an editor's habits are not a different workflow.
|
|
32
|
+
const normalized = (text) =>
|
|
33
|
+
String(text)
|
|
34
|
+
.split("\n")
|
|
35
|
+
.map((line) => line.trimEnd())
|
|
36
|
+
.join("\n")
|
|
37
|
+
.trimEnd();
|
|
38
|
+
|
|
39
|
+
/** What is wrong with `workflow`: anything but the template filled in with `places`. */
|
|
40
|
+
export const workflowProblems = (workflow, template, places) => {
|
|
41
|
+
if (normalized(workflow) === normalized(workflowFor(template, places))) return [];
|
|
42
|
+
const expected = normalized(workflowFor(template, places)).split("\n");
|
|
43
|
+
const actual = normalized(workflow).split("\n");
|
|
44
|
+
const at = expected.findIndex((line, index) => actual[index] !== line);
|
|
45
|
+
const line = at < 0 ? expected.length + 1 : at + 1;
|
|
46
|
+
return [`it is not the pack's template filled in with the places (first difference at line ${line}): copy the template again`];
|
|
47
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"questions": [
|
|
3
|
+
{
|
|
4
|
+
"id": "places",
|
|
5
|
+
"label": "chaff に見させる文書(このフォルダの中のフォルダかファイルを 1 行に 1 つ)",
|
|
6
|
+
"why": "ここにある文書の今の指摘を棚に上げ、以後はここの新しい指摘だけが出る",
|
|
7
|
+
"kind": "text",
|
|
8
|
+
"lines": true,
|
|
9
|
+
"pick": "files"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"id": "kind",
|
|
13
|
+
"label": "どんな文書ですか",
|
|
14
|
+
"why": "文書の種類ごとの物差し(文の長さの上限、どの検査を動かすか)で chaff が測る",
|
|
15
|
+
"kind": "select",
|
|
16
|
+
"options": [
|
|
17
|
+
"手順書・ヘルプ・マニュアル",
|
|
18
|
+
"README・開発者向けの説明",
|
|
19
|
+
"仕様書・設計書",
|
|
20
|
+
"よくある質問",
|
|
21
|
+
"用語集",
|
|
22
|
+
"技術ブログ",
|
|
23
|
+
"会社のサイトの記事(オウンドメディア)",
|
|
24
|
+
"報告書・社内文書",
|
|
25
|
+
"提案書・企画書",
|
|
26
|
+
"議事録",
|
|
27
|
+
"プレスリリース・お知らせ",
|
|
28
|
+
"契約書・利用規約",
|
|
29
|
+
"規程・社内規則",
|
|
30
|
+
"論文"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"id": "ci",
|
|
35
|
+
"label": "GitHub の PR に指摘を出しますか",
|
|
36
|
+
"why": "作ると、PR を出すたびに chaff が動き、新しい指摘がその行に出る",
|
|
37
|
+
"kind": "select",
|
|
38
|
+
"options": ["GitHub の PR に指摘を出すワークフローを作る", "作らない(手元で npx chaffjs を動かす)"],
|
|
39
|
+
"needsPath": { "GitHub の PR に指摘を出すワークフローを作る": ".git" }
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"kinds": [
|
|
3
|
+
{ "option": "手順書・ヘルプ・マニュアル", "genre": "docs/manual" },
|
|
4
|
+
{ "option": "README・開発者向けの説明", "genre": "technical/readme" },
|
|
5
|
+
{ "option": "仕様書・設計書", "genre": "technical/spec" },
|
|
6
|
+
{ "option": "よくある質問", "genre": "docs/faq" },
|
|
7
|
+
{ "option": "用語集", "genre": "docs/glossary" },
|
|
8
|
+
{ "option": "技術ブログ", "genre": "blog/tech" },
|
|
9
|
+
{ "option": "会社のサイトの記事(オウンドメディア)", "genre": "blog/owned-media" },
|
|
10
|
+
{ "option": "報告書・社内文書", "genre": "business/report" },
|
|
11
|
+
{ "option": "提案書・企画書", "genre": "business/proposal" },
|
|
12
|
+
{ "option": "議事録", "genre": "business/meeting-notes" },
|
|
13
|
+
{ "option": "プレスリリース・お知らせ", "genre": "business/press-release" },
|
|
14
|
+
{ "option": "契約書・利用規約", "genre": "legal/contract" },
|
|
15
|
+
{ "option": "規程・社内規則", "genre": "legal/statute" },
|
|
16
|
+
{ "option": "論文", "genre": "academic/paper" }
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "adopt",
|
|
3
|
+
"kind": "usecase",
|
|
4
|
+
"title": "文書のフォルダに chaff を入れる(今ある指摘は棚に上げて)",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"order": 100,
|
|
7
|
+
"description": "既にある文書のフォルダに chaff を入れる。文書の種類に合わせた chaff.yaml を置き、今ある指摘は chaff baseline で棚に上げて、新しい指摘だけが出るようにする。望めば、GitHub の PR の行に指摘が出るワークフローも作る。原本は変えない。",
|
|
8
|
+
"bases": ["docs"],
|
|
9
|
+
"report": ".blueprint/adopt-report.md",
|
|
10
|
+
"next": [
|
|
11
|
+
{
|
|
12
|
+
"usecase": "polish",
|
|
13
|
+
"answers": {
|
|
14
|
+
"style": "このフォルダの規約(STYLE.md と chaff.yaml)",
|
|
15
|
+
"scope": "chaff が指摘した所だけ",
|
|
16
|
+
"shelved": "棚上げした指摘も直す"
|
|
17
|
+
},
|
|
18
|
+
"carry": {
|
|
19
|
+
"targets": "places"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"presets": [
|
|
3
|
+
{
|
|
4
|
+
"id": "help-pages",
|
|
5
|
+
"title": "ヘルプのページに chaff を入れる",
|
|
6
|
+
"description": "見本のヘルプ(login.md と export.md)を「手順書・ヘルプ・マニュアル」として測り、今ある長すぎる文の指摘を棚に上げて、以後は新しい指摘だけが出るようにする。GitHub の PR に指摘を出すワークフローも作る。原本は変えない。",
|
|
7
|
+
"base": "docs",
|
|
8
|
+
"answers": {
|
|
9
|
+
"places": "login.md\nexport.md",
|
|
10
|
+
"kind": "手順書・ヘルプ・マニュアル",
|
|
11
|
+
"ci": "GitHub の PR に指摘を出すワークフローを作る"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: blueprint-adopt-apply
|
|
3
|
+
description: "Set chaff up in the folder: chaff.yaml for the chosen genre, today's findings shelved in .chaff-baseline.json, and, when asked, a GitHub workflow that puts new findings on the pull request's lines."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Set chaff up
|
|
7
|
+
|
|
8
|
+
The person approved the setup in `.blueprint/adopt.json`. The documents stay exactly as they are: fixing what is
|
|
9
|
+
shelved is 「文書を整える」's work, later.
|
|
10
|
+
|
|
11
|
+
## 1. chaff.yaml
|
|
12
|
+
|
|
13
|
+
Write the folder's `chaff.yaml` with the genre from `.blueprint/adopt.json` and the documents' `language`
|
|
14
|
+
(`npx chaffjs init --genre <genre>` writes a commented one). If the folder already has one, set its `genre` to the
|
|
15
|
+
chosen one and **keep every other line it has** — the check refuses any other line of the old file that is gone. Add the rule
|
|
16
|
+
levels the person agreed to at the gate, nothing else.
|
|
17
|
+
|
|
18
|
+
## 2. Shelve today's findings
|
|
19
|
+
|
|
20
|
+
Run `sh <base pack>/checks/chaff.sh baseline <place> …` with every place. It writes `.chaff-baseline.json` in the
|
|
21
|
+
folder: the findings there today are not reported again; new ones are. Tell the person to commit it with
|
|
22
|
+
`chaff.yaml`.
|
|
23
|
+
|
|
24
|
+
## 3. The workflow — only when `ci` is 「GitHub の PR に指摘を出すワークフローを作る」
|
|
25
|
+
|
|
26
|
+
Copy `<usecase pack>/templates/chaff.yml` to `.github/workflows/chaff.yml`, replacing `{{PATHS}}` with the places
|
|
27
|
+
separated by spaces, and change nothing else: the check compares the file with the template filled in that way, line
|
|
28
|
+
for line. Its `permissions:` let the workflow read the documents (`contents: read`) and upload findings
|
|
29
|
+
(`security-events: write`), nothing more. A place whose name has a space or a character a shell reads (`$`, `;`, `*`,
|
|
30
|
+
quotes…) cannot go into the workflow: the interview refuses it, so ask the person to name a folder above it instead. When `ci` is 「作らない」, add nothing under `.github/`.
|
|
31
|
+
|
|
32
|
+
## 4. The report
|
|
33
|
+
|
|
34
|
+
Write `.blueprint/adopt-report.md` for the person, in their language and in plain words:
|
|
35
|
+
|
|
36
|
+
- `## 入れたもの` / `## What was set up` — `chaff.yaml` (the genre, and why), `.chaff-baseline.json`, and the
|
|
37
|
+
workflow `.github/workflows/chaff.yml` when one was made. The check looks for each file's name.
|
|
38
|
+
- `## 棚に上げた指摘` / `## Shelved findings` — how many were shelved, by rule, in plain words.
|
|
39
|
+
- `## これから` / `## From now on` — only new findings are reported (run `npx chaffjs <places>` by hand, or see them
|
|
40
|
+
on the pull request's lines); how to lower the shelf later (「文書を整える」, then `chaff baseline` again); that
|
|
41
|
+
the workflow needs code scanning enabled on the repository (a public repository has it; a private one needs
|
|
42
|
+
GitHub Advanced Security).
|
|
43
|
+
|
|
44
|
+
## Done when
|
|
45
|
+
|
|
46
|
+
`node <usecase pack>/checks/adopt.mjs apply` and then `node <usecase pack>/checks/report.mjs` (with `BLUEPRINT_BASE`
|
|
47
|
+
and `BLUEPRINT_USECASE` set) pass.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: blueprint-adopt-survey
|
|
3
|
+
description: "Measure what chaff reports on the named documents today, as the kind the person chose, and propose the setup — changing nothing yet."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Measure what is there today
|
|
7
|
+
|
|
8
|
+
`.blueprint/answers.json` names the places chaff will watch (`places`, a folder or a file a line), what kind of
|
|
9
|
+
documents they are (`kind`) and whether a GitHub workflow is wanted (`ci`). The person may not be an engineer: say
|
|
10
|
+
what you do in plain words.
|
|
11
|
+
|
|
12
|
+
Change nothing in the repository: this step only measures. The person approves the setup before anything is
|
|
13
|
+
written.
|
|
14
|
+
|
|
15
|
+
## Measure
|
|
16
|
+
|
|
17
|
+
The kind maps to a genre in `<usecase pack>/kinds.json`. For each place, run
|
|
18
|
+
`sh <base pack>/checks/chaff.sh <place> --genre <genre> --compact` and count the warnings and errors, by rule. Read a
|
|
19
|
+
few of them: a rule that reports mostly what the documents do on purpose may be worth turning down in `chaff.yaml`
|
|
20
|
+
rather than shelving — say which, and why, for the person to decide at the gate.
|
|
21
|
+
|
|
22
|
+
## Write `.blueprint/adopt.json`
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{ "genre": "docs/manual", "findings": 2, "proposal": "chaff.yaml に genre と language を書き、今の 2 件を棚に上げる。" }
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`findings` is the number of warnings and errors chaff reports on all the places together, as that genre, now; the
|
|
29
|
+
check measures it again. If the folder already has a `chaff.yaml` or a `.chaff-baseline.json`, say so in
|
|
30
|
+
`proposal`: the next step keeps what they hold.
|
|
31
|
+
|
|
32
|
+
## Done when
|
|
33
|
+
|
|
34
|
+
`node <usecase pack>/checks/adopt.mjs survey` (with `BLUEPRINT_BASE` and `BLUEPRINT_USECASE` set to the pack folders
|
|
35
|
+
from your prompt) passes. It writes `.blueprint/adopt.txt`, what the person reads before anything changes.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"steps": [
|
|
3
|
+
{
|
|
4
|
+
"id": "survey",
|
|
5
|
+
"title": "今の指摘を測る",
|
|
6
|
+
"description": "選んだ種類で、文書に今どれだけ指摘があるかを測り、入れる設定の案を書く。まだ何も変えない。",
|
|
7
|
+
"skill": "skills/survey",
|
|
8
|
+
"check": "node \"$BLUEPRINT_USECASE/checks/adopt.mjs\" survey"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "apply",
|
|
12
|
+
"title": "chaff を入れる",
|
|
13
|
+
"description": "chaff.yaml を置き、今の指摘を .chaff-baseline.json に棚上げし、望めば PR に指摘を出すワークフローを足す。以後は新しい指摘だけが出ることを機械で確かめる。",
|
|
14
|
+
"skill": "skills/apply",
|
|
15
|
+
"check": "node \"$BLUEPRINT_USECASE/checks/adopt.mjs\" apply && node \"$BLUEPRINT_USECASE/checks/report.mjs\"",
|
|
16
|
+
"gates": ["review"],
|
|
17
|
+
"reads": [".blueprint/adopt.txt"]
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Checks the documents with chaff on every pull request, and puts each new finding on the line it is about.
|
|
2
|
+
# The findings already in the documents are shelved in .chaff-baseline.json, so only new ones appear.
|
|
3
|
+
name: chaff
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
chaff:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
permissions:
|
|
15
|
+
contents: read
|
|
16
|
+
security-events: write
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v7
|
|
19
|
+
with:
|
|
20
|
+
persist-credentials: false
|
|
21
|
+
- uses: actions/setup-node@v7
|
|
22
|
+
with:
|
|
23
|
+
node-version: 24
|
|
24
|
+
- run: npx -y chaffjs@0.17 {{PATHS}} --sarif chaff.sarif
|
|
25
|
+
continue-on-error: true
|
|
26
|
+
- uses: github/codeql-action/upload-sarif@1c5b675653bb5c22dbe9b12b556ec555138e09fd # v4.38.1
|
|
27
|
+
with:
|
|
28
|
+
sarif_file: chaff.sarif
|
|
29
|
+
category: chaff
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"kind": "usecase",
|
|
4
4
|
"title": "文書に尋ねる(どこに書いてあるかを添えて)",
|
|
5
5
|
"version": "0.1.0",
|
|
6
|
+
"order": 40,
|
|
6
7
|
"description": "込み入ったマニュアル・規程・契約書に質問すると、文書のどこに書いてあるかを原文の引用で示して答える。書いていないことは「書いていない」と答える。引用は chaff cite で原文にあることを確かめる。答えは、人が読んでから FAQ.md に残せる。",
|
|
7
8
|
"bases": ["docs"],
|
|
8
9
|
"report": ".blueprint/replies.md"
|
|
@@ -10,6 +10,17 @@
|
|
|
10
10
|
"questions": "申請の期限はいつまで?\n領収書をなくしたときはどうする?\n海外出張の日当はいくら?",
|
|
11
11
|
"keep": "このフォルダの FAQ.md に書き足す"
|
|
12
12
|
}
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"id": "kyuka",
|
|
16
|
+
"title": "休暇の規程と手引きに尋ねる",
|
|
17
|
+
"description": "見本の休暇規程(kitei.md)と手引き(tebiki.md)に 3 つの質問をする。申請の期限は規程と手引きで違うので、両方を引用して食い違いを示す。半日の休みは手引きの引用で答え、どちらにも無い夏季休暇には「書いていない」と答える。答えはフォルダに残さない。",
|
|
18
|
+
"base": "docs",
|
|
19
|
+
"answers": {
|
|
20
|
+
"documents": "kitei.md\ntebiki.md",
|
|
21
|
+
"questions": "有給休暇は何日前までに申請すればいい?\n半日だけ休める?\n夏季休暇は何日ある?",
|
|
22
|
+
"keep": "残さない(.blueprint の中だけ)"
|
|
23
|
+
}
|
|
13
24
|
}
|
|
14
25
|
]
|
|
15
26
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"kind": "usecase",
|
|
4
4
|
"title": "版を比べる(新旧対照表をつくる)",
|
|
5
5
|
"version": "0.1.0",
|
|
6
|
+
"order": 60,
|
|
6
7
|
"description": "契約書や規程の旧版と新版を条ごとに対応づけ、何が変わり、何が足され、何が消えたかを新旧対照表にする。変わったかどうかは条の本文を機械で比べて決めるので、変わっていない条を「変わった」と書く誤り、その逆は通らない。原本は変えない。",
|
|
7
8
|
"bases": ["docs"],
|
|
8
9
|
"report": ".blueprint/compare-report.md"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
出張旅費規程
|
|
2
|
+
|
|
3
|
+
第1条(目的)
|
|
4
|
+
この規程は、社員が業務のために出張するときの旅費の支給について定める。
|
|
5
|
+
|
|
6
|
+
第2条(出張の命令)
|
|
7
|
+
出張は、所属長の命令によって行う。
|
|
8
|
+
|
|
9
|
+
第3条(交通費)
|
|
10
|
+
交通費は、最も経済的な通常の経路と方法によって計算した実費を支給する。
|
|
11
|
+
|
|
12
|
+
第4条(日当)
|
|
13
|
+
日当は、出張一日につき2,000円を支給する。
|
|
14
|
+
|
|
15
|
+
第5条(宿泊費)
|
|
16
|
+
宿泊費は、一泊につき9,000円を上限として実費を支給する。
|
|
17
|
+
|
|
18
|
+
第6条(回数券の購入)
|
|
19
|
+
同じ区間を月に四度以上往復するときは、回数券を購入しなければならない。
|
|
20
|
+
|
|
21
|
+
第7条(精算)
|
|
22
|
+
出張から戻った者は、戻った日から14日以内に、第3条から第5条までの旅費を精算しなければならない。
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
出張旅費規程
|
|
2
|
+
|
|
3
|
+
第1条(目的)
|
|
4
|
+
この規程は、社員が業務のために出張するときの旅費の支給について定める。
|
|
5
|
+
|
|
6
|
+
第2条(出張の命令)
|
|
7
|
+
出張は、所属長の命令によって行う。ただし、オンライン会議で目的を果たせるときは、出張を命じない。
|
|
8
|
+
|
|
9
|
+
第3条(交通費)
|
|
10
|
+
交通費は、最も経済的な通常の経路と方法によって計算した実費を支給する。
|
|
11
|
+
|
|
12
|
+
第4条(日当)
|
|
13
|
+
日当は、出張一日につき2,500円を支給する。
|
|
14
|
+
|
|
15
|
+
第5条(宿泊費)
|
|
16
|
+
宿泊費は、一泊につき12,000円を上限として実費を支給する。
|
|
17
|
+
|
|
18
|
+
第6条(精算)
|
|
19
|
+
出張から戻った者は、戻った日から10日以内に、第3条から第5条までの旅費を精算しなければならない。
|
|
20
|
+
|
|
21
|
+
第7条(施行)
|
|
22
|
+
この規程は、2027年4月1日から施行する。
|
|
@@ -5,7 +5,22 @@
|
|
|
5
5
|
"title": "業務委託契約書の改定を比べる",
|
|
6
6
|
"description": "見本の業務委託契約書の旧版(kyu.txt)と改定版(shin.txt)を条ごとに対応づけ、委託料や報告の回数が変わったこと、報告の条が足され、成果物の条が消えて契約期間の条が繰り上がったことを新旧対照表にする。原本は変えない。",
|
|
7
7
|
"base": "docs",
|
|
8
|
-
"answers": {
|
|
8
|
+
"answers": {
|
|
9
|
+
"old": "kyu.txt",
|
|
10
|
+
"new": "shin.txt",
|
|
11
|
+
"focus": ""
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"id": "ryohi-kaitei",
|
|
16
|
+
"title": "出張旅費規程の改定を比べる",
|
|
17
|
+
"description": "見本の出張旅費規程の旧版(kyu.txt)と改定版(shin.txt)を条ごとに対応づけ、日当と宿泊費の上限が上がったこと、出張を命じない場合がただし書きで足されたこと、回数券の条が消えて精算の条が繰り上がり期限が短くなったこと、施行の条が足されたことを新旧対照表にする。原本は変えない。",
|
|
18
|
+
"base": "docs",
|
|
19
|
+
"answers": {
|
|
20
|
+
"old": "kyu.txt",
|
|
21
|
+
"new": "shin.txt",
|
|
22
|
+
"focus": ""
|
|
23
|
+
}
|
|
9
24
|
}
|
|
10
25
|
]
|
|
11
26
|
}
|