lanternspec 0.2.2__tar.gz → 0.2.3__tar.gz

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.
Files changed (201) hide show
  1. {lanternspec-0.2.2/src/lanternspec.egg-info → lanternspec-0.2.3}/PKG-INFO +4 -3
  2. {lanternspec-0.2.2 → lanternspec-0.2.3}/README.md +3 -2
  3. {lanternspec-0.2.2 → lanternspec-0.2.3}/pyproject.toml +1 -1
  4. lanternspec-0.2.3/src/lanternspec/check/budget.py +161 -0
  5. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/check/doctor.py +62 -0
  6. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/cli/core.py +33 -0
  7. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/core/principles.py +104 -5
  8. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/core/profile.py +39 -3
  9. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-init/SKILL.md +4 -0
  10. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-init/SKILL.md +4 -0
  11. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/messages.yaml +24 -0
  12. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/principles.yaml +6 -0
  13. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/tools/agent_hooks.py +105 -7
  14. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/tools/antigravity.py +8 -5
  15. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/tools/base.py +15 -1
  16. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/tools/claude.py +6 -19
  17. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/tools/codex.py +12 -5
  18. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/tools/install.py +41 -1
  19. lanternspec-0.2.3/src/lanternspec/tools/parts.py +209 -0
  20. lanternspec-0.2.3/src/lanternspec/tools/rules.py +228 -0
  21. {lanternspec-0.2.2 → lanternspec-0.2.3/src/lanternspec.egg-info}/PKG-INFO +4 -3
  22. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec.egg-info/SOURCES.txt +5 -0
  23. lanternspec-0.2.3/tests/test_budget.py +54 -0
  24. {lanternspec-0.2.2 → lanternspec-0.2.3}/tests/test_later_features.py +4 -3
  25. lanternspec-0.2.3/tests/test_part_delivery.py +97 -0
  26. lanternspec-0.2.3/tests/test_parts.py +110 -0
  27. lanternspec-0.2.2/src/lanternspec/tools/rules.py +0 -113
  28. {lanternspec-0.2.2 → lanternspec-0.2.3}/LICENSE +0 -0
  29. {lanternspec-0.2.2 → lanternspec-0.2.3}/setup.cfg +0 -0
  30. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/__init__.py +0 -0
  31. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/__main__.py +0 -0
  32. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/check/__init__.py +0 -0
  33. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/check/check_docs.py +0 -0
  34. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/check/githooks.py +0 -0
  35. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/check/layout.py +0 -0
  36. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/check/legacy.py +0 -0
  37. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/check/templates.py +0 -0
  38. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/cli/__init__.py +0 -0
  39. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/cli/check.py +0 -0
  40. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/cli/common.py +0 -0
  41. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/cli/learn.py +0 -0
  42. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/cli/report.py +0 -0
  43. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/cli/tools.py +0 -0
  44. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/cli/work.py +0 -0
  45. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/core/__init__.py +0 -0
  46. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/core/enums.py +0 -0
  47. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/core/frontmatter.py +0 -0
  48. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/core/links.py +0 -0
  49. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/core/messages.py +0 -0
  50. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/core/meta.py +0 -0
  51. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/core/names.py +0 -0
  52. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/core/new_id.py +0 -0
  53. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/core/project.py +0 -0
  54. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/core/sections.py +0 -0
  55. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/core/state.py +0 -0
  56. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/core/taskfile.py +0 -0
  57. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/core/templating.py +0 -0
  58. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/learn/__init__.py +0 -0
  59. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/learn/debt.py +0 -0
  60. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/learn/knowledge/__init__.py +0 -0
  61. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/learn/knowledge/drafts.py +0 -0
  62. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/learn/knowledge/mcp_server.py +0 -0
  63. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/learn/knowledge/notion.py +0 -0
  64. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/learn/knowledge/obsidian.py +0 -0
  65. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/report/__init__.py +0 -0
  66. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/report/doc_map.py +0 -0
  67. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/report/evaluate.py +0 -0
  68. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/report/harness.py +0 -0
  69. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/report/obsidian.py +0 -0
  70. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/report/principles_doc.py +0 -0
  71. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/report/resume.py +0 -0
  72. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/report/scan.py +0 -0
  73. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/report/sections_doc.py +0 -0
  74. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/report/status.py +0 -0
  75. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/report/views.py +0 -0
  76. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/__init__.py +0 -0
  77. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/conventions/go.yaml +0 -0
  78. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/conventions/python.yaml +0 -0
  79. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/conventions/rust.yaml +0 -0
  80. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/conventions/swift.yaml +0 -0
  81. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/conventions/typescript.yaml +0 -0
  82. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/agents/AGENTS.md +0 -0
  83. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-adr/SKILL.md +0 -0
  84. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-build/SKILL.md +0 -0
  85. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-check/SKILL.md +0 -0
  86. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-design/SKILL.md +0 -0
  87. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-idea/SKILL.md +0 -0
  88. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-learn/SKILL.md +0 -0
  89. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-map/SKILL.md +0 -0
  90. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-plan/SKILL.md +0 -0
  91. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-report/SKILL.md +0 -0
  92. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-resume/SKILL.md +0 -0
  93. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-sync/SKILL.md +0 -0
  94. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-task/SKILL.md +0 -0
  95. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-template/SKILL.md +0 -0
  96. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/ADR.md +0 -0
  97. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/API.md +0 -0
  98. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Architecture.md +0 -0
  99. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Collaboration Rules.md +0 -0
  100. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Competency Card.md +0 -0
  101. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Data.md +0 -0
  102. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Debt Card.md +0 -0
  103. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Deployment.md +0 -0
  104. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Design.md +0 -0
  105. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Docs MOC.md +0 -0
  106. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Feature List.md +0 -0
  107. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Idea.md +0 -0
  108. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Known Tech.md +0 -0
  109. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Legacy Map.md +0 -0
  110. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Log.md +0 -0
  111. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Meeting Notes.md +0 -0
  112. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Plan.md +0 -0
  113. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Platform Integration.md +0 -0
  114. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Project Definition.md +0 -0
  115. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Screens.md +0 -0
  116. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Server Operations.md +0 -0
  117. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Session Log.md +0 -0
  118. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Tasks.md +0 -0
  119. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Work Division Rules.md +0 -0
  120. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/_meta/enums.yaml +0 -0
  121. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/agents/AGENTS.md +0 -0
  122. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-adr/SKILL.md +0 -0
  123. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-build/SKILL.md +0 -0
  124. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-check/SKILL.md +0 -0
  125. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-design/SKILL.md +0 -0
  126. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-idea/SKILL.md +0 -0
  127. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-learn/SKILL.md +0 -0
  128. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-map/SKILL.md +0 -0
  129. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-plan/SKILL.md +0 -0
  130. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-report/SKILL.md +0 -0
  131. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-resume/SKILL.md +0 -0
  132. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-sync/SKILL.md +0 -0
  133. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-task/SKILL.md +0 -0
  134. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-template/SKILL.md +0 -0
  135. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates/ADR.md +0 -0
  136. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates/API.md +0 -0
  137. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates/_meta/enums.yaml +0 -0
  138. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//352/260/234/353/260/234/353/254/270/354/204/234 MOC.md" +0 -0
  139. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//352/270/260/353/212/245 /353/252/251/353/241/235.md" +0 -0
  140. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//352/270/260/353/241/235.md" +0 -0
  141. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//352/270/260/354/241/264 /353/254/270/354/204/234 /354/247/200/353/217/204.md" +0 -0
  142. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//352/270/260/355/232/215.md" +0 -0
  143. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//353/215/260/354/235/264/355/204/260.md" +0 -0
  144. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//353/260/260/355/217/254.md" +0 -0
  145. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//353/266/200/354/261/204 /354/271/264/353/223/234.md" +0 -0
  146. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//354/204/234/353/262/204 /353/260/260/355/217/254 /302/267 /354/232/264/354/230/201.md" +0 -0
  147. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//354/204/244/352/263/204.md" +0 -0
  148. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//354/204/270/354/205/230 /352/270/260/353/241/235.md" +0 -0
  149. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//354/213/234/354/212/244/355/205/234 /352/265/254/354/241/260.md" +0 -0
  150. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//354/225/204/353/212/224 /352/270/260/354/210/240.md" +0 -0
  151. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//354/225/204/354/235/264/353/224/224/354/226/264.md" +0 -0
  152. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//354/227/255/353/237/211 /354/271/264/353/223/234.md" +0 -0
  153. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//354/236/221/354/227/205 /353/202/230/353/210/204/352/270/260 /352/270/260/354/244/200.md" +0 -0
  154. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//355/224/204/353/241/234/354/240/235/355/212/270 /354/240/225/354/235/230/354/204/234.md" +0 -0
  155. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//355/224/214/353/236/253/355/217/274 /354/227/260/353/217/231.md" +0 -0
  156. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//355/225/240 /354/235/274.md" +0 -0
  157. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//355/230/221/354/227/205 /352/267/234/354/271/231.md" +0 -0
  158. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//355/231/224/353/251/264.md" +0 -0
  159. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//355/232/214/354/235/230/353/241/235.md" +0 -0
  160. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/resources/names.yaml +0 -0
  161. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/tools/__init__.py +0 -0
  162. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/tools/close.py +0 -0
  163. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/tools/docs_mode.py +0 -0
  164. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/tools/health.py +0 -0
  165. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/tools/runlog.py +0 -0
  166. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/tools/sessions.py +0 -0
  167. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/tools/skills.py +0 -0
  168. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/work/__init__.py +0 -0
  169. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/work/branches.py +0 -0
  170. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/work/dbml.py +0 -0
  171. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/work/epic_rules.py +0 -0
  172. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/work/ideas.py +0 -0
  173. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/work/pack.py +0 -0
  174. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/work/progress.py +0 -0
  175. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/work/scaffold.py +0 -0
  176. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/work/screen.py +0 -0
  177. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/work/stages.py +0 -0
  178. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec/work/tasks.py +0 -0
  179. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec.egg-info/dependency_links.txt +0 -0
  180. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec.egg-info/entry_points.txt +0 -0
  181. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec.egg-info/requires.txt +0 -0
  182. {lanternspec-0.2.2 → lanternspec-0.2.3}/src/lanternspec.egg-info/top_level.txt +0 -0
  183. {lanternspec-0.2.2 → lanternspec-0.2.3}/tests/test_checks.py +0 -0
  184. {lanternspec-0.2.2 → lanternspec-0.2.3}/tests/test_core.py +0 -0
  185. {lanternspec-0.2.2 → lanternspec-0.2.3}/tests/test_english.py +0 -0
  186. {lanternspec-0.2.2 → lanternspec-0.2.3}/tests/test_enums_single_source.py +0 -0
  187. {lanternspec-0.2.2 → lanternspec-0.2.3}/tests/test_git.py +0 -0
  188. {lanternspec-0.2.2 → lanternspec-0.2.3}/tests/test_install_and_aux.py +0 -0
  189. {lanternspec-0.2.2 → lanternspec-0.2.3}/tests/test_layout.py +0 -0
  190. {lanternspec-0.2.2 → lanternspec-0.2.3}/tests/test_learning_line.py +0 -0
  191. {lanternspec-0.2.2 → lanternspec-0.2.3}/tests/test_messages.py +0 -0
  192. {lanternspec-0.2.2 → lanternspec-0.2.3}/tests/test_name_overlap.py +0 -0
  193. {lanternspec-0.2.2 → lanternspec-0.2.3}/tests/test_names.py +0 -0
  194. {lanternspec-0.2.2 → lanternspec-0.2.3}/tests/test_obsidian.py +0 -0
  195. {lanternspec-0.2.2 → lanternspec-0.2.3}/tests/test_principles.py +0 -0
  196. {lanternspec-0.2.2 → lanternspec-0.2.3}/tests/test_principles_data.py +0 -0
  197. {lanternspec-0.2.2 → lanternspec-0.2.3}/tests/test_release_script.py +0 -0
  198. {lanternspec-0.2.2 → lanternspec-0.2.3}/tests/test_resume.py +0 -0
  199. {lanternspec-0.2.2 → lanternspec-0.2.3}/tests/test_skill_commands.py +0 -0
  200. {lanternspec-0.2.2 → lanternspec-0.2.3}/tests/test_tool_health.py +0 -0
  201. {lanternspec-0.2.2 → lanternspec-0.2.3}/tests/test_work_line.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lanternspec
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Spec-driven development for agentic software engineering
5
5
  Author: Jihyeok Jeong
