@plebeiantech/lat.md 0.12.3-fork.2 → 0.12.3-fork.21
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 +31 -2
- package/dist/src/cli/agent-invocation.d.ts +6 -0
- package/dist/src/cli/agent-invocation.js +23 -0
- package/dist/src/cli/checklist-menu.d.ts +2 -1
- package/dist/src/cli/checklist-menu.js +3 -2
- package/dist/src/cli/comment-guard.d.ts +14 -0
- package/dist/src/cli/comment-guard.js +10 -33
- package/dist/src/cli/comment-reminder.d.ts +65 -6
- package/dist/src/cli/comment-reminder.js +164 -28
- package/dist/src/cli/fork-instructions.d.ts +20 -0
- package/dist/src/cli/fork-instructions.js +184 -0
- package/dist/src/cli/fork-scaffold.d.ts +106 -0
- package/dist/src/cli/fork-scaffold.js +490 -0
- package/dist/src/cli/graph.d.ts +1 -1
- package/dist/src/cli/hook.d.ts +26 -0
- package/dist/src/cli/hook.js +115 -64
- package/dist/src/cli/index.js +166 -64
- package/dist/src/cli/init-preferences.d.ts +4 -0
- package/dist/src/cli/init-preferences.js +36 -0
- package/dist/src/cli/init.d.ts +2 -1
- package/dist/src/cli/init.js +107 -50
- package/dist/src/cli/reindex.d.ts +1 -1
- package/dist/src/cli/reindex.js +7 -10
- package/dist/src/cli/search.d.ts +14 -4
- package/dist/src/cli/search.js +116 -100
- package/dist/src/cli/ui-build-server.d.ts +12 -0
- package/dist/src/cli/ui-build-server.js +26 -0
- package/dist/src/cli/ui-build.d.ts +4 -0
- package/dist/src/cli/ui-build.js +13 -0
- package/dist/src/cli/ui.d.ts +1 -1
- package/dist/src/cli/ui.js +18 -2
- package/dist/src/fork/antigravity-hook.d.ts +47 -0
- package/dist/src/fork/antigravity-hook.js +424 -0
- package/dist/src/fork/antigravity-init.d.ts +17 -0
- package/dist/src/fork/antigravity-init.js +124 -0
- package/dist/src/fork/upstream-drift-cli.js +2 -0
- package/dist/src/fork/upstream-drift.d.ts +26 -0
- package/dist/src/fork/upstream-drift.js +185 -0
- package/dist/src/fork/upstream-guard-cli.d.ts +1 -0
- package/dist/src/fork/upstream-guard-cli.js +2 -0
- package/dist/src/fork/upstream-guard.d.ts +72 -0
- package/dist/src/fork/upstream-guard.js +445 -0
- package/dist/src/graph-export.d.ts +2 -0
- package/dist/src/graph-export.js +38 -19
- package/dist/src/knowledge/claude-memory.d.ts +1 -0
- package/dist/src/knowledge/claude-memory.js +33 -4
- package/dist/src/knowledge/index.js +2 -2
- package/dist/src/mcp/server.js +34 -18
- package/dist/src/search/cache.d.ts +3 -0
- package/dist/src/search/cache.js +104 -0
- package/dist/src/search/chunks.d.ts +23 -0
- package/dist/src/search/chunks.js +200 -0
- package/dist/src/search/db.d.ts +28 -16
- package/dist/src/search/db.js +106 -40
- package/dist/src/search/embedder.d.ts +2 -1
- package/dist/src/search/embedder.js +7 -6
- package/dist/src/search/index.d.ts +6 -2
- package/dist/src/search/index.js +176 -53
- package/dist/src/search/lexical.d.ts +6 -0
- package/dist/src/search/lexical.js +36 -0
- package/dist/src/search/lock.d.ts +5 -0
- package/dist/src/search/lock.js +45 -0
- package/dist/src/search/query.d.ts +26 -0
- package/dist/src/search/query.js +103 -0
- package/dist/src/search/search.d.ts +17 -7
- package/dist/src/search/search.js +164 -14
- package/dist/src/search/types.d.ts +15 -0
- package/dist/src/search/types.js +1 -0
- package/dist/src/view/client/assets/GraphView-0bPe_Q5I.js +456 -0
- package/dist/src/view/client/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/src/view/client/assets/MarkdownEditor-1_8mI7lO.js +28 -0
- package/dist/src/view/client/assets/OrbitControls-DwcpQNja.js +1 -0
- package/dist/src/view/client/assets/STLLoader-CLWTKt5i.js +1 -0
- package/dist/src/view/client/assets/_commonjsHelpers-CqkleIqs.js +1 -0
- package/dist/src/view/client/assets/abnfDiagram-VCTEODGH-BLIuikwY.js +1 -0
- package/dist/src/view/client/assets/arc-D4PzdKSA.js +1 -0
- package/dist/src/view/client/assets/architectureDiagram-5GKGNRK7-35Egww62.js +36 -0
- package/dist/src/view/client/assets/blockDiagram-I7D4REHJ-tqNy53-W.js +129 -0
- package/dist/src/view/client/assets/c4Diagram-7LVT6UL2-DZ_GcD9K.js +38 -0
- package/dist/src/view/client/assets/channel-DensupHE.js +1 -0
- package/dist/src/view/client/assets/chunk-2Q5K7J3B-BUjq4Q7b.js +1 -0
- package/dist/src/view/client/assets/chunk-5VM5RSS4-BsIix6I5.js +15 -0
- package/dist/src/view/client/assets/chunk-F27PBJKO-Dxo7UheG.js +1 -0
- package/dist/src/view/client/assets/chunk-IMKFNOWR-C5lzUDK5.js +231 -0
- package/dist/src/view/client/assets/chunk-JWPE2WC7-qCHQlKfY.js +1 -0
- package/dist/src/view/client/assets/chunk-POPQ4Y6H-CDPKw21I.js +1 -0
- package/dist/src/view/client/assets/chunk-SVP7TREG-CD_C-9M-.js +88 -0
- package/dist/src/view/client/assets/chunk-TICWLB2K-ZMatRvad.js +206 -0
- package/dist/src/view/client/assets/chunk-XXDRQBXY-dDs4quwg.js +1 -0
- package/dist/src/view/client/assets/classDiagram-ZZMXUADV-CV7ArHLW.js +1 -0
- package/dist/src/view/client/assets/classDiagram-v2-VYDZK3BY-CV7ArHLW.js +1 -0
- package/dist/src/view/client/assets/cose-bilkent-JH36ORCC-CwH3-T1N.js +1 -0
- package/dist/src/view/client/assets/cynefin-OW5HDTMX-DodS6r00.js +166 -0
- package/dist/src/view/client/assets/cynefinDiagram-5FMLGOSQ-D7WDoy0K.js +62 -0
- package/dist/src/view/client/assets/cytoscape.esm-DzSz-X2X.js +321 -0
- package/dist/src/view/client/assets/dagre-GXQ25YYZ-yc2GTi5h.js +4 -0
- package/dist/src/view/client/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/src/view/client/assets/diagram-S7CK7UJ4-CEP0FGL8.js +30 -0
- package/dist/src/view/client/assets/diagram-UQ7AKVKN-BZIEojBf.js +41 -0
- package/dist/src/view/client/assets/diagram-VSXAHHWV-BSB6COmM.js +3 -0
- package/dist/src/view/client/assets/diagram-VX7I27RA-DqfR3psV.js +24 -0
- package/dist/src/view/client/assets/diagram-Z3DM3KII-B79t0s5P.js +24 -0
- package/dist/src/view/client/assets/ebnfDiagram-PWID7BFC-CqbCQhE1.js +1 -0
- package/dist/src/view/client/assets/erDiagram-RLTQ6QDP-BVfoYIhJ.js +99 -0
- package/dist/src/view/client/assets/flowDiagram-HODETNUW-Dfyjm6ib.js +168 -0
- package/dist/src/view/client/assets/ganttDiagram-EL5Y4UJY-Da9ta_k3.js +292 -0
- package/dist/src/view/client/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- package/dist/src/view/client/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- package/dist/src/view/client/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- package/dist/src/view/client/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- package/dist/src/view/client/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
- package/dist/src/view/client/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
- package/dist/src/view/client/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
- package/dist/src/view/client/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
- package/dist/src/view/client/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
- package/dist/src/view/client/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
- package/dist/src/view/client/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- package/dist/src/view/client/assets/gitGraphDiagram-WWUBYQGX-BDqlQ6LG.js +106 -0
- package/dist/src/view/client/assets/index-BnENo9bV.js +1 -0
- package/dist/src/view/client/assets/index-DG0Ez15D.css +1 -0
- package/dist/src/view/client/assets/index-heNSjszK.js +13 -0
- package/dist/src/view/client/assets/infoDiagram-27XIBGKW-CozIUYm1.js +2 -0
- package/dist/src/view/client/assets/init-Gi6I4Gst.js +1 -0
- package/dist/src/view/client/assets/ishikawaDiagram-5VMMS53U-tkBLr-Tn.js +70 -0
- package/dist/src/view/client/assets/journeyDiagram-3NMN7TZE-Dcd_Ofwc.js +139 -0
- package/dist/src/view/client/assets/kanban-definition-UXKFOSKX-CQvZmdAf.js +89 -0
- package/dist/src/view/client/assets/katex-HP8lGamR.js +257 -0
- package/dist/src/view/client/assets/layout-BxuGL0Ip.js +1 -0
- package/dist/src/view/client/assets/linear-D8tR6G5K.js +1 -0
- package/dist/src/view/client/assets/logo-RR_KBOAT.svg +149 -0
- package/dist/src/view/client/assets/maplibre-gl-CDX6Zuow.js +800 -0
- package/dist/src/view/client/assets/mermaid.core-BlHZooLK.js +310 -0
- package/dist/src/view/client/assets/mindmap-definition-YA3MSWOX-BqvVz5lC.js +96 -0
- package/dist/src/view/client/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/src/view/client/assets/pegDiagram-XKGWAZYB-BkbOOTxX.js +1 -0
- package/dist/src/view/client/assets/pieDiagram-E7YTZNPT-BToTpG0m.js +39 -0
- package/dist/src/view/client/assets/quadrantDiagram-AXDQQJYC-CerD2TfT.js +7 -0
- package/dist/src/view/client/assets/railroadDiagram-O6MQD6OU-B2oElPYD.js +1 -0
- package/dist/src/view/client/assets/requirementDiagram-BXWQKSXE-BCL8RGFd.js +84 -0
- package/dist/src/view/client/assets/sankeyDiagram-P5KCCOFB-BqnkNRPm.js +40 -0
- package/dist/src/view/client/assets/sequenceDiagram-WJ2MYXX4-DKSKYknp.js +162 -0
- package/dist/src/view/client/assets/sizeCapture-INFHLROL-D8reQ7IM.js +1 -0
- package/dist/src/view/client/assets/stateDiagram-D77RDMKH-B-Eme-BN.js +1 -0
- package/dist/src/view/client/assets/stateDiagram-v2-MP3YSRHH-yXL-Y-Ym.js +1 -0
- package/dist/src/view/client/assets/swimlanes-42K2YHIH-lK0158X4.js +1 -0
- package/dist/src/view/client/assets/swimlanesDiagram-VR7AAH4N-CGn5WOGw.js +8 -0
- package/dist/src/view/client/assets/three.module-PDSP0dbZ.js +4108 -0
- package/dist/src/view/client/assets/timeline-definition-24CTP7MA-imh-edhJ.js +120 -0
- package/dist/src/view/client/assets/vennDiagram-4TSXK5OY-Ixwhcd6r.js +34 -0
- package/dist/src/view/client/assets/wardleyDiagram-VM6X3IG4-Cvr_zzKI.js +78 -0
- package/dist/src/view/client/assets/xychartDiagram-S5SC5T6Z-BvcmHKlQ.js +7 -0
- package/dist/src/view/client/index.html +2 -2
- package/dist/src/view/client-shell.d.ts +2 -0
- package/dist/src/view/client-shell.js +5 -0
- package/dist/src/view/diagnostics.d.ts +3 -2
- package/dist/src/view/diagnostics.js +49 -58
- package/dist/src/view/document-edit.d.ts +8 -0
- package/dist/src/view/document-edit.js +25 -0
- package/dist/src/view/document-route.d.ts +14 -0
- package/dist/src/view/document-route.js +126 -0
- package/dist/src/view/document-tree.d.ts +18 -0
- package/dist/src/view/document-tree.js +139 -0
- package/dist/src/view/external-document-tree.d.ts +3 -0
- package/dist/src/view/external-document-tree.js +674 -0
- package/dist/src/view/git-diff.js +205 -1
- package/dist/src/view/git.js +1 -1
- package/dist/src/view/graph.d.ts +7 -0
- package/dist/src/view/graph.js +267 -0
- package/dist/src/view/highlight.d.ts +10 -2
- package/dist/src/view/highlight.js +50648 -3166
- package/dist/src/view/markdown.d.ts +8 -3
- package/dist/src/view/markdown.js +311 -41
- package/dist/src/view/preindexed-search.d.ts +15 -0
- package/dist/src/view/preindexed-search.js +25 -0
- package/dist/src/view/protocol.d.ts +95 -6
- package/dist/src/view/protocol.js +1 -1
- package/dist/src/view/publication.d.ts +2 -0
- package/dist/src/view/publication.js +78 -0
- package/dist/src/view/references.d.ts +13 -26
- package/dist/src/view/references.js +150 -119
- package/dist/src/view/repository.d.ts +18 -5
- package/dist/src/view/repository.js +269 -27
- package/dist/src/view/request-security.d.ts +5 -0
- package/dist/src/view/request-security.js +46 -0
- package/dist/src/view/search-result.d.ts +4 -0
- package/dist/src/view/search-result.js +25 -0
- package/dist/src/view/search.d.ts +7 -2
- package/dist/src/view/search.js +23 -33
- package/dist/src/view/server-build.d.ts +21 -0
- package/dist/src/view/server-build.js +145 -0
- package/dist/src/view/server-deployment.d.ts +31 -0
- package/dist/src/view/server-deployment.js +94 -0
- package/dist/src/view/server-index-worker.d.ts +6 -0
- package/dist/src/view/server-index-worker.js +14 -0
- package/dist/src/view/server.d.ts +14 -2
- package/dist/src/view/server.js +254 -51
- package/dist/src/view/source-target.d.ts +10 -0
- package/dist/src/view/source-target.js +43 -0
- package/dist/src/view/static-build.d.ts +32 -0
- package/dist/src/view/static-build.js +741 -0
- package/dist/src/view/static-protocol.d.ts +47 -0
- package/dist/src/view/static-protocol.js +15 -0
- package/dist/src/view/store.d.ts +26 -3
- package/dist/src/view/store.js +325 -44
- package/dist/src/view/table-of-contents.d.ts +9 -0
- package/dist/src/view/table-of-contents.js +83 -0
- package/dist/src/view/vercel-build.d.ts +24 -0
- package/dist/src/view/vercel-build.js +140 -0
- package/dist/src/view/vercel-server-build.d.ts +10 -0
- package/dist/src/view/vercel-server-build.js +61 -0
- package/dist/vendor/lat.md-server/cli.d.ts +2 -0
- package/dist/vendor/lat.md-server/cli.js +12 -0
- package/dist/vendor/lat.md-server/index.d.ts +38 -0
- package/dist/vendor/lat.md-server/index.js +128 -0
- package/package.json +72 -25
- package/plugins/lat-md/README.md +61 -0
- package/plugins/lat-md/hooks.json +38 -0
- package/plugins/lat-md/plugin.json +9 -0
- package/plugins/lat-md/rules/AGENTS.md +118 -0
- package/plugins/lat-md/skills/lat-md/SKILL.md +178 -0
- package/plugins/lat-md/skills/lat-md-conventions/SKILL.md +182 -0
- package/templates/AGENTS.md +19 -20
- package/templates/cursor-rules.md +14 -7
- package/templates/fork/conventions.md +173 -0
- package/templates/opencode-plugin.ts +9 -9
- package/templates/pi-extension.ts +11 -11
- package/templates/skill/SKILL.md +28 -17
- package/dist/src/cli/check-frontmatter.d.ts +0 -12
- package/dist/src/cli/check-frontmatter.js +0 -44
- package/dist/src/cli/check-mode.d.ts +0 -6
- package/dist/src/cli/check-mode.js +0 -303
- package/dist/src/cli/check-status.d.ts +0 -74
- package/dist/src/cli/check-status.js +0 -217
- package/dist/src/cli/check.d.ts +0 -45
- package/dist/src/cli/check.js +0 -777
- package/dist/src/cli/context.d.ts +0 -11
- package/dist/src/cli/context.js +0 -58
- package/dist/src/cli/expand.d.ts +0 -8
- package/dist/src/cli/expand.js +0 -94
- package/dist/src/cli/gen-index.d.ts +0 -45
- package/dist/src/cli/gen-index.js +0 -235
- package/dist/src/cli/link-scheme.d.ts +0 -54
- package/dist/src/cli/link-scheme.js +0 -101
- package/dist/src/cli/locate.d.ts +0 -2
- package/dist/src/cli/locate.js +0 -17
- package/dist/src/cli/refs.d.ts +0 -22
- package/dist/src/cli/refs.js +0 -229
- package/dist/src/cli/section.d.ts +0 -43
- package/dist/src/cli/section.js +0 -252
- package/dist/src/cli/select-menu.d.ts +0 -13
- package/dist/src/cli/select-menu.js +0 -100
- package/dist/src/code-refs.d.ts +0 -17
- package/dist/src/code-refs.js +0 -277
- package/dist/src/config.d.ts +0 -29
- package/dist/src/config.js +0 -83
- package/dist/src/context.d.ts +0 -23
- package/dist/src/context.js +0 -11
- package/dist/src/extensions/wiki-link/from-markdown.d.ts +0 -5
- package/dist/src/extensions/wiki-link/from-markdown.js +0 -34
- package/dist/src/extensions/wiki-link/index.d.ts +0 -4
- package/dist/src/extensions/wiki-link/index.js +0 -3
- package/dist/src/extensions/wiki-link/syntax.d.ts +0 -14
- package/dist/src/extensions/wiki-link/syntax.js +0 -121
- package/dist/src/extensions/wiki-link/to-markdown.d.ts +0 -5
- package/dist/src/extensions/wiki-link/to-markdown.js +0 -28
- package/dist/src/extensions/wiki-link/types.d.ts +0 -34
- package/dist/src/format.d.ts +0 -8
- package/dist/src/format.js +0 -43
- package/dist/src/init-version.d.ts +0 -10
- package/dist/src/init-version.js +0 -49
- package/dist/src/lattice.d.ts +0 -108
- package/dist/src/lattice.js +0 -816
- package/dist/src/parser.d.ts +0 -3
- package/dist/src/parser.js +0 -18
- package/dist/src/source-parser.d.ts +0 -27
- package/dist/src/source-parser.js +0 -916
- package/dist/src/untrusted.d.ts +0 -24
- package/dist/src/untrusted.js +0 -97
- package/dist/src/view/client/assets/index-B0n0u03y.css +0 -1
- package/dist/src/view/client/assets/index-xm2_px4q.js +0 -23
- package/dist/src/walk.d.ts +0 -18
- package/dist/src/walk.js +0 -27
- /package/dist/src/{extensions/wiki-link/types.js → fork/upstream-drift-cli.d.ts} +0 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# lat.md conventions this project enforces
|
|
2
|
+
|
|
3
|
+
`lat check` fails on the first three rules below. The last two it cannot see,
|
|
4
|
+
and they matter as much. None of the five are style preferences. This block is
|
|
5
|
+
generated and a later `lat init` replaces it — record project guidance in
|
|
6
|
+
`lat.md/`, never here.
|
|
7
|
+
|
|
8
|
+
## Every document goes in a Diátaxis mode directory
|
|
9
|
+
|
|
10
|
+
A document belongs in exactly one of four subdirectories, and `lat check mode`
|
|
11
|
+
enforces one shape rule for each:
|
|
12
|
+
|
|
13
|
+
| Directory | Holds | Shape rule |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
| `lat.md/tutorials/` | a guided first pass for someone new | an ordered list of steps, and a stated outcome |
|
|
16
|
+
| `lat.md/how-to/` | a recipe for a task that recurs | an ordered list of steps |
|
|
17
|
+
| `lat.md/reference/` | lookup facts: fields, states, limits, names | no narrative prose — no second paragraph under a heading |
|
|
18
|
+
| `lat.md/explanation/` | why the design is what it is | no imperative commands |
|
|
19
|
+
|
|
20
|
+
A document is classified either by the directory it sits in, or by declaring
|
|
21
|
+
the mode in its own frontmatter:
|
|
22
|
+
|
|
23
|
+
```markdown
|
|
24
|
+
---
|
|
25
|
+
lat:
|
|
26
|
+
mode: explanation
|
|
27
|
+
---
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Both are enforced identically — `lat check mode` applies the shape rule to any
|
|
31
|
+
document that declares a mode, whether or not the root index carries
|
|
32
|
+
`require-mode: true`. That flag adds a separate rule: a document declaring *no*
|
|
33
|
+
mode, in no mode directory, becomes an error too.
|
|
34
|
+
|
|
35
|
+
Prefer the directory in a tree you own outright. Prefer the declaration when
|
|
36
|
+
the file cannot move — a document another project maintains, or a tree other
|
|
37
|
+
agents are writing to while you work. Moving costs every reference to the file;
|
|
38
|
+
declaring costs nothing at read time, because frontmatter sits above the first
|
|
39
|
+
heading and outside every section.
|
|
40
|
+
|
|
41
|
+
**A document that fails its mode is usually two documents.** A file that lists
|
|
42
|
+
the states *and* argues for the design is mixed: the lookup half goes in
|
|
43
|
+
`reference/`, the reasoning half in `explanation/`, and each links the other.
|
|
44
|
+
Filing it under one mode and softening the prose until the check passes is the
|
|
45
|
+
wrong repair.
|
|
46
|
+
|
|
47
|
+
Classifying a mixed document does not make it pass. Narrative prose put under
|
|
48
|
+
`reference/` fails on contact, because a reference may not carry a second
|
|
49
|
+
paragraph under a heading — so a move is not a way to adopt the rule cheaply.
|
|
50
|
+
Split first, then place. And `explanation` is not the safe default: it bans
|
|
51
|
+
only imperative commands, so nearly any prose passes it. Declaring it is a
|
|
52
|
+
claim about the document, not somewhere to put whatever is left over. A
|
|
53
|
+
document you cannot honestly classify is better left undeclared than
|
|
54
|
+
mislabelled.
|
|
55
|
+
|
|
56
|
+
Classify before writing, not after. If a `diataxis` skill is available, use it.
|
|
57
|
+
|
|
58
|
+
## Every project has at least one `@lat:` code ref
|
|
59
|
+
|
|
60
|
+
`lat check` fails a tree that has documents and no `@lat:` ref anywhere in the
|
|
61
|
+
codebase. A graph nothing points at cannot be reached from the code, which is
|
|
62
|
+
the only reason it exists.
|
|
63
|
+
|
|
64
|
+
Start at the application entrypoint — `config/application.rb`, `src/index.ts`,
|
|
65
|
+
`main.go`, `manage.py`, whatever a new reader opens first — and point it at the
|
|
66
|
+
root index:
|
|
67
|
+
|
|
68
|
+
```ruby
|
|
69
|
+
# @lat: [[lat#Acme]]
|
|
70
|
+
module Acme
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Then one ref per section that source code actually implements, placed at that
|
|
74
|
+
code. Never in a block at the top of a file.
|
|
75
|
+
|
|
76
|
+
### An `@lat:` pointer is exempt from this project's comment conventions
|
|
77
|
+
|
|
78
|
+
A repository that minimises, budgets, or forbids comments is right about prose
|
|
79
|
+
comments and does not reach this one. An `@lat:` line is a machine directive,
|
|
80
|
+
in the same class as `# frozen_string_literal:` or `// eslint-disable`. It
|
|
81
|
+
carries no rationale, asserts nothing a reader could dispute, and cannot rot
|
|
82
|
+
quietly — `lat check` fails the moment its target moves or disappears.
|
|
83
|
+
|
|
84
|
+
Add the ref. Then, if the reasoning that would have been a comment is worth
|
|
85
|
+
keeping, put it in a `lat.md/explanation/` section and let the pointer reach it.
|
|
86
|
+
|
|
87
|
+
### The marker is a comment syntax, not a language allowlist
|
|
88
|
+
|
|
89
|
+
`//` for C-family languages; `#` for Ruby, Python, shell, Elixir, YAML, Make,
|
|
90
|
+
and everything else that comments with `#`. The scan is textual and walks every
|
|
91
|
+
non-markdown file in the project, so every language works.
|
|
92
|
+
|
|
93
|
+
Any list of example languages you find is a list of examples. Never conclude a
|
|
94
|
+
language is unsupported because it is absent from one. `lat check` prints what
|
|
95
|
+
it scanned:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
Scanned 41 .md, 622 .rb, 118 .tsx in 1.2s
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Read that line rather than guessing, and if you are still unsure, add one ref
|
|
102
|
+
and run the check. It costs one command.
|
|
103
|
+
|
|
104
|
+
(The tree-sitter grammars limit only `[[src/file.ts#symbol]]` wiki links, which
|
|
105
|
+
resolve a symbol inside source. `@lat:` refs point the other way and have no
|
|
106
|
+
such limit.)
|
|
107
|
+
|
|
108
|
+
## Test specs are wired to their tests
|
|
109
|
+
|
|
110
|
+
A document describing tests declares it in frontmatter:
|
|
111
|
+
|
|
112
|
+
```markdown
|
|
113
|
+
---
|
|
114
|
+
lat:
|
|
115
|
+
require-code-mention: true
|
|
116
|
+
---
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Every leaf section then needs exactly one `@lat:` comment at the test that
|
|
120
|
+
covers it, and every section needs at least one sentence saying what it
|
|
121
|
+
verifies and why. `lat check` reports any spec section no test claims, and any
|
|
122
|
+
ref pointing at no section.
|
|
123
|
+
|
|
124
|
+
## One specialty per document
|
|
125
|
+
|
|
126
|
+
A document is **small**, **discrete**, and does **not conflict** with any
|
|
127
|
+
other. Those are three demands on the same thing: a reader must be able to
|
|
128
|
+
find the one place a fact is written down, and trust it.
|
|
129
|
+
|
|
130
|
+
**Small — a document covers one specialty.** Not one topic area; one
|
|
131
|
+
specialty. When a document covers two, it is two documents. Past roughly forty
|
|
132
|
+
sections it has almost certainly become several, and an agent then loads all of
|
|
133
|
+
it to reach one part.
|
|
134
|
+
|
|
135
|
+
**Discrete — each document covers its own specialty.** Before writing a new
|
|
136
|
+
document, search for the specialty first:
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
lat search "the thing you are about to document"
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
An overlap has two honest repairs, and picking neither is what produces the
|
|
143
|
+
third copy. Either the two are one document and belong merged, or the part they
|
|
144
|
+
share is its own document that both link. Deciding they are "mostly different"
|
|
145
|
+
and writing anyway is how the set rots.
|
|
146
|
+
|
|
147
|
+
**Does not conflict — two documents never say different things about the same
|
|
148
|
+
specialty.** Never restate a fact another document owns. Link to it with
|
|
149
|
+
`[[section]]`. A restatement is a second copy, a second copy drifts, and drift
|
|
150
|
+
is how document B ends up contradicting document A while both look maintained.
|
|
151
|
+
|
|
152
|
+
The mode rule above is the sharpest available test of "one specialty": a
|
|
153
|
+
document that fails its mode is usually two documents. Split it. Do not soften
|
|
154
|
+
the prose until the check passes.
|
|
155
|
+
|
|
156
|
+
## Read sections, not files
|
|
157
|
+
|
|
158
|
+
`lat search` prints a section id and the exact lines that section occupies.
|
|
159
|
+
Resolve it with `lat section`, or read only that line range. Opening the whole
|
|
160
|
+
file is the reflex to break, and it is the expensive one:
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
lat search "how does backend selection work"
|
|
164
|
+
lat section "cli#CLI#search#Backend selection"
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
not a `read` of `lat.md/cli.md`. Measured on lat.md's own graph, the section
|
|
168
|
+
costs 4 KB against the file's 44 KB — eleven times the context for the same
|
|
169
|
+
answer, and the answer arrives buried in forty-one sections that were not
|
|
170
|
+
asked about.
|
|
171
|
+
|
|
172
|
+
Use `lat expand` on a prompt carrying `[[refs]]` for the same reason: it
|
|
173
|
+
resolves each ref to a location and a preview rather than to a file.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type Plugin, tool } from "@opencode-ai/plugin"
|
|
2
|
-
import { execSync } from "child_process"
|
|
2
|
+
import { execSync, execFileSync } from "child_process"
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
const LAT =
|
|
4
|
+
/** Executable and prefix arguments, injected by `lat init`. */
|
|
5
|
+
const LAT = __LAT_INVOCATION__
|
|
6
6
|
|
|
7
7
|
function run(args: string[]): string {
|
|
8
|
-
return
|
|
8
|
+
return execFileSync(LAT.command, [...LAT.args, ...args], {
|
|
9
9
|
cwd: process.cwd(),
|
|
10
10
|
encoding: "utf-8",
|
|
11
11
|
timeout: 30_000,
|
|
@@ -33,7 +33,7 @@ export const LatPlugin: Plugin = async (ctx) => {
|
|
|
33
33
|
),
|
|
34
34
|
},
|
|
35
35
|
async execute(args) {
|
|
36
|
-
const cliArgs = ["search",
|
|
36
|
+
const cliArgs = ["search", args.query]
|
|
37
37
|
if (args.limit) cliArgs.push("--limit", String(args.limit))
|
|
38
38
|
const output = tryRun(cliArgs)
|
|
39
39
|
return output || "No results found."
|
|
@@ -49,7 +49,7 @@ export const LatPlugin: Plugin = async (ctx) => {
|
|
|
49
49
|
),
|
|
50
50
|
},
|
|
51
51
|
async execute(args) {
|
|
52
|
-
const output = tryRun(["section",
|
|
52
|
+
const output = tryRun(["section", args.query])
|
|
53
53
|
return output || "Section not found."
|
|
54
54
|
},
|
|
55
55
|
}),
|
|
@@ -61,7 +61,7 @@ export const LatPlugin: Plugin = async (ctx) => {
|
|
|
61
61
|
query: tool.schema.string("Section name to locate"),
|
|
62
62
|
},
|
|
63
63
|
async execute(args) {
|
|
64
|
-
const output = tryRun(["locate",
|
|
64
|
+
const output = tryRun(["locate", args.query])
|
|
65
65
|
return output || "No sections matching query."
|
|
66
66
|
},
|
|
67
67
|
}),
|
|
@@ -87,7 +87,7 @@ export const LatPlugin: Plugin = async (ctx) => {
|
|
|
87
87
|
text: tool.schema.string("Text containing [[refs]] to expand"),
|
|
88
88
|
},
|
|
89
89
|
async execute(args) {
|
|
90
|
-
const output = tryRun(["expand",
|
|
90
|
+
const output = tryRun(["expand", args.text])
|
|
91
91
|
return output || args.text
|
|
92
92
|
},
|
|
93
93
|
}),
|
|
@@ -101,7 +101,7 @@ export const LatPlugin: Plugin = async (ctx) => {
|
|
|
101
101
|
),
|
|
102
102
|
},
|
|
103
103
|
async execute(args) {
|
|
104
|
-
const output = tryRun(["refs",
|
|
104
|
+
const output = tryRun(["refs", args.query])
|
|
105
105
|
return output || "No references found."
|
|
106
106
|
},
|
|
107
107
|
}),
|
|
@@ -30,12 +30,12 @@ function collapsibleResult(
|
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
/**
|
|
34
|
-
const LAT =
|
|
33
|
+
/** Executable and prefix arguments, injected by `lat init`. */
|
|
34
|
+
const LAT = __LAT_INVOCATION__;
|
|
35
35
|
|
|
36
36
|
function run(args: string[], cwd?: string): string {
|
|
37
|
-
const {
|
|
38
|
-
return
|
|
37
|
+
const { execFileSync } = require("child_process") as typeof import('child_process');
|
|
38
|
+
return execFileSync(LAT.command, [...LAT.args, ...args], {
|
|
39
39
|
cwd: cwd ?? process.cwd(),
|
|
40
40
|
encoding: "utf-8",
|
|
41
41
|
timeout: 30_000,
|
|
@@ -69,7 +69,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
69
69
|
),
|
|
70
70
|
}),
|
|
71
71
|
async execute(_id, params) {
|
|
72
|
-
const args = ["search",
|
|
72
|
+
const args = ["search", params.query];
|
|
73
73
|
if (params.limit) args.push("--limit", String(params.limit));
|
|
74
74
|
const output = tryRun(args);
|
|
75
75
|
return {
|
|
@@ -99,7 +99,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
99
99
|
}),
|
|
100
100
|
}),
|
|
101
101
|
async execute(_id, params) {
|
|
102
|
-
const output = tryRun(["section",
|
|
102
|
+
const output = tryRun(["section", params.query]);
|
|
103
103
|
return {
|
|
104
104
|
content: [
|
|
105
105
|
{ type: "text", text: output || "Section not found." },
|
|
@@ -126,7 +126,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
126
126
|
query: Type.String({ description: "Section name to locate" }),
|
|
127
127
|
}),
|
|
128
128
|
async execute(_id, params) {
|
|
129
|
-
const output = tryRun(["locate",
|
|
129
|
+
const output = tryRun(["locate", params.query]);
|
|
130
130
|
return {
|
|
131
131
|
content: [
|
|
132
132
|
{ type: "text", text: output || "No sections matching query." },
|
|
@@ -179,7 +179,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
179
179
|
text: Type.String({ description: "Text containing [[refs]] to expand" }),
|
|
180
180
|
}),
|
|
181
181
|
async execute(_id, params) {
|
|
182
|
-
const output = tryRun(["expand",
|
|
182
|
+
const output = tryRun(["expand", params.text]);
|
|
183
183
|
return {
|
|
184
184
|
content: [{ type: "text", text: output || params.text }],
|
|
185
185
|
};
|
|
@@ -205,7 +205,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
205
205
|
}),
|
|
206
206
|
}),
|
|
207
207
|
async execute(_id, params) {
|
|
208
|
-
const output = tryRun(["refs",
|
|
208
|
+
const output = tryRun(["refs", params.query]);
|
|
209
209
|
return {
|
|
210
210
|
content: [{ type: "text", text: output || "No references found." }],
|
|
211
211
|
};
|
|
@@ -276,7 +276,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
276
276
|
"Use `lat_section` to read the full content of relevant matches.",
|
|
277
277
|
"Do not read files, write code, or run commands until you have searched.",
|
|
278
278
|
"",
|
|
279
|
-
"Remember: `lat.md/` must stay in sync with meaningful codebase state. If you change behavior, architecture,
|
|
279
|
+
"Remember: `lat.md/` must stay in sync with meaningful codebase state. If you change implemented behavior, architecture, or tests, update the relevant current-state sections and run `lat_check` before finishing. Plans may be drafted in `lat.md/` alongside implementation, with the intent that by commit time they describe what was implemented. Otherwise, keep proposals, hypothetical designs, and future work outside `lat.md/` unless the user explicitly requests them there. Do not use `lat.md/` as a journal/changelog or add notes for insignificant details.",
|
|
280
280
|
].join("\n");
|
|
281
281
|
|
|
282
282
|
return {
|
|
@@ -307,7 +307,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
307
307
|
let needsSync = false;
|
|
308
308
|
let codeLines = 0;
|
|
309
309
|
try {
|
|
310
|
-
const { execSync } = require("child_process") as typeof import(
|
|
310
|
+
const { execSync } = require("child_process") as typeof import('child_process');
|
|
311
311
|
const numstat = execSync("git diff HEAD --numstat", {
|
|
312
312
|
encoding: "utf-8",
|
|
313
313
|
cwd: process.cwd(),
|
package/templates/skill/SKILL.md
CHANGED
|
@@ -10,11 +10,13 @@ description: >-
|
|
|
10
10
|
|
|
11
11
|
This skill covers the syntax, structure rules, and conventions for writing `lat.md/` files. Load it whenever you need to create or edit sections in the `lat.md/` directory.
|
|
12
12
|
|
|
13
|
+
Project-specific lat documentation belongs in `lat.md/`. Do not modify this generated skill or a generated `AGENTS.md` to record project guidance: both are owned by lat tooling and may be replaced by a later `lat init`.
|
|
14
|
+
|
|
13
15
|
## What belongs in lat.md
|
|
14
16
|
|
|
15
17
|
`lat.md/` files describe **what** the project does and **why** — domain concepts, key design decisions, business logic, and test specifications. They do NOT duplicate source code. Think of each section as an anchor that source code references back to.
|
|
16
18
|
|
|
17
|
-
Treat `lat.md/` as a focused snapshot of the current state
|
|
19
|
+
Treat `lat.md/` as a focused snapshot of the current implemented state. Plans may be drafted in `lat.md/` alongside implementation, with the intent that by commit time they describe what was implemented. Otherwise, keep proposals, hypothetical designs, and future work outside `lat.md/` unless the user explicitly requests them there. A planning-only task does not require a knowledge-graph update. Do not use it as a journal or changelog, and do not grow it just to record insignificant implementation details.
|
|
18
20
|
|
|
19
21
|
Good candidates for sections:
|
|
20
22
|
- Architecture decisions and their rationale
|
|
@@ -27,6 +29,7 @@ Bad candidates:
|
|
|
27
29
|
- Step-by-step code walkthroughs (the code itself is the walkthrough)
|
|
28
30
|
- Auto-generated API docs (use tools for that)
|
|
29
31
|
- Journal/changelog entries for each change
|
|
32
|
+
- Proposals, planned features, hypothetical designs, or promises of future behavior, unless explicitly requested by the user or drafted alongside implementation to describe implemented behavior by commit time
|
|
30
33
|
- Temporary notes or TODOs
|
|
31
34
|
- Insignificant implementation details that do not change the current-state model
|
|
32
35
|
|
|
@@ -67,17 +70,36 @@ Sections are addressed by file path and heading chain:
|
|
|
67
70
|
|
|
68
71
|
Examples: `lat.md/tests/search#RAG Replay Tests`, `cli#init`, `parser#Wiki Links`.
|
|
69
72
|
|
|
73
|
+
Configured external sources use `[[handle:path/to/file.md#Heading]]` for
|
|
74
|
+
Markdown headings and `[[handle:path/to/file.ts#symbol]]` for supported code
|
|
75
|
+
symbols. Run `lat external show <handle>` before cloning an external source;
|
|
76
|
+
its output includes the pinned commit and safe checkout suggestions.
|
|
77
|
+
|
|
70
78
|
## Wiki links
|
|
71
79
|
|
|
72
80
|
Cross-reference other sections or source code with `[[target]]` or `[[target|alias]]`.
|
|
73
81
|
|
|
74
82
|
### Section links
|
|
75
83
|
|
|
84
|
+
Section links connect related concepts while keeping their stable graph identities explicit.
|
|
85
|
+
|
|
76
86
|
```markdown
|
|
77
87
|
See [[cli#init]] for setup details.
|
|
78
88
|
The parser validates [[parser#Wiki Links|wiki link syntax]].
|
|
79
89
|
```
|
|
80
90
|
|
|
91
|
+
### Repository path links
|
|
92
|
+
|
|
93
|
+
Reference any existing file or directory beneath the project root without a fragment:
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
[[schema.sql]]
|
|
97
|
+
[[CHANGELOG]]
|
|
98
|
+
[[src/components]]
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Unsupported formats validate as references but cannot be opened by Lat. A `#fragment` requires a `lat.md/` section or a supported source file.
|
|
102
|
+
|
|
81
103
|
### Source code links
|
|
82
104
|
|
|
83
105
|
Reference functions, classes, constants, and methods in source files:
|
|
@@ -91,6 +113,8 @@ Reference functions, classes, constants, and methods in source files:
|
|
|
91
113
|
[[src/app.h#Greeter]] — C struct
|
|
92
114
|
```
|
|
93
115
|
|
|
116
|
+
When prose names an implementation symbol or a behavior governed by one, link the symbol instead of using a bare code span or copying its literal value. Prefer `[[src/config.ts#DEFAULT_TIMEOUT]]` (or `[[src/config.ts#DEFAULT_TIMEOUT|the default timeout]]`) over a bare identifier or copied value. Keep the behavioral explanation in prose; the link makes its implementation binding navigable and validated.
|
|
117
|
+
|
|
94
118
|
`lat check` validates that all targets exist.
|
|
95
119
|
|
|
96
120
|
## Code refs
|
|
@@ -108,7 +132,7 @@ def init():
|
|
|
108
132
|
...
|
|
109
133
|
```
|
|
110
134
|
|
|
111
|
-
Supported comment styles: `//` (JS/TS/Rust/Go/C) and `#` (Python).
|
|
135
|
+
Supported comment styles: `//` (JS/TS/Rust/Go/C/PHP) and `#` (Python/PHP).
|
|
112
136
|
|
|
113
137
|
Place one `@lat:` comment per section, at the relevant code — not at the top of the file.
|
|
114
138
|
|
|
@@ -162,25 +186,12 @@ lat:
|
|
|
162
186
|
---
|
|
163
187
|
```
|
|
164
188
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
## Diátaxis modes
|
|
168
|
-
|
|
169
|
-
Documents in `tutorials/`, `how-to/`, `reference/`, or `explanation/` under `lat.md/` are checked against their Diátaxis mode. Declare it with nested frontmatter:
|
|
170
|
-
|
|
171
|
-
```yaml
|
|
172
|
-
---
|
|
173
|
-
lat:
|
|
174
|
-
mode: reference
|
|
175
|
-
---
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
If the document is in one of the four mode directories, the declared mode must match that directory. Each mode enforces one shape rule: tutorials need an ordered list of steps and a stated outcome; how-to guides need an ordered list of steps; reference docs must not contain narrative prose (no second paragraph under a heading); explanations must not give imperative commands. `lat check mode` validates this.
|
|
189
|
+
Currently the only supported field is `require-code-mention` for test spec enforcement.
|
|
179
190
|
|
|
180
191
|
## Validation
|
|
181
192
|
|
|
182
193
|
Always run `lat check` after editing `lat.md/` files. It validates:
|
|
183
|
-
- All wiki links point to existing sections or source code symbols
|
|
194
|
+
- All wiki links point to existing sections, repository paths, or source code symbols
|
|
184
195
|
- All relative markdown links point to existing files
|
|
185
196
|
- Full and collapsed reference-style links have definitions
|
|
186
197
|
- All `@lat:` code refs point to existing sections
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { CheckError } from './check.js';
|
|
2
|
-
/**
|
|
3
|
-
* Report frontmatter that parses to nothing useful, or that puts a lat field
|
|
4
|
-
* somewhere the parser will not look.
|
|
5
|
-
*
|
|
6
|
-
* Both failures are quiet by nature, and both fail OPEN. A misplaced or
|
|
7
|
-
* unparseable `require-code-mention` turns a validation off, and `lat check`
|
|
8
|
-
* then reports success on a file whose leaf sections are no longer required to
|
|
9
|
-
* carry `@lat:` coverage. Nothing else in the output says the rule stopped
|
|
10
|
-
* applying, which is precisely why it has to be said here.
|
|
11
|
-
*/
|
|
12
|
-
export declare function checkFrontmatter(latticeDir: string, projectRoot?: string): Promise<CheckError[]>;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { readFile } from 'node:fs/promises';
|
|
2
|
-
import { dirname, relative } from 'node:path';
|
|
3
|
-
import { listLatticeFiles, parseFrontmatter } from '../lattice.js';
|
|
4
|
-
import { toPosix } from '../walk.js';
|
|
5
|
-
/**
|
|
6
|
-
* Report frontmatter that parses to nothing useful, or that puts a lat field
|
|
7
|
-
* somewhere the parser will not look.
|
|
8
|
-
*
|
|
9
|
-
* Both failures are quiet by nature, and both fail OPEN. A misplaced or
|
|
10
|
-
* unparseable `require-code-mention` turns a validation off, and `lat check`
|
|
11
|
-
* then reports success on a file whose leaf sections are no longer required to
|
|
12
|
-
* carry `@lat:` coverage. Nothing else in the output says the rule stopped
|
|
13
|
-
* applying, which is precisely why it has to be said here.
|
|
14
|
-
*/
|
|
15
|
-
export async function checkFrontmatter(latticeDir, projectRoot = dirname(latticeDir)) {
|
|
16
|
-
const files = await listLatticeFiles(latticeDir);
|
|
17
|
-
const errors = [];
|
|
18
|
-
for (const file of files) {
|
|
19
|
-
const content = await readFile(file, 'utf-8');
|
|
20
|
-
const problems = parseFrontmatter(content).problems;
|
|
21
|
-
if (!problems)
|
|
22
|
-
continue;
|
|
23
|
-
const relPath = relative(process.cwd(), file);
|
|
24
|
-
const target = toPosix(relative(projectRoot, file)).replace(/\.md$/, '');
|
|
25
|
-
for (const problem of problems) {
|
|
26
|
-
if (problem.kind === 'root-level-field') {
|
|
27
|
-
errors.push({
|
|
28
|
-
file: relPath,
|
|
29
|
-
line: 1,
|
|
30
|
-
target,
|
|
31
|
-
message: `frontmatter sets "${problem.field}" at the document root, where it is ignored — nest it under "lat:" instead:\n ---\n lat:\n ${problem.field}: ...\n ---`,
|
|
32
|
-
});
|
|
33
|
-
continue;
|
|
34
|
-
}
|
|
35
|
-
errors.push({
|
|
36
|
-
file: relPath,
|
|
37
|
-
line: 1,
|
|
38
|
-
target,
|
|
39
|
-
message: `frontmatter is not valid YAML (${problem.message}) — every lat field in this document is being ignored, including any that turn a check on`,
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return errors;
|
|
44
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { CheckError } from './check.js';
|
|
2
|
-
export declare const DIATAXIS_MODES: readonly ["tutorial", "how-to", "reference", "explanation"];
|
|
3
|
-
export type DiataxisMode = (typeof DIATAXIS_MODES)[number];
|
|
4
|
-
/** Directory below lat.md/ that holds each mode. */
|
|
5
|
-
export declare const MODE_DIRS: Record<DiataxisMode, string>;
|
|
6
|
-
export declare function checkMode(latticeDir: string, projectRoot?: string): Promise<CheckError[]>;
|