lanternspec 0.2.1__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.1/src/lanternspec.egg-info → lanternspec-0.2.3}/PKG-INFO +6 -4
  2. {lanternspec-0.2.1 → lanternspec-0.2.3}/README.md +5 -3
  3. {lanternspec-0.2.1 → lanternspec-0.2.3}/pyproject.toml +1 -1
  4. lanternspec-0.2.3/src/lanternspec/check/budget.py +161 -0
  5. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/check/doctor.py +62 -0
  6. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/cli/core.py +33 -0
  7. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/cli/report.py +11 -0
  8. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/core/principles.py +104 -5
  9. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/core/profile.py +39 -3
  10. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/core/state.py +10 -9
  11. lanternspec-0.2.3/src/lanternspec/report/resume.py +133 -0
  12. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-init/SKILL.md +4 -0
  13. lanternspec-0.2.3/src/lanternspec/resources/locales/en/skills/l-resume/SKILL.md +38 -0
  14. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-init/SKILL.md +4 -0
  15. lanternspec-0.2.3/src/lanternspec/resources/locales/ko/skills/l-resume/SKILL.md +38 -0
  16. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/messages.yaml +45 -0
  17. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/principles.yaml +6 -0
  18. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/tools/agent_hooks.py +109 -9
  19. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/tools/antigravity.py +47 -6
  20. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/tools/base.py +83 -3
  21. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/tools/claude.py +63 -20
  22. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/tools/codex.py +59 -6
  23. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/tools/install.py +41 -1
  24. lanternspec-0.2.3/src/lanternspec/tools/parts.py +209 -0
  25. lanternspec-0.2.3/src/lanternspec/tools/rules.py +228 -0
  26. lanternspec-0.2.3/src/lanternspec/tools/sessions.py +132 -0
  27. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/tools/skills.py +1 -0
  28. {lanternspec-0.2.1 → lanternspec-0.2.3/src/lanternspec.egg-info}/PKG-INFO +6 -4
  29. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec.egg-info/SOURCES.txt +10 -0
  30. lanternspec-0.2.3/tests/test_budget.py +54 -0
  31. {lanternspec-0.2.1 → lanternspec-0.2.3}/tests/test_core.py +1 -1
  32. {lanternspec-0.2.1 → lanternspec-0.2.3}/tests/test_install_and_aux.py +2 -2
  33. {lanternspec-0.2.1 → lanternspec-0.2.3}/tests/test_later_features.py +4 -3
  34. lanternspec-0.2.3/tests/test_part_delivery.py +97 -0
  35. lanternspec-0.2.3/tests/test_parts.py +110 -0
  36. lanternspec-0.2.3/tests/test_resume.py +122 -0
  37. lanternspec-0.2.1/src/lanternspec/tools/rules.py +0 -113
  38. {lanternspec-0.2.1 → lanternspec-0.2.3}/LICENSE +0 -0
  39. {lanternspec-0.2.1 → lanternspec-0.2.3}/setup.cfg +0 -0
  40. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/__init__.py +0 -0
  41. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/__main__.py +0 -0
  42. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/check/__init__.py +0 -0
  43. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/check/check_docs.py +0 -0
  44. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/check/githooks.py +0 -0
  45. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/check/layout.py +0 -0
  46. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/check/legacy.py +0 -0
  47. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/check/templates.py +0 -0
  48. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/cli/__init__.py +0 -0
  49. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/cli/check.py +0 -0
  50. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/cli/common.py +0 -0
  51. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/cli/learn.py +0 -0
  52. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/cli/tools.py +0 -0
  53. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/cli/work.py +0 -0
  54. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/core/__init__.py +0 -0
  55. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/core/enums.py +0 -0
  56. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/core/frontmatter.py +0 -0
  57. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/core/links.py +0 -0
  58. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/core/messages.py +0 -0
  59. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/core/meta.py +0 -0
  60. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/core/names.py +0 -0
  61. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/core/new_id.py +0 -0
  62. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/core/project.py +0 -0
  63. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/core/sections.py +0 -0
  64. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/core/taskfile.py +0 -0
  65. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/core/templating.py +0 -0
  66. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/learn/__init__.py +0 -0
  67. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/learn/debt.py +0 -0
  68. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/learn/knowledge/__init__.py +0 -0
  69. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/learn/knowledge/drafts.py +0 -0
  70. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/learn/knowledge/mcp_server.py +0 -0
  71. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/learn/knowledge/notion.py +0 -0
  72. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/learn/knowledge/obsidian.py +0 -0
  73. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/report/__init__.py +0 -0
  74. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/report/doc_map.py +0 -0
  75. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/report/evaluate.py +0 -0
  76. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/report/harness.py +0 -0
  77. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/report/obsidian.py +0 -0
  78. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/report/principles_doc.py +0 -0
  79. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/report/scan.py +0 -0
  80. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/report/sections_doc.py +0 -0
  81. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/report/status.py +0 -0
  82. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/report/views.py +0 -0
  83. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/__init__.py +0 -0
  84. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/conventions/go.yaml +0 -0
  85. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/conventions/python.yaml +0 -0
  86. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/conventions/rust.yaml +0 -0
  87. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/conventions/swift.yaml +0 -0
  88. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/conventions/typescript.yaml +0 -0
  89. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/agents/AGENTS.md +0 -0
  90. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-adr/SKILL.md +0 -0
  91. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-build/SKILL.md +0 -0
  92. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-check/SKILL.md +0 -0
  93. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-design/SKILL.md +0 -0
  94. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-idea/SKILL.md +0 -0
  95. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-learn/SKILL.md +0 -0
  96. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-map/SKILL.md +0 -0
  97. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-plan/SKILL.md +0 -0
  98. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-report/SKILL.md +0 -0
  99. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-sync/SKILL.md +0 -0
  100. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-task/SKILL.md +0 -0
  101. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/skills/l-template/SKILL.md +0 -0
  102. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/ADR.md +0 -0
  103. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/API.md +0 -0
  104. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Architecture.md +0 -0
  105. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Collaboration Rules.md +0 -0
  106. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Competency Card.md +0 -0
  107. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Data.md +0 -0
  108. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Debt Card.md +0 -0
  109. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Deployment.md +0 -0
  110. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Design.md +0 -0
  111. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Docs MOC.md +0 -0
  112. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Feature List.md +0 -0
  113. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Idea.md +0 -0
  114. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Known Tech.md +0 -0
  115. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Legacy Map.md +0 -0
  116. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Log.md +0 -0
  117. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Meeting Notes.md +0 -0
  118. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Plan.md +0 -0
  119. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Platform Integration.md +0 -0
  120. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Project Definition.md +0 -0
  121. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Screens.md +0 -0
  122. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Server Operations.md +0 -0
  123. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Session Log.md +0 -0
  124. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Tasks.md +0 -0
  125. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/Work Division Rules.md +0 -0
  126. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/en/templates/_meta/enums.yaml +0 -0
  127. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/agents/AGENTS.md +0 -0
  128. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-adr/SKILL.md +0 -0
  129. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-build/SKILL.md +0 -0
  130. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-check/SKILL.md +0 -0
  131. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-design/SKILL.md +0 -0
  132. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-idea/SKILL.md +0 -0
  133. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-learn/SKILL.md +0 -0
  134. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-map/SKILL.md +0 -0
  135. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-plan/SKILL.md +0 -0
  136. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-report/SKILL.md +0 -0
  137. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-sync/SKILL.md +0 -0
  138. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-task/SKILL.md +0 -0
  139. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/skills/l-template/SKILL.md +0 -0
  140. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates/ADR.md +0 -0
  141. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates/API.md +0 -0
  142. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates/_meta/enums.yaml +0 -0
  143. {lanternspec-0.2.1 → 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
  144. {lanternspec-0.2.1 → 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
  145. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//352/270/260/353/241/235.md" +0 -0
  146. {lanternspec-0.2.1 → 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
  147. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//352/270/260/355/232/215.md" +0 -0
  148. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//353/215/260/354/235/264/355/204/260.md" +0 -0
  149. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//353/260/260/355/217/254.md" +0 -0
  150. {lanternspec-0.2.1 → 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
  151. {lanternspec-0.2.1 → 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
  152. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//354/204/244/352/263/204.md" +0 -0
  153. {lanternspec-0.2.1 → 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
  154. {lanternspec-0.2.1 → 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
  155. {lanternspec-0.2.1 → 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
  156. {lanternspec-0.2.1 → 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
  157. {lanternspec-0.2.1 → 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
  158. {lanternspec-0.2.1 → 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
  159. {lanternspec-0.2.1 → 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
  160. {lanternspec-0.2.1 → 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
  161. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//355/225/240 /354/235/274.md" +0 -0
  162. {lanternspec-0.2.1 → 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
  163. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//355/231/224/353/251/264.md" +0 -0
  164. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/locales/ko/templates//355/232/214/354/235/230/353/241/235.md" +0 -0
  165. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/resources/names.yaml +0 -0
  166. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/tools/__init__.py +0 -0
  167. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/tools/close.py +0 -0
  168. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/tools/docs_mode.py +0 -0
  169. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/tools/health.py +0 -0
  170. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/tools/runlog.py +0 -0
  171. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/work/__init__.py +0 -0
  172. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/work/branches.py +0 -0
  173. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/work/dbml.py +0 -0
  174. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/work/epic_rules.py +0 -0
  175. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/work/ideas.py +0 -0
  176. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/work/pack.py +0 -0
  177. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/work/progress.py +0 -0
  178. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/work/scaffold.py +0 -0
  179. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/work/screen.py +0 -0
  180. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/work/stages.py +0 -0
  181. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec/work/tasks.py +0 -0
  182. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec.egg-info/dependency_links.txt +0 -0
  183. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec.egg-info/entry_points.txt +0 -0
  184. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec.egg-info/requires.txt +0 -0
  185. {lanternspec-0.2.1 → lanternspec-0.2.3}/src/lanternspec.egg-info/top_level.txt +0 -0
  186. {lanternspec-0.2.1 → lanternspec-0.2.3}/tests/test_checks.py +0 -0
  187. {lanternspec-0.2.1 → lanternspec-0.2.3}/tests/test_english.py +0 -0
  188. {lanternspec-0.2.1 → lanternspec-0.2.3}/tests/test_enums_single_source.py +0 -0
  189. {lanternspec-0.2.1 → lanternspec-0.2.3}/tests/test_git.py +0 -0
  190. {lanternspec-0.2.1 → lanternspec-0.2.3}/tests/test_layout.py +0 -0
  191. {lanternspec-0.2.1 → lanternspec-0.2.3}/tests/test_learning_line.py +0 -0
  192. {lanternspec-0.2.1 → lanternspec-0.2.3}/tests/test_messages.py +0 -0
  193. {lanternspec-0.2.1 → lanternspec-0.2.3}/tests/test_name_overlap.py +0 -0
  194. {lanternspec-0.2.1 → lanternspec-0.2.3}/tests/test_names.py +0 -0
  195. {lanternspec-0.2.1 → lanternspec-0.2.3}/tests/test_obsidian.py +0 -0
  196. {lanternspec-0.2.1 → lanternspec-0.2.3}/tests/test_principles.py +0 -0
  197. {lanternspec-0.2.1 → lanternspec-0.2.3}/tests/test_principles_data.py +0 -0
  198. {lanternspec-0.2.1 → lanternspec-0.2.3}/tests/test_release_script.py +0 -0
  199. {lanternspec-0.2.1 → lanternspec-0.2.3}/tests/test_skill_commands.py +0 -0
  200. {lanternspec-0.2.1 → lanternspec-0.2.3}/tests/test_tool_health.py +0 -0
  201. {lanternspec-0.2.1 → 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.1
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
@@ -124,6 +124,7 @@ flowchart LR
124
124
  | `/l-sync` | finds where documents and code disagree and brings them back in line | — |
125
125
  | `/l-map` | updates the MOC (document map) | `Docs MOC.md` |
126
126
  | `/l-adr` | records decisions that are hard to reverse | `Decisions/ADR-001 …` |
127
+ | `/l-resume` | carries on an earlier conversation — from any AI tool, from where it stopped even if it was cut off | — |
127
128
 
128
129
  ### How it works
129
130
  - **Scripts handle the format, the AI writes the content.** Numbering, files, folders, checks and status changes all go through the `lantern` command; the AI only writes content.
@@ -180,7 +181,7 @@ When Obsidian first asks whether to turn on community plugins, turn them on (lea
180
181
  | Codex | `.agents/skills` (`$l-…`) | `AGENTS.md` | `.codex/hooks.json` | `.codex/config.toml` |
181
182
  | Antigravity CLI (`agy`) | `.agents/skills` | `AGENTS.md` | `.agents/hooks.json` (no save-before-compaction — there is no compaction hook) | `.agents/plugins/lanternspec/` |
182
183
 
183
- - **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.
184
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.
185
186
 
186
187
  ## Keeping documents and code in line
@@ -238,6 +239,7 @@ Picks design principles and code conventions from a table, based on the project
238
239
 
239
240
  - Languages: Python · TypeScript · Swift · Rust · Go
240
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).
241
243
  - In existing projects, lint and format settings already in use are recorded, never changed.
242
244
  - When the code grows past a size boundary, `lantern doctor` asks whether to raise the principles one level.
243
245
  - The language of code comments can be set apart from the documents with `project.comment_language`.
@@ -261,13 +263,13 @@ Import mockups with `lantern screen import`; `lantern screen compare` finds wher
261
263
 
262
264
  ```text
263
265
  setup install [--language] [--tools] [--mcp] [--ci|--no-ci] · upgrade [--apply] · doctor · harness suggest
264
- 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
265
267
  documents scaffold init [--plan] | work | doc | idea | adr | meeting | custom · new-id · map · meta get|set
266
268
  checks check [--changed] [--epic W-012] · lint · check-dbml · dbml render|from-sql|diff
267
269
  work task next [--all]|start|done|ac|list|estimate · task add [--parallel] · pack · screen import|compare
268
270
  work branch|start|list|finish|archive|stage · design approve · unit-log add · idea find|status
269
271
  learning knowledge search|read|propose|write|areas · debt find|new|ask|resolve|promote|practice|known|status|list · mcp
270
- reports report [--views] [--summary] · status · scan [--tests] · sync adopt · eval · obsidian plugins
272
+ reports report [--views] [--summary] · status · resume [--session] [--more] · scan [--tests] · sync adopt · eval · obsidian plugins
271
273
  templates template list|lint|level|bump|outdated|diff|usage|new|migrate · legacy adopt|todos
272
274
  git hooks install|uninstall|status · docs-mode local|shared
273
275
  wrap-up close <skill>
@@ -109,6 +109,7 @@ flowchart LR
109
109
  | `/l-sync` | finds where documents and code disagree and brings them back in line | — |
110
110
  | `/l-map` | updates the MOC (document map) | `Docs MOC.md` |
111
111
  | `/l-adr` | records decisions that are hard to reverse | `Decisions/ADR-001 …` |
112
+ | `/l-resume` | carries on an earlier conversation — from any AI tool, from where it stopped even if it was cut off | — |
112
113
 
113
114
  ### How it works
114
115
  - **Scripts handle the format, the AI writes the content.** Numbering, files, folders, checks and status changes all go through the `lantern` command; the AI only writes content.
@@ -165,7 +166,7 @@ When Obsidian first asks whether to turn on community plugins, turn them on (lea
165
166
  | Codex | `.agents/skills` (`$l-…`) | `AGENTS.md` | `.codex/hooks.json` | `.codex/config.toml` |
166
167
  | Antigravity CLI (`agy`) | `.agents/skills` | `AGENTS.md` | `.agents/hooks.json` (no save-before-compaction — there is no compaction hook) | `.agents/plugins/lanternspec/` |
167
168
 
168
- - **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.
169
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.
170
171
 
171
172
  ## Keeping documents and code in line
@@ -223,6 +224,7 @@ Picks design principles and code conventions from a table, based on the project
223
224
 
224
225
  - Languages: Python · TypeScript · Swift · Rust · Go
225
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).
226
228
  - In existing projects, lint and format settings already in use are recorded, never changed.
227
229
  - When the code grows past a size boundary, `lantern doctor` asks whether to raise the principles one level.
228
230
  - The language of code comments can be set apart from the documents with `project.comment_language`.
@@ -246,13 +248,13 @@ Import mockups with `lantern screen import`; `lantern screen compare` finds wher
246
248
 
247
249
  ```text
248
250
  setup install [--language] [--tools] [--mcp] [--ci|--no-ci] · upgrade [--apply] · doctor · harness suggest
249
- 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
250
252
  documents scaffold init [--plan] | work | doc | idea | adr | meeting | custom · new-id · map · meta get|set
251
253
  checks check [--changed] [--epic W-012] · lint · check-dbml · dbml render|from-sql|diff
252
254
  work task next [--all]|start|done|ac|list|estimate · task add [--parallel] · pack · screen import|compare
253
255
  work branch|start|list|finish|archive|stage · design approve · unit-log add · idea find|status
254
256
  learning knowledge search|read|propose|write|areas · debt find|new|ask|resolve|promote|practice|known|status|list · mcp
255
- reports report [--views] [--summary] · status · scan [--tests] · sync adopt · eval · obsidian plugins
257
+ reports report [--views] [--summary] · status · resume [--session] [--more] · scan [--tests] · sync adopt · eval · obsidian plugins
256
258
  templates template list|lint|level|bump|outdated|diff|usage|new|migrate · legacy adopt|todos
257
259
  git hooks install|uninstall|status · docs-mode local|shared
258
260
  wrap-up close <skill>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "lanternspec"
7
- version = "0.2.1"
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"))
@@ -21,6 +21,14 @@ def cmd_report(a: argparse.Namespace) -> int:
21
21
  return 0
22
22
 
23
23
 
24
+ def cmd_resume(a: argparse.Namespace) -> int:
25
+ """`lantern resume` — sum up an earlier conversation so any AI tool can carry it on."""
26
+ from ..report.resume import summary
27
+
28
+ _print(summary(_p(), a.session, a.more))
29
+ return 0
30
+
31
+
24
32
  def cmd_status(a: argparse.Namespace) -> int:
25
33
  """`lantern status` — print the three-line current status."""
26
34
  from ..report.status import lines
@@ -135,6 +143,9 @@ def register(add: Add) -> None:
135
143
  p.add_argument("--views")
136
144
  p.add_argument("--summary", nargs="+", help=msg("3-line summary"))
137
145
  add("status", cmd_status, msg("Where things stand in 3 lines"))
146
+ p = add("resume", cmd_resume, msg("Carry on an earlier conversation in any AI tool — where it stopped, even if it was cut off"))
147
+ p.add_argument("--session", help=msg("Which conversation: its number in the list or the start of its id"))
148
+ p.add_argument("--more", type=int, default=0, help=msg("Show this many pages further back"))
138
149
  p = add("obsidian", cmd_obsidian, msg("Download the recommended Obsidian plugins (Dataview · Metadata Menu)"))
139
150
  p.add_argument("action", choices=["plugins"])
140
151
  p = add("scan", cmd_scan, msg("Find doc-code mismatches"))
@@ -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:
@@ -21,12 +21,7 @@ from .project import Project
21
21
 
22
22
  INSTALLED = "installed.json"
23
23
 
24
- STATE_GITIGNORE = """# {note}
25
- runs.jsonl
26
- runs-state/
27
- hook-state/
28
- pack/
29
- """
24
+ IGNORED = ("runs.jsonl", "runs-state/", "hook-state/", "pack/", "sessions/") # personal records, never committed
30
25
 
31
26
 
32
27
  def sha256_text(text: str) -> str:
@@ -65,7 +60,9 @@ def sha256_file(path: Path) -> str:
65
60
 
66
61
 
67
62
  def ensure_state_dir(project: Project) -> Path:
68
- """Create the `.lantern` folder (with a .gitignore for personal records) when missing.
63
+ """Create the `.lantern` folder when missing, and make its .gitignore cover every personal record.
64
+
65
+ An existing .gitignore keeps its lines; entries a newer version added are appended.
69
66
 
70
67
  Args:
71
68
  project: The project.
@@ -79,8 +76,12 @@ def ensure_state_dir(project: Project) -> Path:
79
76
  """
80
77
  project.state.mkdir(parents=True, exist_ok=True)
81
78
  gi = project.state / ".gitignore"
82
- if not gi.exists():
83
- gi.write_text(STATE_GITIGNORE.format(note=msg("LanternSpec local state — personal records are not committed")), encoding="utf-8")
79
+ text = (
80
+ gi.read_text(encoding="utf-8") if gi.exists() else "# " + msg("LanternSpec local state — personal records are not committed") + "\n"
81
+ )
82
+ missing = [entry for entry in IGNORED if entry not in text.splitlines()]
83
+ if missing or not gi.exists():
84
+ gi.write_text(text.rstrip("\n") + "\n" + "".join(f"{entry}\n" for entry in missing), encoding="utf-8")
84
85
  return project.state
85
86
 
86
87