6
6
  License-Expression: MIT
@@ -181,7 +181,7 @@ When Obsidian first asks whether to turn on community plugins, turn them on (lea
181
181
  | Codex | `.agents/skills` (`$l-…`) | `AGENTS.md` | `.codex/hooks.json` | `.codex/config.toml` |
182
182
  | Antigravity CLI (`agy`) | `.agents/skills` | `AGENTS.md` | `.agents/hooks.json` (no save-before-compaction — there is no compaction hook) | `.agents/plugins/lanternspec/` |
183
183
 
184
- - **Rules live in `AGENTS.md`.** LanternSpec manages only the `<!-- lanternspec:start -->` block inside it and leaves everything outside the block alone.
184
+ - **Rules live in `AGENTS.md`.** LanternSpec manages only the `<!-- lanternspec:start -->` block inside it and leaves everything outside the block alone. When a file goes past what the installed tools read in full, `lantern doctor` tells you.
185
185
  - **Codex and Antigravity share the skills folder.** When you use both, skill bodies say `/l-build`, and `AGENTS.md` tells Codex to use `$` instead.
186
186
 
187
187
  ## Keeping documents and code in line
@@ -239,6 +239,7 @@ Picks design principles and code conventions from a table, based on the project
239
239
 
240
240
  - Languages: Python · TypeScript · Swift · Rust · Go
241
241
  - The essentials go into `AGENTS.md`; the full explanation goes into `Development Principles.md`.
242
+ - When two or more folders have their own manifest (such as `backend` and `web`, `lantern parts`), each part gets its own `AGENTS.md` with its language conventions and check commands, and hooks hand it to tools that don't read folder `AGENTS.md` files themselves (Codex · Antigravity).
242
243
  - In existing projects, lint and format settings already in use are recorded, never changed.
243
244
  - When the code grows past a size boundary, `lantern doctor` asks whether to raise the principles one level.
244
245
  - The language of code comments can be set apart from the documents with `project.comment_language`.
@@ -262,7 +263,7 @@ Import mockups with `lantern screen import`; `lantern screen compare` finds wher
262
263
 
263
264
  ```text
264
265
  setup install [--language] [--tools] [--mcp] [--ci|--no-ci] · upgrade [--apply] · doctor · harness suggest
265
- profile profile show|docs|write|set · principles show|detect · enums list|rename · sections list|rename|off|on
266
+ profile profile show|docs|write|set · principles show|detect · parts [add|ignore] · enums list|rename · sections list|rename|off|on
266
267
  documents scaffold init [--plan] | work | doc | idea | adr | meeting | custom · new-id · map · meta get|set
267
268
  checks check [--changed] [--epic W-012] · lint · check-dbml · dbml render|from-sql|diff
268
269
  work task next [--all]|start|done|ac|list|estimate · task add [--parallel] · pack · screen import|compare
@@ -166,7 +166,7 @@ When Obsidian first asks whether to turn on community plugins, turn them on (lea
166
166
  | Codex | `.agents/skills` (`$l-…`) | `AGENTS.md` | `.codex/hooks.json` | `.codex/config.toml` |
167
167
  | Antigravity CLI (`agy`) | `.agents/skills` | `AGENTS.md` | `.agents/hooks.json` (no save-before-compaction — there is no compaction hook) | `.agents/plugins/lanternspec/` |
168
168
 
169
- - **Rules live in `AGENTS.md`.** LanternSpec manages only the `<!-- lanternspec:start -->` block inside it and leaves everything outside the block alone.
169
+ - **Rules live in `AGENTS.md`.** LanternSpec manages only the `<!-- lanternspec:start -->` block inside it and leaves everything outside the block alone. When a file goes past what the installed tools read in full, `lantern doctor` tells you.
170
170
  - **Codex and Antigravity share the skills folder.** When you use both, skill bodies say `/l-build`, and `AGENTS.md` tells Codex to use `$` instead.
171
171
 
172
172
  ## Keeping documents and code in line
@@ -224,6 +224,7 @@ Picks design principles and code conventions from a table, based on the project
224
224
 
225
225
  - Languages: Python · TypeScript · Swift · Rust · Go
226
226
  - The essentials go into `AGENTS.md`; the full explanation goes into `Development Principles.md`.
227
+ - When two or more folders have their own manifest (such as `backend` and `web`, `lantern parts`), each part gets its own `AGENTS.md` with its language conventions and check commands, and hooks hand it to tools that don't read folder `AGENTS.md` files themselves (Codex · Antigravity).
227
228
  - In existing projects, lint and format settings already in use are recorded, never changed.
228
229
  - When the code grows past a size boundary, `lantern doctor` asks whether to raise the principles one level.
229
230
  - The language of code comments can be set apart from the documents with `project.comment_language`.
@@ -247,7 +248,7 @@ Import mockups with `lantern screen import`; `lantern screen compare` finds wher
247
248
 
248
249
  ```text
249
250
  setup install [--language] [--tools] [--mcp] [--ci|--no-ci] · upgrade [--apply] · doctor · harness suggest
250
- profile profile show|docs|write|set · principles show|detect · enums list|rename · sections list|rename|off|on
251
+ profile profile show|docs|write|set · principles show|detect · parts [add|ignore] · enums list|rename · sections list|rename|off|on
251
252
  documents scaffold init [--plan] | work | doc | idea | adr | meeting | custom · new-id · map · meta get|set
252
253
  checks check [--changed] [--epic W-012] · lint · check-dbml · dbml render|from-sql|diff
253
254
  work task next [--all]|start|done|ac|list|estimate · task add [--parallel] · pack · screen import|compare
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "lanternspec"
7
- version = "0.2.2"
7
+ version = "0.2.3"
8
8
  description = "Spec-driven development for agentic software engineering"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -0,0 +1,161 @@
1
+ """How big a rules file may be, from the limits of the installed AI tools — measured in bytes and lines, never tokens.
2
+
3
+ Every tokenizer spends at least one byte per token, so a text of N bytes is at most N tokens for any
4
+ model. Comparing bytes with a token limit is therefore safe whatever the model, needs no tokenizer
5
+ or API, and always gives the same answer for the same file. Korean (3 bytes a letter) and English
6
+ (1 byte) weigh differently on their own.
7
+
8
+ Responsibilities:
9
+ - the budget of the root AGENTS.md and of a folder's AGENTS.md, from the installed tools' limits
10
+ - measure a rules file and say which part (LanternSpec's block or the person's text) is large
11
+
12
+ Not here:
13
+ - each tool's limits → the tool files (Tool.rules_max_lines · rules_max_bytes · rules_chain_max_bytes · hook_context_max_tokens)
14
+ - showing the result → check/doctor.py · tools/install.py
15
+ """
16
+
17
+ from __future__ import annotations
18
+
19
+ from collections.abc import Iterable
20
+ from dataclasses import dataclass
21
+
22
+ from ..core.messages import msg
23
+
24
+ MARGIN = 0.9 # stay this far inside the tightest limit
25
+
26
+
27
+ @dataclass
28
+ class Budget:
29
+ """How big one rules file may be; None where no installed tool sets a limit.
30
+
31
+ Attributes:
32
+ max_lines: Lines.
33
+ max_bytes: Bytes (UTF-8).
34
+
35
+ Example:
36
+ >>> Budget(200, None).max_lines
37
+ 200
38
+ """
39
+
40
+ max_lines: int | None
41
+ max_bytes: int | None
42
+
43
+
44
+ def _tightest(values: Iterable[int]) -> int | None:
45
+ found = [v for v in values if v > 0]
46
+ return min(found) if found else None
47
+
48
+
49
+ def root_budget(tools: Iterable[object]) -> Budget:
50
+ """The budget of the root AGENTS.md, which every tool reads at the start of a session.
51
+
52
+ Args:
53
+ tools: The installed tool adapters.
54
+
55
+ Returns:
56
+ The tightest line limit as is (a guideline), and the tightest byte limit with a margin.
57
+
58
+ Example:
59
+ >>> from lanternspec.tools import resolve
60
+ >>> root_budget(resolve(["claude", "antigravity"]))
61
+ Budget(max_lines=200, max_bytes=21600)
62
+ """
63
+ tools = list(tools)
64
+ lines = _tightest(getattr(t, "rules_max_lines", 0) for t in tools)
65
+ raw = _tightest([*(getattr(t, "rules_max_bytes", 0) for t in tools), *(getattr(t, "rules_chain_max_bytes", 0) for t in tools)])
66
+ return Budget(lines, int(raw * MARGIN) if raw else None)
67
+
68
+
69
+ def folder_budget(tools: Iterable[object]) -> Budget:
70
+ """The budget of a folder's AGENTS.md, which a hook may have to hand to the AI in one go.
71
+
72
+ A hook's token limit counts as that many bytes (one token is at least one byte).
73
+
74
+ Args:
75
+ tools: The installed tool adapters.
76
+
77
+ Returns:
78
+ The budget, with a margin on bytes.
79
+
80
+ Example:
81
+ >>> from lanternspec.tools import resolve
82
+ >>> folder_budget(resolve(["claude", "codex"]))
83
+ Budget(max_lines=200, max_bytes=7200)
84
+ """
85
+ tools = list(tools)
86
+ lines = _tightest(getattr(t, "rules_max_lines", 0) for t in tools)
87
+ raw = _tightest([*(getattr(t, "rules_max_bytes", 0) for t in tools), *(getattr(t, "hook_context_max_tokens", 0) for t in tools)])
88
+ return Budget(lines, int(raw * MARGIN) if raw else None)
89
+
90
+
91
+ def size(text: str) -> tuple[int, int]:
92
+ r"""Measure a text.
93
+
94
+ Args:
95
+ text: The text.
96
+
97
+ Returns:
98
+ (UTF-8 bytes, lines).
99
+
100
+ Example:
101
+ >>> size("가나\nab\n")
102
+ (10, 2)
103
+ """
104
+ return len(text.encode("utf-8")), len(text.splitlines())
105
+
106
+
107
+ def parts(text: str, start: str, end: str) -> tuple[int, int]:
108
+ r"""Split a rules file's bytes into LanternSpec's block and the person's own text.
109
+
110
+ Args:
111
+ text: The rules file.
112
+ start: The mark opening LanternSpec's block.
113
+ end: The mark closing it.
114
+
115
+ Returns:
116
+ (bytes of the block, bytes of everything else).
117
+
118
+ Example:
119
+ >>> parts("# 우리\n<!-- s -->\nab\n<!-- e -->\n", "<!-- s -->", "<!-- e -->")
120
+ (24, 10)
121
+ """
122
+ s, e = text.find(start), text.find(end)
123
+ if s == -1 or e < s:
124
+ return 0, size(text)[0]
125
+ block = text[s : e + len(end)]
126
+ return size(block)[0], size(text)[0] - size(block)[0]
127
+
128
+
129
+ def check(name: str, text: str, budget: Budget, start: str, end: str) -> tuple[str, str]:
130
+ r"""Compare a rules file with its budget.
131
+
132
+ Args:
133
+ name: How to call the file, e.g. "AGENTS.md".
134
+ text: Its text.
135
+ budget: Its budget.
136
+ start: The mark opening LanternSpec's block.
137
+ end: The mark closing it.
138
+
139
+ Returns:
140
+ ("ok" | "warn", message); over budget says which part is large.
141
+
142
+ Example:
143
+ >>> check("AGENTS.md", "a\n" * 300, Budget(200, None), "<s>", "<e>")[0]
144
+ 'warn'
145
+ """
146
+ n_bytes, n_lines = size(text)
147
+ over_lines = budget.max_lines is not None and n_lines > budget.max_lines
148
+ over_bytes = budget.max_bytes is not None and n_bytes > budget.max_bytes
149
+ limits = [f"{budget.max_bytes / 1024:.1f}KB"] if budget.max_bytes else []
150
+ limits += [msg("{count} lines", count=budget.max_lines)] if budget.max_lines else []
151
+ now = msg(
152
+ "{name} {kb:.1f}KB · {lines} lines (budget {budget})", name=name, kb=n_bytes / 1024, lines=n_lines, budget=" · ".join(limits) or "-"
153
+ )
154
+ if not (over_lines or over_bytes):
155
+ return "ok", now
156
+ block, own = parts(text, start, end)
157
+ return "warn", now + msg(
158
+ " — over budget: LanternSpec's block {block:.1f}KB · your own text {own:.1f}KB; move details into documents and link them",
159
+ block=block / 1024,
160
+ own=own / 1024,
161
+ )
@@ -123,10 +123,72 @@ def run(project: Project) -> list[tuple[str, str]]:
123
123
  agents = project.root / "AGENTS.md"
124
124
  if not agents.exists() or AGENTS_START not in read(agents):
125
125
  out.append((WARN, msg("AGENTS.md has no LanternSpec rules — lantern upgrade")))
126
+ out += _part_rows(project)
127
+ out += _budget_rows(project, list(st.get("tools") or []))
126
128
  out += _tool_rows(project, list(st.get("tools") or []))
127
129
  return out
128
130
 
129
131
 
132
+ def _part_rows(project: Project) -> list[tuple[str, str]]:
133
+ """Ask about undecided part candidates, and point out folder AGENTS.md files some tools never get."""
134
+ from ..tools import REGISTRY
135
+ from ..tools.parts import statuses, unseen_rules
136
+
137
+ out = []
138
+ found = statuses(project)
139
+ open_ = [s.path for s in found if s.state == "new"]
140
+ if open_ and sum(1 for s in found if s.state != "ignored") >= 2:
141
+ out.append(
142
+ (
143
+ WARN,
144
+ msg("Folders that could be parts with their own rules, not decided yet: {items} — lantern parts", items=", ".join(open_)),
145
+ )
146
+ )
147
+ tools = [REGISTRY[n] for n in state.load(project).get("tools") or [] if n in REGISTRY]
148
+ unseen, blind = unseen_rules(project, tools)
149
+ if unseen:
150
+ out.append((WARN, unseen_note(unseen, blind)))
151
+ return out
152
+
153
+
154
+ def unseen_note(files: list[str], tools: list[str]) -> str:
155
+ """Say which folder AGENTS.md files some tools never get, and where to put what matters.
156
+
157
+ Args:
158
+ files: The AGENTS.md files.
159
+ tools: The tools that won't get them.
160
+
161
+ Returns:
162
+ One line.
163
+
164
+ Example:
165
+ >>> unseen_note(["backend/app/AGENTS.md"], ["Codex"]).split(":")[0]
166
+ 'backend/app/AGENTS.md'
167
+ """
168
+ return msg(
169
+ "{items}: not handed to {tools} — only the AGENTS.md right in a part's folder is; move what matters there (lantern parts)",
170
+ items=", ".join(files),
171
+ tools=" · ".join(tools),
172
+ )
173
+
174
+
175
+ def _budget_rows(project: Project, names: list[str]) -> list[tuple[str, str]]:
176
+ """Check the root and every folder's AGENTS.md against the budget the installed AI tools allow."""
177
+ from ..tools import REGISTRY
178
+ from ..tools.rules import AGENTS_END, nested_agents
179
+ from .budget import check, folder_budget, root_budget
180
+
181
+ tools = [REGISTRY[n] for n in names if n in REGISTRY]
182
+ files = [("AGENTS.md", root_budget(tools))] + [(rel, folder_budget(tools)) for rel in nested_agents(project)]
183
+ out = []
184
+ for rel, budget in files:
185
+ path = project.root / rel
186
+ if path.exists():
187
+ level, text = check(rel, read(path), budget, AGENTS_START, AGENTS_END)
188
+ out.append((LEVELS[level], text))
189
+ return out
190
+
191
+
130
192
  def _tool_rows(project: Project, names: list[str]) -> list[tuple[str, str]]:
131
193
  """Check each installed AI tool: it reads our rules, its version against the checked ones, its hooks still running, odd payloads."""
132
194
  from ..tools import REGISTRY, health
@@ -102,6 +102,36 @@ def cmd_profile(a: argparse.Namespace) -> int:
102
102
  return 1
103
103
 
104
104
 
105
+ def cmd_parts(a: argparse.Namespace) -> int:
106
+ """`lantern parts [add|ignore <folder>]` — folders that get their own rules: candidates and decisions."""
107
+ from ..tools import parts
108
+
109
+ project = _p()
110
+ try:
111
+ if a.action == "add":
112
+ part = parts.add(project, a.path)
113
+ print(
114
+ msg("✔ Part {path} ({items}) — lantern upgrade writes its AGENTS.md", path=part["path"], items=", ".join(part["languages"]))
115
+ )
116
+ elif a.action == "ignore":
117
+ parts.ignore(project, a.path)
118
+ print(msg("✔ {path} is not a part — not asked again", path=a.path))
119
+ except ValueError as e:
120
+ raise CliError(str(e)) from e
121
+ if a.action:
122
+ return 0
123
+ found = parts.statuses(project)
124
+ if not found:
125
+ print(msg("No folder with its own toolchain below the root — the project is one part"))
126
+ label = {"added": msg("part"), "ignored": msg("ignored"), "new": msg("not decided")}
127
+ for s in found:
128
+ why = ", ".join(s.evidence) or msg("no manifest found any more")
129
+ print(f" {s.path} ({', '.join(s.languages) or '-'}) · {label[s.state]} · {why}")
130
+ if any(s.state == "new" for s in found):
131
+ print(msg("→ lantern parts add <folder> · lantern parts ignore <folder> (two or more parts each get their own AGENTS.md)"))
132
+ return 0
133
+
134
+
105
135
  def cmd_principles(a: argparse.Namespace) -> int:
106
136
  """`lantern principles show|detect` — show the chosen design principles · detect languages and tools already in use."""
107
137
  from ..core import principles
@@ -338,6 +368,9 @@ def register(add: Add) -> None:
338
368
  ):
339
369
  p.add_argument(f"--{flag}")
340
370
  p.add_argument("--external", choices=["yes", "no"], help=msg("Connects to outside tools · services"))
371
+ p = add("parts", cmd_parts, msg("Parts with their own toolchain and rules — candidates · add · ignore"))
372
+ p.add_argument("action", nargs="?", choices=["add", "ignore"])
373
+ p.add_argument("path", nargs="?")
341
374
  p = add("principles", cmd_principles, msg("Design principles · code conventions — show the choice · detect languages and tools in use"))
342
375
  p.add_argument("action", choices=["show", "detect"])
343
376
  p.add_argument("--write", action="store_true", help=msg("detect: write code size · languages · check commands to lantern.yaml"))
@@ -7,6 +7,7 @@ Responsibilities:
7
7
  - pick code conventions by language and size
8
8
  - turn line and people counts into sizes (small · medium · large)
9
9
  - detect languages, runners and tools already in use from the project's top-level files
10
+ - find folders with their own manifest (candidates for parts with their own rules)
10
11
 
11
12
  Not here:
12
13
  - counting lines of code → report/harness.py (code_lines)
@@ -402,15 +403,39 @@ def select(profile: Profile) -> Selection | None:
402
403
  note = str(p.get("data_note") or "") if kind == "data" else ""
403
404
  principles.append(Principle(pid, p["name"], level, why, p["explain"], tuple(p["rules"]), note))
404
405
  always = tuple((a["name"], tuple(a["rules"])) for a in t["always"].values())
405
- docs_size = t["kinds"][kind].get("docs") or code
406
- convs = []
407
- for lang in profile.get("project.languages") or []:
406
+ convs = conventions_for(profile, list(profile.get("project.languages") or []))
407
+ return Selection(kind, external, code, people, tuple(principles), always, convs, locale)
408
+
409
+
410
+ def conventions_for(profile: Profile, languages: list[str]) -> tuple[Convention, ...]:
411
+ """Pick the code conventions of some languages for the project's size (and kind, for doc comments).
412
+
413
+ Args:
414
+ profile: Project profile (code size · kind · languages of documents and comments).
415
+ languages: Programming languages, e.g. the languages of one part of the project.
416
+
417
+ Returns:
418
+ One convention per known language, in the given order.
419
+
420
+ Example:
421
+ >>> from lanternspec.core.profile import DEFAULTS, Profile
422
+ >>> [c.label for c in conventions_for(Profile(DEFAULTS), ["typescript", "cobol"])]
423
+ ['TypeScript']
424
+ """
425
+ locale = profile.language
426
+ code = str(profile.get("project.code_size") or SIZES[0])
427
+ kind = profile.get("project.kind")
428
+ docs_size = (table(locale)["kinds"][kind].get("docs") if kind else None) or code
429
+ out = []
430
+ for lang in languages:
431
+ if lang not in language_names():
432
+ continue
408
433
  c = conventions(lang, locale, profile.comment_language)
409
434
  rules = dict(c["levels"][code])
410
435
  rules["docs"] = c["levels"][docs_size]["docs"]
411
436
  tools = {role: (spec["name"], _default_command(c, role)) for role, spec in c["tools"].items()}
412
- convs.append(Convention(lang, c["label"], code, tools, rules, c["docs"]["style"], c["docs"]["example"]))
413
- return Selection(kind, external, code, people, tuple(principles), always, tuple(convs), locale)
437
+ out.append(Convention(lang, c["label"], code, tools, rules, c["docs"]["style"], c["docs"]["example"]))
438
+ return tuple(out)
414
439
 
415
440
 
416
441
  @dataclass
@@ -501,6 +526,80 @@ def detect(root: Path) -> Detected:
501
526
  return out
502
527
 
503
528
 
529
+ # A folder that groups other packages (a workspace root) is not a part itself; its members are.
530
+ WORKSPACE_MARKS = (
531
+ "pnpm-workspace.yaml",
532
+ "go.work",
533
+ "lerna.json",
534
+ 'package.json:"workspaces"',
535
+ "pyproject.toml:[tool.uv.workspace]",
536
+ "Cargo.toml:[workspace]",
537
+ )
538
+ PART_DEPTH = 3 # how deep below the root a part's folder may be
539
+
540
+
541
+ @dataclass
542
+ class PartCandidate:
543
+ """A folder that looks like a part of the project with its own toolchain (its own manifest).
544
+
545
+ Attributes:
546
+ path: The folder, relative to the project root ("backend").
547
+ languages: Languages whose manifest is in it.
548
+ evidence: The manifest files that show it.
549
+
550
+ Example:
551
+ >>> PartCandidate("backend", ["python"], ["pyproject.toml"]).path
552
+ 'backend'
553
+ """
554
+
555
+ path: str
556
+ languages: list[str]
557
+ evidence: list[str]
558
+
559
+
560
+ def part_candidates(root: Path, files: list[str]) -> list[PartCandidate]:
561
+ """Find the folders below the root that carry their own manifest — candidates for a part with its own rules.
562
+
563
+ Only the given file list is searched (the caller passes what git tracks, so ignored folders such
564
+ as node_modules never show up). A workspace root is left out when its members are candidates.
565
+
566
+ Args:
567
+ root: Project root (manifests are read to tell workspace roots).
568
+ files: Paths relative to the root, with "/" separators.
569
+
570
+ Returns:
571
+ The candidates, sorted by path; the root itself is never one.
572
+
573
+ Example:
574
+ >>> found = part_candidates(Path("/nowhere"), ["backend/pyproject.toml", "web/package.json", "web/tsconfig.json", "README.md"])
575
+ >>> [(c.path, c.languages) for c in found]
576
+ [('backend', ['python']), ('web', ['typescript'])]
577
+ """
578
+ from fnmatch import fnmatch
579
+ from pathlib import PurePosixPath
580
+
581
+ patterns = {lang: [str(pat).partition(":")[0] for pat in conventions(lang)["detect"]] for lang in language_names()}
582
+ found: dict[str, dict[str, str]] = {}
583
+ for rel in files:
584
+ path = PurePosixPath(rel)
585
+ parts = path.parts
586
+ for i in range(len(parts)): # a manifest file, or a bundle folder such as App.xcodeproj
587
+ folder, name = "/".join(parts[:i]), parts[i]
588
+ if not folder or len(PurePosixPath(folder).parts) > PART_DEPTH:
589
+ continue
590
+ for lang, pats in patterns.items():
591
+ if any(fnmatch(name, pat) for pat in pats) and (i == len(parts) - 1 or "*" in "".join(pats)):
592
+ found.setdefault(folder, {}).setdefault(lang, name)
593
+ workspaces = {d for d in found if any(_found(root / d, mark) for mark in WORKSPACE_MARKS)}
594
+ out = []
595
+ for folder in sorted(found):
596
+ if folder in workspaces and any(other.startswith(folder + "/") for other in found):
597
+ continue # its members are the parts
598
+ langs = [lang for lang in language_names() if lang in found[folder]]
599
+ out.append(PartCandidate(folder, langs, [found[folder][lang] for lang in langs]))
600
+ return out
601
+
602
+
504
603
  def find_runner(root: Path, language: str) -> dict[str, Any]:
505
604
  """Find the runner for a language from its lock file.
506
605
 
@@ -56,6 +56,7 @@ DEFAULTS: dict[str, Any] = {
56
56
  "build": {"report_cycle": "work", "merge_approval": "required", "loop": "off", "loop_limit": 3},
57
57
  "check": {"max_lines": 300},
58
58
  "report": {"views": ["kanban", "timeline", "debt"]},
59
+ "code": {"parts": [], "ignored_parts": []}, # parts with their own toolchain and rules (lantern parts)
59
60
  }
60
61
 
61
62
  KNOWLEDGE_DEFAULTS: dict[str, Any] = {"type": "obsidian", "path": "", "areas_from": None, "write": "direct"}
@@ -339,6 +340,7 @@ def validate(data: dict[str, Any]) -> list[str]:
339
340
  if not isinstance(k, dict) or not k.get("path"):
340
341
  problems.append(msg("knowledge.path: the knowledge store path is empty (delete the knowledge block if there is none)"))
341
342
  problems += _section_problems(data)
343
+ problems += _part_problems(data)
342
344
  if get_path(data, "project.team") == "team" and not get_path(data, "project.members"):
343
345
  problems.append(msg("project.members: for a team (2 or more), list the owner candidates"))
344
346
  if get_path(data, "lantern") != PROFILE_VERSION:
@@ -346,6 +348,32 @@ def validate(data: dict[str, Any]) -> list[str]:
346
348
  return problems
347
349
 
348
350
 
351
+ def _part_problems(data: dict[str, Any]) -> list[str]:
352
+ """Check code.parts (folders with their own rules) and code.ignored_parts."""
353
+ problems: list[str] = []
354
+ parts = get_path(data, "code.parts") or []
355
+ if not isinstance(parts, list):
356
+ return [msg("code.parts: must be a list of parts (e.g. - path: backend)")]
357
+ for part in parts:
358
+ path = part.get("path") if isinstance(part, dict) else None
359
+ if not isinstance(path, str) or not path or path.startswith(("/", ".")) or ".." in path.split("/"):
360
+ problems.append(msg("code.parts: each part needs a folder path inside the project (e.g. path: backend)"))
361
+ continue
362
+ for lang in part.get("languages") or []:
363
+ if lang not in principles.language_names():
364
+ problems.append(
365
+ msg(
366
+ "code.parts {path}: '{lang}' is not a known language ({items})",
367
+ path=path,
368
+ lang=lang,
369
+ items=", ".join(principles.language_names()),
370
+ )
371
+ )
372
+ if not isinstance(get_path(data, "code.ignored_parts") or [], list):
373
+ problems.append(msg("code.ignored_parts: must be a list of folders"))
374
+ return problems
375
+
376
+
349
377
  def _section_problems(data: dict[str, Any]) -> list[str]:
350
378
  """Check project.language and the protected-section decisions (docs.sections · docs.unused_sections)."""
351
379
  language = str(get_path(data, "project.language") or "ko")
@@ -568,8 +596,15 @@ def render(data: dict[str, Any]) -> str:
568
596
  msg(" max_lines: {s} # warn to split when longer (doesn't block)", s=s(d["check"]["max_lines"])),
569
597
  "report:",
570
598
  f" views: {s(d['report']['views'])}",
571
- "",
572
599
  ]
600
+ code = d.get("code") or {}
601
+ if code.get("parts") or code.get("ignored_parts"):
602
+ lines += ["code:", msg(" # parts with their own toolchain and rules — lantern parts (each gets its own AGENTS.md)")]
603
+ body = yaml.safe_dump(
604
+ {"parts": code.get("parts") or [], "ignored_parts": code.get("ignored_parts") or []}, allow_unicode=True, sort_keys=False
605
+ )
606
+ lines += [" " + line for line in body.rstrip("\n").split("\n")]
607
+ lines.append("")
573
608
  return "\n".join(lines)
574
609
 
575
610
 
@@ -623,8 +658,9 @@ def update(root: Path, updates: dict[str, Any]) -> None:
623
658
  raise ValueError("\n".join(problems))
624
659
  text: str | None = path.read_text(encoding="utf-8")
625
660
  for k, v in updates.items():
626
- # a mapping spans several lines: render the whole file again instead of editing one line
627
- text = set_in_text(text, k, v) if text is not None and not isinstance(v, dict) else None
661
+ # a mapping (or a list of them) spans several lines: render the whole file again instead of editing one line
662
+ flat = not isinstance(v, dict) and not (isinstance(v, list) and any(isinstance(x, dict) for x in v))
663
+ text = set_in_text(text, k, v) if text is not None and flat else None
628
664
  if text is None: # a key not written in the file yet: render the whole file again
629
665
  save(root, data)
630
666
  else:
@@ -75,6 +75,10 @@ lantern scaffold init --plan # the folders · documents it would create (
75
75
  ```
76
76
  Tell the user the `principles show` result in a line or two (e.g. "CLI tool · external integrations → single responsibility and extension points are Must; Python uses ruff · pyright").
77
77
 
78
+ **Parts (each folder its own rules):** `lantern parts` lists the sub-folders with their own manifest (e.g. `backend` · `frontend/apps/web`) as candidates.
79
+ With **two or more**, ask about all of them at once, each with its evidence — "Make this folder a part?" — then `lantern parts add <folder>` · `lantern parts ignore <folder>` as answered.
80
+ Two or more parts each get their own `AGENTS.md` (that language's conventions · that folder's check commands), and the root AGENTS.md keeps a map of the parts. With one candidate or none, don't ask.
81
+
78
82
  **Tool settings files:**
79
83
  - 🏠 brownfield: settings `detect` finds **already in use are only recorded** — don't change settings files (`pyproject.toml` · `.eslintrc` …) or suggest switching tools. For a tool in the conventions that has no settings, only ask "add it?".
80
84
  - 🌱 greenfield: **ask** whether to add the convention's tools as dev dependencies (e.g. `uv add --dev ruff pyright` · `pnpm add -D @biomejs/biome typescript`) and create their settings (e.g. `[tool.ruff]` · `[tool.pyright]` in `pyproject.toml`), and **do it once approved**. They must be dev dependencies so CI installs the same tools. If declined, clear them with `lantern profile set build.lint= build.typecheck=`.
@@ -76,6 +76,10 @@ lantern scaffold init --plan # 만들 폴더 · 문서 목록 (아직 아
76
76
  ```
77
77
  `principles show` 결과를 한두 줄로 알려 준다 (예: "CLI 도구 · 바깥 연결 → 단일 책임 · 확장 지점은 지킴, Python은 ruff · pyright").
78
78
 
79
+ **영역 (폴더마다 자기 규칙):** `lantern parts`가 자기 매니페스트를 가진 하위 폴더(예: `backend` · `frontend/apps/web`)를 후보로 보여 준다.
80
+ 후보가 **둘 이상**이면 각각 근거와 함께 "이 폴더를 영역으로 둘까요?"를 한 번에 묻고, 답대로 `lantern parts add <폴더>` · `lantern parts ignore <폴더>`.
81
+ 영역이 둘 이상이면 영역마다 `AGENTS.md`(그 언어의 컨벤션 · 그 폴더의 확인 명령)가 생기고, 루트 AGENTS.md에는 영역 지도가 남는다. 후보가 하나 이하면 묻지 않는다.
82
+
79
83
  **도구 설정 파일:**
80
84
  - 🏠 brownfield: `detect`가 찾은 **이미 쓰는 설정은 기록만** 한다 — 설정 파일(`pyproject.toml` · `.eslintrc` 등)을 바꾸거나 다른 도구로 갈아타자고 하지 않는다. 컨벤션에 있는데 설정이 없는 도구는 "들일까요?"만 묻는다.
81
85
  - 🌱 greenfield: 컨벤션의 도구를 개발 의존성에 넣고(예: `uv add --dev ruff pyright` · `pnpm add -D @biomejs/biome typescript`) 설정(예: `pyproject.toml`의 `[tool.ruff]` · `[tool.pyright]`)을 만들지 **묻고, 승인하면** 한다. 개발 의존성에 있어야 CI에서도 같은 도구가 설치된다. 거절하면 `lantern profile set build.lint= build.typecheck=`로 비운다.
@@ -488,6 +488,11 @@
488
488
  "🔄 Doc-code alignment": {ko: "🔄 문서-코드 일치"}
489
489
  "📊 AI work evaluation": {ko: "📊 AI 작업 평가"}
490
490
 
491
+ # check/budget.py
492
+ "{name} {kb:.1f}KB · {lines} lines (budget {budget})": {ko: "{name} {kb:.1f}KB · {lines}줄 (예산 {budget})"}
493
+ "{count} lines": {ko: "{count}줄"}
494
+ " — over budget: LanternSpec's block {block:.1f}KB · your own text {own:.1f}KB; move details into documents and link them": {ko: " — 예산을 넘었습니다: LanternSpec 블록 {block:.1f}KB · 직접 쓴 글 {own:.1f}KB. 자세한 내용은 문서로 옮기고 링크로 남기세요"}
495
+
491
496
  # check/check_docs.py
492
497
  " (line {line})": {ko: " (줄 {line})"}
493
498
  "The '{title}' section is missing. This section {feature}. Did you change it on purpose?": {ko: "'{title}' 칸이 없습니다. 이 칸은 {feature}. 일부러 바꾸셨나요?"}
@@ -573,6 +578,8 @@
573
578
  "Claude Code reads AGENTS.md through the import in {file}": {ko: "Claude Code가 AGENTS.md를 읽습니다 (불러오는 곳: {file})"}
574
579
  "CLAUDE.local.md keeps Claude Code from reading AGENTS.md — set Project instructions to claude-md-and-agents-md in /config (or ~/.claude/settings.json)": {ko: "CLAUDE.local.md가 있으면 Claude Code가 AGENTS.md를 읽지 않습니다 — /config(또는 ~/.claude/settings.json)에서 Project instructions를 claude-md-and-agents-md로 바꾸세요"}
575
580
  "Claude Code reads AGENTS.md itself": {ko: "Claude Code가 AGENTS.md를 직접 읽습니다"}
581
+ "{items}: not handed to {tools} — only the AGENTS.md right in a part's folder is; move what matters there (lantern parts)": {ko: "{items}: {tools}에는 자동으로 전달되지 않습니다 — 영역 폴더 바로 아래의 AGENTS.md만 전달됩니다. 필요한 내용은 거기로 옮기세요 (lantern parts)"}
582
+ "Folders that could be parts with their own rules, not decided yet: {items} — lantern parts": {ko: "자기 규칙을 가질 수 있는 영역 후보를 아직 정하지 않았습니다: {items} — lantern parts"}
576
583
  "{label}: the {launch} command isn't on PATH — can't check its version": {ko: "{label}: {launch} 명령이 PATH에 없어 버전을 확인하지 못했습니다"}
577
584
  "{label} {version} is older than {min} — update it (some features won't work)": {ko: "{label} {version}은 {min}보다 낮습니다 — 업데이트하세요 (일부 기능이 동작하지 않습니다)"}
578
585
  "{label} {version} is newer than the last checked {verified} — if hooks misbehave, the hook rows below show it": {ko: "{label} {version}은 마지막으로 확인한 {verified}보다 새 버전입니다 — hook이 이상하면 아래 hook 줄에 나타납니다"}
@@ -683,6 +690,8 @@
683
690
  # tools/agent_hooks.py
684
691
  "LanternSpec tech question: no card for '{term}'. After answering, suggest in one line \"📒 Make a debt card?\" (/l-learn {term}).": {ko: "LanternSpec 기술 질문: '{term}' 카드가 없습니다. 답한 뒤 한 줄로 \"📒 부채 카드를 만들까요?\"라고 제안하세요 (/l-learn {term})."}
685
692
  "LanternSpec idea: something sounds like an idea. Without stopping the current work, record it right away by the /l-idea rules: lantern scaffold idea \"<title>\" --kind <kind> --raw \"<original words>\" --auto → mention it in one line only.": {ko: "LanternSpec 아이디어: 아이디어 같은 말이 있습니다. 하던 일은 멈추지 말고 /l-idea 규칙대로 바로 기록한다: lantern scaffold idea \"<제목>\" --kind <유형> --raw \"<원문>\" --auto → 한 줄로만 알림."}
693
+ "[LanternSpec] rules of part {part} ({file}):": {ko: "[LanternSpec] {part} 영역의 규칙 ({file}):"}
694
+ "Part in progress: {part} — its rules are in {part}/AGENTS.md": {ko: "지금 영역: {part} — 규칙은 {part}/AGENTS.md에"}
686
695
  "[LanternSpec now]": {ko: "[LanternSpec 지금 상황]"}
687
696
  "(open {file} · {file2} in the work folder only when you need the details)": {ko: "(자세한 내용은 해당 작업 폴더의 {file} · {file2}를 필요할 때만 연다)"}
688
697
  "[LanternSpec progress before compaction — saved to the documents]": {ko: "[LanternSpec 압축 전 진행 상황 — 문서에 저장됨]"}
@@ -802,6 +811,16 @@
802
811
  "--map \"old section=new section\"": {ko: "--map \"옛 칸=새 칸\""}
803
812
 
804
813
  # cli/core.py
814
+ "Parts with their own toolchain and rules — candidates · add · ignore": {ko: "자기 도구 · 규칙을 가진 영역 — 후보 보기 · 더하기 · 빼기"}
815
+ "No folder with its own toolchain below the root — the project is one part": {ko: "루트 아래에 자기 도구를 가진 폴더가 없습니다 — 프로젝트 전체가 한 영역입니다"}
816
+ "part": {ko: "영역"}
817
+ "ignored": {ko: "빼 둠"}
818
+ "not decided": {ko: "정하지 않음"}
819
+ "no manifest found any more": {ko: "매니페스트가 더는 없음"}
820
+ "→ lantern parts add <folder> · lantern parts ignore <folder> (two or more parts each get their own AGENTS.md)": {ko: "→ lantern parts add <폴더> · lantern parts ignore <폴더> (영역이 둘 이상이면 영역마다 AGENTS.md가 생깁니다)"}
821
+ "✔ Part {path} ({items}) — lantern upgrade writes its AGENTS.md": {ko: "✔ 영역 {path} ({items}) — lantern upgrade가 그 AGENTS.md를 씁니다"}
822
+ "✔ {path} is not a part — not asked again": {ko: "✔ {path}는 영역이 아닙니다 — 다시 묻지 않습니다"}
823
+ "{path} has no manifest of a known language — not a part": {ko: "{path}에 알려진 언어의 매니페스트가 없습니다 — 영역이 아닙니다"}
805
824
  "{lines:,} lines of code (without tests · docs) → {label} ({size})": {ko: "코드 {lines:,}줄 (테스트 · 문서 빼고) → {label} ({size})"}
806
825
  "Next: lantern principles show → lantern upgrade (into AGENTS.md · the principles document)": {ko: "다음: lantern principles show → lantern upgrade (AGENTS.md · 개발 원칙 문서에 반영)"}
807
826
  "Show · write · edit lantern.yaml · documents to turn on": {ko: "lantern.yaml 보기 · 쓰기 · 고치기 · 켜질 문서"}
@@ -986,6 +1005,11 @@
986
1005
  "lantern work stage W-012 <stage>": {ko: "lantern work stage W-012 <단계>"}
987
1006
 
988
1007
  # core/profile.py
1008
+ " # parts with their own toolchain and rules — lantern parts (each gets its own AGENTS.md)": {ko: " # 자기 도구 · 규칙을 가진 영역 — lantern parts (영역마다 AGENTS.md가 생긴다)"}
1009
+ "code.ignored_parts: must be a list of folders": {ko: "code.ignored_parts: 폴더 목록이어야 합니다"}
1010
+ "code.parts {path}: '{lang}' is not a known language ({items})": {ko: "code.parts {path}: '{lang}'은 알 수 없는 언어입니다 ({items})"}
1011
+ "code.parts: each part needs a folder path inside the project (e.g. path: backend)": {ko: "code.parts: 영역마다 프로젝트 안의 폴더 경로가 필요합니다 (예: path: backend)"}
1012
+ "code.parts: must be a list of parts (e.g. - path: backend)": {ko: "code.parts: 영역 목록이어야 합니다 (예: - path: backend)"}
989
1013
  "docs.unused_sections: '{r}' is not a protected section (available: {items})": {ko: "docs.unused_sections: '{r}'는 보호 칸이 아닙니다 (가능: {items})"}
990
1014
  "# lantern.yaml — what kind of project this is (the answers to /l-init). People may edit it by hand.": {ko: "# lantern.yaml — 이 프로젝트가 어떤 프로젝트인지 (/l-init의 답). 사람이 직접 고쳐도 된다."}
991
1015
  "lantern: {profile_version} # version of this file's format": {ko: "lantern: {profile_version} # 이 파일 형식의 버전"}