lanternspec 0.3.2__tar.gz → 0.4.0__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.
- {lanternspec-0.3.2/src/lanternspec.egg-info → lanternspec-0.4.0}/PKG-INFO +8 -14
- {lanternspec-0.3.2 → lanternspec-0.4.0}/README.md +7 -13
- {lanternspec-0.3.2 → lanternspec-0.4.0}/pyproject.toml +1 -1
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/check/check_docs.py +13 -4
- lanternspec-0.4.0/src/lanternspec/check/legacy.py +407 -0
- lanternspec-0.4.0/src/lanternspec/check/openspec.py +778 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/check/templates.py +5 -5
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/cli/check.py +32 -4
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/cli/report.py +56 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/cli/tools.py +17 -1
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/cli/work.py +206 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/core/names.py +35 -1
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/core/profile.py +102 -9
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/core/sections.py +24 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/core/taskfile.py +34 -4
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/learn/debt.py +30 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/learn/knowledge/__init__.py +3 -1
- lanternspec-0.4.0/src/lanternspec/learn/knowledge/access.py +120 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/learn/knowledge/obsidian.py +76 -12
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/report/build_mode.py +20 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/report/evaluate.py +11 -6
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/report/obsidian.py +54 -3
- lanternspec-0.4.0/src/lanternspec/report/retro.py +581 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/report/status.py +3 -5
- lanternspec-0.4.0/src/lanternspec/resources/locales/en/agents/lantern-reviewer.md +27 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-build/SKILL.md +39 -5
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-design/SKILL.md +9 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-finish/SKILL.md +1 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-idea/SKILL.md +16 -2
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-init/SKILL.md +28 -5
- lanternspec-0.4.0/src/lanternspec/resources/locales/en/skills/l-migrate/SKILL.md +50 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-plan/SKILL.md +4 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-template/SKILL.md +6 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/ADR.md +11 -6
- lanternspec-0.4.0/src/lanternspec/resources/locales/en/templates/AI Retro.md +27 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/API.md +5 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Architecture.md +7 -4
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Competency Card.md +9 -5
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Data.md +5 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Debt Card.md +9 -5
- lanternspec-0.4.0/src/lanternspec/resources/locales/en/templates/Design System.md +61 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Design.md +13 -7
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Docs MOC.md +5 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Feature List.md +5 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Glossary.md +5 -3
- lanternspec-0.4.0/src/lanternspec/resources/locales/en/templates/Idea - Bug.md +90 -0
- lanternspec-0.4.0/src/lanternspec/resources/locales/en/templates/Idea - Experiment.md +81 -0
- lanternspec-0.4.0/src/lanternspec/resources/locales/en/templates/Idea - Feature.md +78 -0
- lanternspec-0.4.0/src/lanternspec/resources/locales/en/templates/Idea - Improvement.md +82 -0
- lanternspec-0.4.0/src/lanternspec/resources/locales/en/templates/Idea - Tech Review.md +95 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Idea.md +11 -6
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Known Tech.md +5 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Legacy Map.md +7 -4
- lanternspec-0.4.0/src/lanternspec/resources/locales/en/templates/Log.md +54 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Meeting Notes.md +5 -3
- lanternspec-0.4.0/src/lanternspec/resources/locales/en/templates/Plan.md +85 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Project Definition.md +13 -7
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Repository File Rules.md +60 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Screens.md +7 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Session Log.md +7 -4
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Tasks.md +5 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Work Division Rules.md +5 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/_meta/enums.yaml +43 -0
- lanternspec-0.4.0/src/lanternspec/resources/locales/ko/agents/lantern-reviewer.md +27 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-build/SKILL.md +39 -5
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-design/SKILL.md +9 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-finish/SKILL.md +1 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-idea/SKILL.md +16 -2
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-init/SKILL.md +28 -5
- lanternspec-0.4.0/src/lanternspec/resources/locales/ko/skills/l-migrate/SKILL.md +50 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-plan/SKILL.md +4 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-template/SKILL.md +6 -3
- lanternspec-0.4.0/src/lanternspec/resources/locales/ko/templates/ADR.md +51 -0
- lanternspec-0.4.0/src/lanternspec/resources/locales/ko/templates/AI /355/232/214/352/263/240.md" +27 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates/API.md +5 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates/_meta/enums.yaml +43 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//352/260/234/353/260/234/353/254/270/354/204/234 MOC.md" +5 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//352/270/260/353/212/245 /353/252/251/353/241/235.md" +5 -3
- lanternspec-0.4.0/src/lanternspec/resources/locales/ko/templates//352/270/260/353/241/235.md +54 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/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" +7 -4
- lanternspec-0.4.0/src/lanternspec/resources/locales/ko/templates//352/270/260/355/232/215.md +85 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//353/215/260/354/235/264/355/204/260.md +5 -3
- lanternspec-0.4.0/src/lanternspec/resources/locales/ko/templates//353/224/224/354/236/220/354/235/270 /354/213/234/354/212/244/355/205/234.md" +61 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//353/266/200/354/261/204 /354/271/264/353/223/234.md" +9 -5
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//354/204/244/352/263/204.md +13 -7
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//354/204/270/354/205/230 /352/270/260/353/241/235.md" +7 -4
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//354/213/234/354/212/244/355/205/234 /352/265/254/354/241/260.md" +7 -4
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//354/225/204/353/212/224 /352/270/260/354/210/240.md" +5 -3
- lanternspec-0.4.0/src/lanternspec/resources/locales/ko/templates//354/225/204/354/235/264/353/224/224/354/226/264 - /352/260/234/354/204/240.md" +82 -0
- lanternspec-0.4.0/src/lanternspec/resources/locales/ko/templates//354/225/204/354/235/264/353/224/224/354/226/264 - /352/270/260/353/212/245.md" +78 -0
- lanternspec-0.4.0/src/lanternspec/resources/locales/ko/templates//354/225/204/354/235/264/353/224/224/354/226/264 - /352/270/260/354/210/240 /352/262/200/355/206/240.md" +95 -0
- lanternspec-0.4.0/src/lanternspec/resources/locales/ko/templates//354/225/204/354/235/264/353/224/224/354/226/264 - /353/262/204/352/267/270.md" +90 -0
- lanternspec-0.4.0/src/lanternspec/resources/locales/ko/templates//354/225/204/354/235/264/353/224/224/354/226/264 - /354/213/244/355/227/230.md" +81 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//354/225/204/354/235/264/353/224/224/354/226/264.md +11 -6
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//354/227/255/353/237/211 /354/271/264/353/223/234.md" +9 -5
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//354/232/251/354/226/264/354/247/221.md +5 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/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" +5 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//354/240/200/354/236/245/354/206/214 /355/214/214/354/235/274 /352/267/234/354/271/231.md" +60 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/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" +13 -7
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//355/225/240 /354/235/274.md" +5 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//355/231/224/353/251/264.md +7 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//355/232/214/354/235/230/353/241/235.md +5 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/messages.yaml +237 -2
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/names.yaml +19 -0
- lanternspec-0.4.0/src/lanternspec/resources/openspec.yaml +26 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/tools/agent_hooks.py +130 -6
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/tools/antigravity.py +18 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/tools/base.py +142 -1
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/tools/claude.py +125 -1
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/tools/codex.py +87 -1
- lanternspec-0.4.0/src/lanternspec/tools/guard.py +338 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/tools/health.py +3 -2
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/tools/install.py +5 -3
- lanternspec-0.4.0/src/lanternspec/tools/runlog.py +398 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/tools/skills.py +1 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/work/branches.py +30 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/work/epic_rules.py +14 -1
- lanternspec-0.4.0/src/lanternspec/work/loop.py +769 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/work/pack.py +15 -4
- lanternspec-0.4.0/src/lanternspec/work/review.py +556 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/work/scaffold.py +29 -2
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/work/stages.py +67 -4
- {lanternspec-0.3.2 → lanternspec-0.4.0/src/lanternspec.egg-info}/PKG-INFO +8 -14
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec.egg-info/SOURCES.txt +33 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_checks.py +3 -3
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_core.py +1 -1
- lanternspec-0.4.0/tests/test_guard.py +147 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_install_and_aux.py +15 -15
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_layout.py +3 -2
- lanternspec-0.4.0/tests/test_legacy.py +138 -0
- lanternspec-0.4.0/tests/test_loop.py +415 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_names.py +1 -1
- lanternspec-0.4.0/tests/test_openspec.py +168 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_refs.py +6 -6
- lanternspec-0.4.0/tests/test_retro.py +354 -0
- lanternspec-0.4.0/tests/test_review.py +533 -0
- lanternspec-0.4.0/tests/test_runlog.py +260 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_tool_health.py +1 -1
- lanternspec-0.4.0/tests/test_understood.py +181 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_work_line.py +21 -0
- lanternspec-0.3.2/src/lanternspec/check/legacy.py +0 -183
- lanternspec-0.3.2/src/lanternspec/resources/locales/en/templates/Log.md +0 -48
- lanternspec-0.3.2/src/lanternspec/resources/locales/en/templates/Plan.md +0 -73
- lanternspec-0.3.2/src/lanternspec/resources/locales/ko/templates/ADR.md +0 -46
- lanternspec-0.3.2/src/lanternspec/resources/locales/ko/templates//352/270/260/353/241/235.md +0 -48
- lanternspec-0.3.2/src/lanternspec/resources/locales/ko/templates//352/270/260/355/232/215.md +0 -73
- lanternspec-0.3.2/src/lanternspec/tools/runlog.py +0 -183
- {lanternspec-0.3.2 → lanternspec-0.4.0}/LICENSE +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/setup.cfg +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/__init__.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/__main__.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/check/__init__.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/check/budget.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/check/doctor.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/check/githooks.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/check/layout.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/check/pr_check.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/cli/__init__.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/cli/color.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/cli/common.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/cli/core.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/cli/learn.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/cli/refs.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/core/__init__.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/core/enums.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/core/frontmatter.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/core/links.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/core/messages.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/core/meta.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/core/new_id.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/core/outline.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/core/principles.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/core/project.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/core/state.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/core/templating.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/learn/__init__.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/learn/knowledge/drafts.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/learn/knowledge/mcp_server.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/learn/knowledge/notion.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/refs/__init__.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/refs/convert.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/refs/domain.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/refs/index.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/refs/rules.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/refs/sources.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/refs/terms.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/report/__init__.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/report/doc_map.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/report/principles_doc.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/report/resume.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/report/scan.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/report/sections_doc.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/report/views.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/__init__.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/conventions/go.yaml +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/conventions/python.yaml +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/conventions/rust.yaml +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/conventions/swift.yaml +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/conventions/typescript.yaml +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/agents/AGENTS.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/git/gitmessage.txt +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/github/pull_request_template.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-adr/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-check/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-domain/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-learn/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-map/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-parallel/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-pr/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-ref/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-ref/domain.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-ref/rules.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-ref/terms.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-report/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-resume/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-sync/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-task/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Collaboration Rules.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Deployment.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Platform Integration.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Server Operations.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Task Breakdown Rules.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Tech Selection Criteria.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/agents/AGENTS.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/git/gitmessage.txt +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/github/pull_request_template.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-adr/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-check/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-domain/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-learn/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-map/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-parallel/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-pr/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-ref/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-ref/domain.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-ref/rules.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-ref/terms.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-report/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-resume/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-sync/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-task/SKILL.md +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//352/270/260/354/210/240 /354/204/240/355/203/235 /352/270/260/354/244/200.md" +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//353/260/260/355/217/254.md" +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/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
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//355/224/214/353/236/253/355/217/274 /354/227/260/353/217/231.md" +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//355/225/240 /354/235/274 /353/202/230/353/210/204/352/270/260 /352/270/260/354/244/200.md" +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//355/230/221/354/227/205 /352/267/234/354/271/231.md" +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/obsidian/lantern-kanban/main.js +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/obsidian/lantern-kanban/manifest.json +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/obsidian/lantern-kanban/styles.css +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/obsidian/lantern-timeline/main.js +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/obsidian/lantern-timeline/manifest.json +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/obsidian/lantern-timeline/styles.css +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/resources/principles.yaml +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/tools/__init__.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/tools/close.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/tools/docs_mode.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/tools/parts.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/tools/rules.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/tools/sessions.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/work/__init__.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/work/dbml.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/work/ideas.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/work/progress.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/work/screen.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec/work/tasks.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec.egg-info/dependency_links.txt +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec.egg-info/entry_points.txt +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec.egg-info/requires.txt +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/src/lanternspec.egg-info/top_level.txt +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_budget.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_color.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_english.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_enums_single_source.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_git.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_later_features.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_learning_line.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_messages.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_name_overlap.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_obsidian.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_part_delivery.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_parts.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_principles.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_principles_data.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_progress_parallel.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_release_script.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_resume.py +0 -0
- {lanternspec-0.3.2 → lanternspec-0.4.0}/tests/test_skill_commands.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lanternspec
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Spec-driven development for agentic software engineering
|
|
5
5
|
Author: Jihyeok Jeong
|
|
6
6
|
License-Expression: MIT
|
|
@@ -101,21 +101,12 @@ Then call `/l-init` inside your AI tool (`$l-init` in Codex).
|
|
|
101
101
|
|
|
102
102
|
What the concepts in this document mean and where they are used is gathered in [Concepts](https://github.com/Jungjihyuk/LanternSpec/blob/main/CONCEPTS.md). To change LanternSpec itself, start with the [design rationale](https://github.com/Jungjihyuk/LanternSpec/blob/main/RATIONALE.md), which records why the flow, folders and rules are the way they are.
|
|
103
103
|
|
|
104
|
-
|
|
105
|
-
flowchart LR
|
|
106
|
-
S["⚙️ /l-init"] --> I
|
|
107
|
-
subgraph W["🛠 Work flow"]
|
|
108
|
-
I["💡 /l-idea"] --> P["📋 /l-plan"] --> D["📐 /l-design"] --> T["✅ /l-task"] --> B["🔨 /l-build"]
|
|
109
|
-
end
|
|
110
|
-
P & D & B -.unfamiliar tech.-> L["🧭 /l-learn"]
|
|
111
|
-
B -->|merge when done| C["📘 3. Current state"]
|
|
112
|
-
W & L --> R["📊 /l-report"]
|
|
113
|
-
```
|
|
104
|
+
<img src="https://raw.githubusercontent.com/Jungjihyuk/LanternSpec/main/assets/Workflow.png" alt="LanternSpec workflow — /l-init once, then /l-idea → /l-plan → /l-design → /l-task → /l-build for each work, merged into the current state when done; when unfamiliar tech comes up /l-learn compares it with the knowledge base and records debt cards in the project; /l-report any time." width="100%">
|
|
114
105
|
|
|
115
106
|
| Skill | What it does | What it leaves |
|
|
116
107
|
|---|---|---|
|
|
117
108
|
| `/l-init` | sets up the document structure and design principles from the questions the earlier answers call for (new or existing · team size · project kind · server · knowledge base · design tool · technology choice and so on), and picks the branch flow | `lantern.yaml`, `docs/`, project definition, MOC, design principles |
|
|
118
|
-
| `/l-idea` | records a thought from the conversation, as said and as summarised | `1. Ideas/IDEA-001 …` |
|
|
109
|
+
| `/l-idea` | records a thought from the conversation, as said and as summarised — each kind (feature · improvement · bug · experiment · tech review) has its own template, with the outcome filled in afterwards | `1. Ideas/IDEA-001 …` |
|
|
119
110
|
| `/l-plan` | what and why — a work folder and acceptance criteria | `2. Work/W-001 …/Plan.md` |
|
|
120
111
|
| `/l-design` | how — only the structure, screens and data (DBML) that change, wireframes, behind an approval gate | `Design.md`, `Screens/`, ADR |
|
|
121
112
|
| `/l-task` | an ordered task list (size 15m · 1h · 4h · 8h · acceptance criteria · dependencies · spike tasks) | `Tasks.md` |
|
|
@@ -131,6 +122,7 @@ flowchart LR
|
|
|
131
122
|
| `/l-ref` | brings in company rules, glossaries and domain knowledge, indexes them by section and gets each section's use approved | the index, company rules in `AGENTS.md`, `Glossary.md` |
|
|
132
123
|
| `/l-domain` | when domain rules matter, finds the matching section in the index and reads just that section word for word | (the plan's "Domain Knowledge Used") |
|
|
133
124
|
| `/l-pr` | writes the title and body for the direction that fits the branch flow, and opens the PR once confirmed (never merges) | — |
|
|
125
|
+
| `/l-migrate` | brings another tool's (OpenSpec's) changes over: finished ones as archived works, ones in progress as works, notes as ideas (originals kept, approved after a preview) | `2. Work/` · `1. Ideas/` |
|
|
134
126
|
| `/l-parallel` | before starting several works at once, checks what they must decide together and their order, records the decisions as ADRs, then opens a worktree per work | ADR |
|
|
135
127
|
| `/l-finish` | when parallel works are done, gathers person checks in the base folder, merges them one at a time, then updates the current state, archives and reports once | current state, `Archive/` |
|
|
136
128
|
|
|
@@ -272,6 +264,8 @@ Anything you don't understand yet is kept as a debt card, and every time you ask
|
|
|
272
264
|
|
|
273
265
|
Every knowledge base supports the same four actions: search · read · propose · write. The CLI (`lantern knowledge …`) and the MCP server (`lantern mcp`) use the same functions.
|
|
274
266
|
|
|
267
|
+
Folders of the knowledge base the AI must not open go in `knowledge.deny` in `lantern.yaml` (or list the only open ones in `knowledge.allow`). lantern neither searches nor reads closed folders. To also stop the AI tool from opening them directly, start it with `lantern guard -- claude`: the tool runs inside the operating system's sandbox (macOS, and Linux with bubblewrap; works with `claude` · `codex` · `agy`; on macOS the tool's own sandbox has to be off, and lantern turns Codex's off itself).
|
|
268
|
+
|
|
275
269
|
There are three kinds of debt.
|
|
276
270
|
|
|
277
271
|
| Kind | Meaning |
|
|
@@ -312,7 +306,7 @@ Import mockups with `lantern screen import`; `lantern screen compare` finds wher
|
|
|
312
306
|
## CLI at a glance
|
|
313
307
|
|
|
314
308
|
```text
|
|
315
|
-
setup install [--language] [--tools] [--mcp] [--ci|--no-ci] [--pr-template] [--commit-template] · upgrade [--apply] · doctor · build-mode suggest
|
|
309
|
+
setup install [--language] [--tools] [--mcp] [--ci|--no-ci] [--pr-template] [--commit-template] · upgrade [--apply] · doctor · build-mode suggest · guard -- <tool>
|
|
316
310
|
profile profile show|docs|write|set · principles show|detect · parts [add|ignore] · enums list|rename · sections list|rename|off|on
|
|
317
311
|
documents scaffold init [--plan] | work | doc | idea | adr | meeting | custom · new-id · map · meta get|set
|
|
318
312
|
checks check [--changed] [--epic W-012] · check-pr · lint [--ci] · check-dbml · dbml render|from-sql|diff
|
|
@@ -320,7 +314,7 @@ work task next [--all]|start|done|ac|list|estimate · task add [--parallel
|
|
|
320
314
|
work branch|start|list|overlap|finish|archive|stage|flow · design approve · unit-log add · idea find|status
|
|
321
315
|
learning knowledge search|read|propose|write|areas · debt find|new|ask|resolve|promote|practice|known|status|list · mcp
|
|
322
316
|
reports report [--views] [--summary] · status · resume [--session] [--more] · scan [--tests] [--ci] · sync adopt · eval · obsidian plugins
|
|
323
|
-
templates template list|show|lint|level|bump|outdated|diff|usage|new|migrate · legacy adopt|todos
|
|
317
|
+
templates template list|show|lint|level|bump|outdated|diff|usage|new|migrate · legacy adopt [--apply]|todos · migrate openspec [--apply]
|
|
324
318
|
references ref list|check|index|read · tag|exclude|rules · terms|term|glossary|candidate · domain|describe|attach · convert [--apply]|preview
|
|
325
319
|
git hooks install|uninstall|status · docs-mode local|shared
|
|
326
320
|
wrap-up close <skill>
|
|
@@ -86,21 +86,12 @@ Then call `/l-init` inside your AI tool (`$l-init` in Codex).
|
|
|
86
86
|
|
|
87
87
|
What the concepts in this document mean and where they are used is gathered in [Concepts](https://github.com/Jungjihyuk/LanternSpec/blob/main/CONCEPTS.md). To change LanternSpec itself, start with the [design rationale](https://github.com/Jungjihyuk/LanternSpec/blob/main/RATIONALE.md), which records why the flow, folders and rules are the way they are.
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
flowchart LR
|
|
91
|
-
S["⚙️ /l-init"] --> I
|
|
92
|
-
subgraph W["🛠 Work flow"]
|
|
93
|
-
I["💡 /l-idea"] --> P["📋 /l-plan"] --> D["📐 /l-design"] --> T["✅ /l-task"] --> B["🔨 /l-build"]
|
|
94
|
-
end
|
|
95
|
-
P & D & B -.unfamiliar tech.-> L["🧭 /l-learn"]
|
|
96
|
-
B -->|merge when done| C["📘 3. Current state"]
|
|
97
|
-
W & L --> R["📊 /l-report"]
|
|
98
|
-
```
|
|
89
|
+
<img src="https://raw.githubusercontent.com/Jungjihyuk/LanternSpec/main/assets/Workflow.png" alt="LanternSpec workflow — /l-init once, then /l-idea → /l-plan → /l-design → /l-task → /l-build for each work, merged into the current state when done; when unfamiliar tech comes up /l-learn compares it with the knowledge base and records debt cards in the project; /l-report any time." width="100%">
|
|
99
90
|
|
|
100
91
|
| Skill | What it does | What it leaves |
|
|
101
92
|
|---|---|---|
|
|
102
93
|
| `/l-init` | sets up the document structure and design principles from the questions the earlier answers call for (new or existing · team size · project kind · server · knowledge base · design tool · technology choice and so on), and picks the branch flow | `lantern.yaml`, `docs/`, project definition, MOC, design principles |
|
|
103
|
-
| `/l-idea` | records a thought from the conversation, as said and as summarised | `1. Ideas/IDEA-001 …` |
|
|
94
|
+
| `/l-idea` | records a thought from the conversation, as said and as summarised — each kind (feature · improvement · bug · experiment · tech review) has its own template, with the outcome filled in afterwards | `1. Ideas/IDEA-001 …` |
|
|
104
95
|
| `/l-plan` | what and why — a work folder and acceptance criteria | `2. Work/W-001 …/Plan.md` |
|
|
105
96
|
| `/l-design` | how — only the structure, screens and data (DBML) that change, wireframes, behind an approval gate | `Design.md`, `Screens/`, ADR |
|
|
106
97
|
| `/l-task` | an ordered task list (size 15m · 1h · 4h · 8h · acceptance criteria · dependencies · spike tasks) | `Tasks.md` |
|
|
@@ -116,6 +107,7 @@ flowchart LR
|
|
|
116
107
|
| `/l-ref` | brings in company rules, glossaries and domain knowledge, indexes them by section and gets each section's use approved | the index, company rules in `AGENTS.md`, `Glossary.md` |
|
|
117
108
|
| `/l-domain` | when domain rules matter, finds the matching section in the index and reads just that section word for word | (the plan's "Domain Knowledge Used") |
|
|
118
109
|
| `/l-pr` | writes the title and body for the direction that fits the branch flow, and opens the PR once confirmed (never merges) | — |
|
|
110
|
+
| `/l-migrate` | brings another tool's (OpenSpec's) changes over: finished ones as archived works, ones in progress as works, notes as ideas (originals kept, approved after a preview) | `2. Work/` · `1. Ideas/` |
|
|
119
111
|
| `/l-parallel` | before starting several works at once, checks what they must decide together and their order, records the decisions as ADRs, then opens a worktree per work | ADR |
|
|
120
112
|
| `/l-finish` | when parallel works are done, gathers person checks in the base folder, merges them one at a time, then updates the current state, archives and reports once | current state, `Archive/` |
|
|
121
113
|
|
|
@@ -257,6 +249,8 @@ Anything you don't understand yet is kept as a debt card, and every time you ask
|
|
|
257
249
|
|
|
258
250
|
Every knowledge base supports the same four actions: search · read · propose · write. The CLI (`lantern knowledge …`) and the MCP server (`lantern mcp`) use the same functions.
|
|
259
251
|
|
|
252
|
+
Folders of the knowledge base the AI must not open go in `knowledge.deny` in `lantern.yaml` (or list the only open ones in `knowledge.allow`). lantern neither searches nor reads closed folders. To also stop the AI tool from opening them directly, start it with `lantern guard -- claude`: the tool runs inside the operating system's sandbox (macOS, and Linux with bubblewrap; works with `claude` · `codex` · `agy`; on macOS the tool's own sandbox has to be off, and lantern turns Codex's off itself).
|
|
253
|
+
|
|
260
254
|
There are three kinds of debt.
|
|
261
255
|
|
|
262
256
|
| Kind | Meaning |
|
|
@@ -297,7 +291,7 @@ Import mockups with `lantern screen import`; `lantern screen compare` finds wher
|
|
|
297
291
|
## CLI at a glance
|
|
298
292
|
|
|
299
293
|
```text
|
|
300
|
-
setup install [--language] [--tools] [--mcp] [--ci|--no-ci] [--pr-template] [--commit-template] · upgrade [--apply] · doctor · build-mode suggest
|
|
294
|
+
setup install [--language] [--tools] [--mcp] [--ci|--no-ci] [--pr-template] [--commit-template] · upgrade [--apply] · doctor · build-mode suggest · guard -- <tool>
|
|
301
295
|
profile profile show|docs|write|set · principles show|detect · parts [add|ignore] · enums list|rename · sections list|rename|off|on
|
|
302
296
|
documents scaffold init [--plan] | work | doc | idea | adr | meeting | custom · new-id · map · meta get|set
|
|
303
297
|
checks check [--changed] [--epic W-012] · check-pr · lint [--ci] · check-dbml · dbml render|from-sql|diff
|
|
@@ -305,7 +299,7 @@ work task next [--all]|start|done|ac|list|estimate · task add [--parallel
|
|
|
305
299
|
work branch|start|list|overlap|finish|archive|stage|flow · design approve · unit-log add · idea find|status
|
|
306
300
|
learning knowledge search|read|propose|write|areas · debt find|new|ask|resolve|promote|practice|known|status|list · mcp
|
|
307
301
|
reports report [--views] [--summary] · status · resume [--session] [--more] · scan [--tests] [--ci] · sync adopt · eval · obsidian plugins
|
|
308
|
-
templates template list|show|lint|level|bump|outdated|diff|usage|new|migrate · legacy adopt|todos
|
|
302
|
+
templates template list|show|lint|level|bump|outdated|diff|usage|new|migrate · legacy adopt [--apply]|todos · migrate openspec [--apply]
|
|
309
303
|
references ref list|check|index|read · tag|exclude|rules · terms|term|glossary|candidate · domain|describe|attach · convert [--apply]|preview
|
|
310
304
|
git hooks install|uninstall|status · docs-mode local|shared
|
|
311
305
|
wrap-up close <skill>
|
|
@@ -21,6 +21,7 @@ from ..core import frontmatter, templating
|
|
|
21
21
|
from ..core.links import Resolver, iter_links
|
|
22
22
|
from ..core.messages import msg
|
|
23
23
|
from ..core.project import Project, git_out, nfc, read
|
|
24
|
+
from ..core.sections import outside_guides
|
|
24
25
|
from ..core.taskfile import parse_criteria, parse_tasks, size_role
|
|
25
26
|
|
|
26
27
|
COMMON_FIELDS = ["id", "type", "status", "created", "updated", "links", "template", "template_version"]
|
|
@@ -520,7 +521,7 @@ def check_file(project: Project, path: Path, text: str, ctx: _Ctx) -> list[Findi
|
|
|
520
521
|
|
|
521
522
|
# unknowns
|
|
522
523
|
unknown = project.names.marker("unknown")
|
|
523
|
-
unknown_lines = [i for i, l in
|
|
524
|
+
unknown_lines = [i for i, l in outside_guides(text) if unknown in l and "`" + unknown not in l]
|
|
524
525
|
if unknown_lines and not generated:
|
|
525
526
|
out.append(
|
|
526
527
|
Finding(
|
|
@@ -638,6 +639,12 @@ def check_file(project: Project, path: Path, text: str, ctx: _Ctx) -> list[Findi
|
|
|
638
639
|
if doc_type == "tasks":
|
|
639
640
|
out += _check_tasks(project, path, text, rel)
|
|
640
641
|
|
|
642
|
+
# AI retro rows: the weakness and the remedy come from the lists
|
|
643
|
+
if path.parent == project.folder("retro"):
|
|
644
|
+
from ..report.retro import problems
|
|
645
|
+
|
|
646
|
+
out += [Finding("warn", rel, code, message, line) for line, code, message in problems(project, text)]
|
|
647
|
+
|
|
641
648
|
# length
|
|
642
649
|
max_lines = int(project.profile.get("check.max_lines") or 300)
|
|
643
650
|
n_lines = text.count("\n") + 1
|
|
@@ -672,6 +679,8 @@ def _check_tasks(project: Project, path: Path, text: str, rel: str) -> list[Find
|
|
|
672
679
|
plan = project.doc_path(path.parent, "plan")
|
|
673
680
|
acs = {c.id for c in parse_criteria(read(plan))} if plan.exists() else set()
|
|
674
681
|
team = project.profile.team
|
|
682
|
+
# a finished work is not planned any more: sizes and the task behind each criterion are asked only while it runs
|
|
683
|
+
finished = frontmatter.parse(text).meta.get("status") == project.enums.value("work_status", "done")
|
|
675
684
|
for t in tasks:
|
|
676
685
|
line = t.line_no + 1
|
|
677
686
|
if ids[t.id] > 1:
|
|
@@ -683,7 +692,7 @@ def _check_tasks(project: Project, path: Path, text: str, rel: str) -> list[Find
|
|
|
683
692
|
"warn", rel, "task-size", msg("{id} size is one of {sizes} (now '{size}')", id=t.id, sizes=sizes, size=t.size), line
|
|
684
693
|
)
|
|
685
694
|
)
|
|
686
|
-
if not t.size:
|
|
695
|
+
if not t.size and not t.done and not finished:
|
|
687
696
|
out.append(
|
|
688
697
|
Finding(
|
|
689
698
|
"warn",
|
|
@@ -716,7 +725,7 @@ def _check_tasks(project: Project, path: Path, text: str, rel: str) -> list[Find
|
|
|
716
725
|
out.append(Finding("info", rel, "task-owner", msg("{id} has no {owner} [{owner}:: name]", id=t.id, owner=owner), line))
|
|
717
726
|
covered = {ac for t in tasks for ac in t.criteria}
|
|
718
727
|
real_tasks = [t for t in tasks if "{{" not in t.title]
|
|
719
|
-
if real_tasks:
|
|
728
|
+
if real_tasks and not finished:
|
|
720
729
|
for ac in sorted(acs - covered, key=lambda x: int(x.split("-")[1])):
|
|
721
730
|
out.append(
|
|
722
731
|
Finding(
|
|
@@ -728,7 +737,7 @@ def _check_tasks(project: Project, path: Path, text: str, rel: str) -> list[Find
|
|
|
728
737
|
f"lantern task add … --ac {ac}",
|
|
729
738
|
)
|
|
730
739
|
)
|
|
731
|
-
if len(tasks) > 10:
|
|
740
|
+
if len(tasks) > 10 and not finished:
|
|
732
741
|
out.append(Finding("info", rel, "task-many", msg("{count} tasks — consider splitting the work", count=len(tasks))))
|
|
733
742
|
# cycles
|
|
734
743
|
graph: dict[str, list[str]] = {}
|
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
"""Existing documents of a brownfield project: originals stay in `5. 기존 문서/`; the script builds the map and TODOs.
|
|
2
|
+
|
|
3
|
+
Responsibilities:
|
|
4
|
+
- plan which items of the documents root move to the legacy folder and which stay, with the reason (nothing changes)
|
|
5
|
+
- apply the plan: `git mv` (history continues), one commit
|
|
6
|
+
- keep the legacy map's rows in step and collect TODO-like lines
|
|
7
|
+
|
|
8
|
+
Not here:
|
|
9
|
+
- deciding where each document's content goes — the person does that in the map (/l-init)
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
import re
|
|
15
|
+
from dataclasses import dataclass, field
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
|
|
18
|
+
from ..core import frontmatter, sections
|
|
19
|
+
from ..core.messages import msg
|
|
20
|
+
from ..core.project import Project, git, git_out, move_path, nfc, read, write
|
|
21
|
+
|
|
22
|
+
TODO_RE = re.compile(
|
|
23
|
+
r"(TODO|FIXME|later|someday|to do|idea|needs? improv|나중에|추후|언젠가|해야 할|할 것|아이디어|개선 필요|- \[ \])", re.I
|
|
24
|
+
)
|
|
25
|
+
PAGES_FILES = ("index.html", "CNAME", "_config.yml") # a documents root that GitHub Pages serves
|
|
26
|
+
PROSE = {".md", ".markdown", ".mdx", ".txt", ".rst"} # a path written here is a link to fix, not a path a program reads
|
|
27
|
+
_TO_DOCUMENT = re.compile(r"\.(?:md|markdown|mdx)\b") # … and so is a path that leads to a document, wherever it is written
|
|
28
|
+
SKIP_HOOKS = {"LANTERN_SKIP_HOOKS": "1"} # our own git hooks would check the commit we make
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class LegacyError(RuntimeError):
|
|
32
|
+
"""The existing documents can't be moved now; the message says why and what to do.
|
|
33
|
+
|
|
34
|
+
Example:
|
|
35
|
+
>>> str(LegacyError("변경 사항이 있습니다"))
|
|
36
|
+
'변경 사항이 있습니다'
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@dataclass
|
|
41
|
+
class AdoptItem:
|
|
42
|
+
"""One file or folder of the documents root, and what adopt does with it.
|
|
43
|
+
|
|
44
|
+
Attributes:
|
|
45
|
+
path: The file or folder.
|
|
46
|
+
move: True when it goes to the legacy folder; False when it stays.
|
|
47
|
+
reason: Why, for the person.
|
|
48
|
+
|
|
49
|
+
Example:
|
|
50
|
+
>>> AdoptItem(Path("docs/updates"), False, "Scripts/release.sh가 이 경로를 씁니다").move
|
|
51
|
+
False
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
path: Path
|
|
55
|
+
move: bool
|
|
56
|
+
reason: str
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
@dataclass
|
|
60
|
+
class AdoptPlan:
|
|
61
|
+
"""What `lantern legacy adopt` would do.
|
|
62
|
+
|
|
63
|
+
Attributes:
|
|
64
|
+
items: Every item looked at, in name order.
|
|
65
|
+
links: (file outside the documents root, moved path it mentions) — links a person fixes after the move.
|
|
66
|
+
notes: Warnings about the documents root as a whole (e.g. it is a GitHub Pages site).
|
|
67
|
+
|
|
68
|
+
Example:
|
|
69
|
+
>>> AdoptPlan([AdoptItem(Path("docs/old"), True, "문서"), AdoptItem(Path("docs/updates"), False, "…")]).moves
|
|
70
|
+
[PosixPath('docs/old')]
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
items: list[AdoptItem] = field(default_factory=list)
|
|
74
|
+
links: list[tuple[str, str]] = field(default_factory=list)
|
|
75
|
+
notes: list[str] = field(default_factory=list)
|
|
76
|
+
|
|
77
|
+
@property
|
|
78
|
+
def moves(self) -> list[Path]:
|
|
79
|
+
"""The items that move."""
|
|
80
|
+
return [i.path for i in self.items if i.move]
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def _our_names(project: Project) -> set[str]:
|
|
84
|
+
"""Names LanternSpec uses at the top of the documents root."""
|
|
85
|
+
return {nfc(v.split("/")[0]) for v in project.names.folders().values()} | {nfc(project.names.file("moc"))}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def _made_by_lantern(project: Project, item: Path) -> bool:
|
|
89
|
+
"""Tell ours from a same-named item by a mark, not the name: the MOC by its frontmatter, folders by the installed enums.yaml."""
|
|
90
|
+
if nfc(item.name) == nfc(project.names.file("moc")):
|
|
91
|
+
try:
|
|
92
|
+
meta = frontmatter.parse(read(item)).meta
|
|
93
|
+
except (OSError, UnicodeDecodeError):
|
|
94
|
+
return False
|
|
95
|
+
return meta.get("type") == "moc" and bool(meta.get("template"))
|
|
96
|
+
return project.enums_file.exists()
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def _users(project: Project, rel: str) -> tuple[list[str], list[str]]:
|
|
100
|
+
"""Tracked files outside the documents root that spell this path: (programs that read it, places that link a document)."""
|
|
101
|
+
outside = f":(exclude){project.rel(project.docs)}"
|
|
102
|
+
spelled = re.compile(rf"(?<![\w-]){re.escape(rel)}(?![\w-])(.*)")
|
|
103
|
+
programs, links = [], []
|
|
104
|
+
for name in git_out(["grep", "-l", "-I", "-F", "-e", rel, "--", ".", outside], project.root).splitlines():
|
|
105
|
+
try:
|
|
106
|
+
text = nfc(read(project.root / name))
|
|
107
|
+
except (OSError, UnicodeDecodeError):
|
|
108
|
+
continue
|
|
109
|
+
rests = [m.group(1) for line in text.split("\n") if (m := spelled.search(line))]
|
|
110
|
+
if not rests:
|
|
111
|
+
continue
|
|
112
|
+
linked = Path(name).suffix.lower() in PROSE or all(_TO_DOCUMENT.search(rest) for rest in rests)
|
|
113
|
+
(links if linked else programs).append(name)
|
|
114
|
+
return programs, links
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def adopt_plan(project: Project, source: Path | None = None) -> AdoptPlan:
|
|
118
|
+
"""Decide, item by item, what moves into `docs/5. 기존 문서/` and what stays. Changes nothing.
|
|
119
|
+
|
|
120
|
+
An item stays when it is LanternSpec's own (told by a mark, not by its name), when lantern.yaml
|
|
121
|
+
`docs.keep` lists it, when a tracked script · setting · code file outside the documents root
|
|
122
|
+
reads its path (a path that leads to a document is a link, not a use), or when it is a GitHub
|
|
123
|
+
Pages file. Everything else moves.
|
|
124
|
+
|
|
125
|
+
Args:
|
|
126
|
+
project: The project.
|
|
127
|
+
source: One file or folder to move instead (it may be outside the documents root).
|
|
128
|
+
|
|
129
|
+
Returns:
|
|
130
|
+
The items with their reasons, the outside links that would break, and warnings.
|
|
131
|
+
|
|
132
|
+
Raises:
|
|
133
|
+
FileNotFoundError: source does not exist.
|
|
134
|
+
|
|
135
|
+
Example:
|
|
136
|
+
>>> [(i.path.name, i.move) for i in adopt_plan(project).items] # doctest: +SKIP
|
|
137
|
+
[('1. 기획', True), ('updates', False)]
|
|
138
|
+
"""
|
|
139
|
+
legacy = project.folder("legacy")
|
|
140
|
+
if source is not None:
|
|
141
|
+
src = source if source.is_absolute() else project.root / source
|
|
142
|
+
if not src.exists():
|
|
143
|
+
raise FileNotFoundError(msg("Not found: {source}", source=source))
|
|
144
|
+
return AdoptPlan([_unless_taken(project, AdoptItem(src, True, msg("chosen with --from")))])
|
|
145
|
+
result = AdoptPlan()
|
|
146
|
+
if not project.docs.exists():
|
|
147
|
+
return result
|
|
148
|
+
ours = _our_names(project)
|
|
149
|
+
keep = {nfc(k).strip("/").split("/")[0] for k in project.profile.get("docs.keep") or []}
|
|
150
|
+
docs_rel = project.rel(project.docs)
|
|
151
|
+
for item in sorted(project.docs.iterdir()):
|
|
152
|
+
name = nfc(item.name)
|
|
153
|
+
if name.startswith(".") or item.resolve() == legacy.resolve():
|
|
154
|
+
continue
|
|
155
|
+
shown = f"{docs_rel}/{name}"
|
|
156
|
+
if name in keep:
|
|
157
|
+
result.items.append(AdoptItem(item, False, msg("listed in lantern.yaml docs.keep")))
|
|
158
|
+
elif name in ours:
|
|
159
|
+
if not _made_by_lantern(project, item): # scaffold init makes ours at this path again, so links to it still work
|
|
160
|
+
result.items.append(_unless_taken(project, AdoptItem(item, True, msg("same name, but not made by LanternSpec"))))
|
|
161
|
+
elif name in PAGES_FILES:
|
|
162
|
+
result.items.append(AdoptItem(item, False, msg("GitHub Pages file")))
|
|
163
|
+
else:
|
|
164
|
+
programs, links = _users(project, shown)
|
|
165
|
+
if programs:
|
|
166
|
+
more = msg(" (+{count} more)", count=len(programs) - 1) if len(programs) > 1 else ""
|
|
167
|
+
result.items.append(AdoptItem(item, False, msg("{file} uses this path", file=programs[0]) + more))
|
|
168
|
+
continue
|
|
169
|
+
moved = _unless_taken(project, AdoptItem(item, True, msg("documents")))
|
|
170
|
+
result.items.append(moved)
|
|
171
|
+
if moved.move:
|
|
172
|
+
result.links += [(u, shown + ("/" if item.is_dir() else "")) for u in links]
|
|
173
|
+
cwd = project.docs_git_cwd()
|
|
174
|
+
if git(["rev-parse", "--git-dir"], cwd).returncode == 0:
|
|
175
|
+
untracked = [p for p in result.moves if not git_out(["ls-files", "--", str(p)], cwd)]
|
|
176
|
+
if untracked:
|
|
177
|
+
result.notes.append(
|
|
178
|
+
msg(
|
|
179
|
+
"⚠ {count} of these are not tracked by git (ignored or never added) — they move as plain files, "
|
|
180
|
+
"with no commit for git revert to undo",
|
|
181
|
+
count=len(untracked),
|
|
182
|
+
)
|
|
183
|
+
)
|
|
184
|
+
pages = [i.path.name for i in result.items if i.path.name in PAGES_FILES]
|
|
185
|
+
if pages and result.moves:
|
|
186
|
+
result.notes.append(
|
|
187
|
+
msg(
|
|
188
|
+
"⚠ {root}/ looks like a GitHub Pages site ({items}) — a page that moves gets a new address. "
|
|
189
|
+
"List what must stay in lantern.yaml docs.keep",
|
|
190
|
+
root=docs_rel,
|
|
191
|
+
items=" · ".join(pages),
|
|
192
|
+
)
|
|
193
|
+
)
|
|
194
|
+
return result
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
def _unless_taken(project: Project, item: AdoptItem) -> AdoptItem:
|
|
198
|
+
"""A move whose place in the legacy folder is taken stays, for a person to merge."""
|
|
199
|
+
dest = project.folder("legacy") / item.path.name
|
|
200
|
+
if dest.exists():
|
|
201
|
+
return AdoptItem(item.path, False, msg("{rel} already exists — merge them by hand", rel=project.rel(dest)))
|
|
202
|
+
return item
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
def describe(project: Project, result: AdoptPlan) -> list[str]:
|
|
206
|
+
"""Write a plan for the user.
|
|
207
|
+
|
|
208
|
+
Args:
|
|
209
|
+
project: The project.
|
|
210
|
+
result: The plan.
|
|
211
|
+
|
|
212
|
+
Returns:
|
|
213
|
+
One line per item (move · keep, name, reason), then warnings and the outside links that would break.
|
|
214
|
+
|
|
215
|
+
Example:
|
|
216
|
+
>>> describe(project, adopt_plan(project)) # doctest: +SKIP
|
|
217
|
+
['옮김 1. 기획/ (문서)', '남김 updates/ (Scripts/release.sh가 이 경로를 씁니다)']
|
|
218
|
+
"""
|
|
219
|
+
out = []
|
|
220
|
+
for item in result.items:
|
|
221
|
+
name = nfc(item.path.name) + ("/" if item.path.is_dir() else "")
|
|
222
|
+
out.append(f"{msg('move') if item.move else msg('keep')} {name} ({item.reason})")
|
|
223
|
+
out += result.notes
|
|
224
|
+
if result.links:
|
|
225
|
+
out.append(
|
|
226
|
+
msg("🔗 {count} places outside the documents point at paths that move — fix them after the move:", count=len(result.links))
|
|
227
|
+
)
|
|
228
|
+
out += [f" {source} → {target}" for source, target in result.links[:20]]
|
|
229
|
+
if len(result.links) > 20:
|
|
230
|
+
out.append(msg(" … and {count} more", count=len(result.links) - 20))
|
|
231
|
+
return out
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
def adopt(project: Project, result: AdoptPlan) -> list[str]:
|
|
235
|
+
"""Carry out a plan: move with `git mv` (history continues), add the moved files to the map, then commit once.
|
|
236
|
+
|
|
237
|
+
The documents' git must have nothing staged and no changes in what moves or in the documents
|
|
238
|
+
root, so the commit holds only this move and one revert undoes it.
|
|
239
|
+
|
|
240
|
+
Args:
|
|
241
|
+
project: The project.
|
|
242
|
+
result: The plan from adopt_plan().
|
|
243
|
+
|
|
244
|
+
Returns:
|
|
245
|
+
What was done.
|
|
246
|
+
|
|
247
|
+
Raises:
|
|
248
|
+
LegacyError: There are uncommitted changes, or nothing has ever been committed.
|
|
249
|
+
|
|
250
|
+
Example:
|
|
251
|
+
>>> adopt(project, adopt_plan(project)) # doctest: +SKIP
|
|
252
|
+
['✔ 3개를 docs/5. 기존 문서/로 옮겼습니다', ' 커밋 하나 3f2a1c0 — 되돌리려면 git revert 3f2a1c0']
|
|
253
|
+
"""
|
|
254
|
+
moves = result.moves
|
|
255
|
+
if not moves:
|
|
256
|
+
return []
|
|
257
|
+
legacy = project.folder("legacy")
|
|
258
|
+
cwd = project.docs_git_cwd()
|
|
259
|
+
scope = [str(project.docs), *(str(p) for p in moves if project.docs.resolve() not in p.resolve().parents)]
|
|
260
|
+
in_git = git(["rev-parse", "--git-dir"], cwd).returncode == 0
|
|
261
|
+
if in_git:
|
|
262
|
+
if git(["rev-parse", "--verify", "-q", "HEAD"], cwd).returncode != 0:
|
|
263
|
+
raise LegacyError(msg("Nothing has been committed yet — commit once, then run lantern legacy adopt --apply again"))
|
|
264
|
+
if git_out(["diff", "--cached", "--name-only"], cwd) or git_out(["status", "--porcelain", "--", *scope], cwd):
|
|
265
|
+
raise LegacyError(msg("Commit or stash the changes in the documents first, then run lantern legacy adopt --apply again"))
|
|
266
|
+
for src in moves:
|
|
267
|
+
move_path(project, src, legacy / src.name)
|
|
268
|
+
legacy.mkdir(parents=True, exist_ok=True)
|
|
269
|
+
legacy_map = add_map_rows(project)
|
|
270
|
+
out = [msg("✔ Moved {count} items to {rel}/", count=len(moves), rel=project.rel(legacy))]
|
|
271
|
+
if in_git:
|
|
272
|
+
if legacy_map: # git mv staged the moves; only the map's new rows are added, never files git was told to ignore
|
|
273
|
+
git(["add", "--", str(legacy_map)], cwd)
|
|
274
|
+
if git(["diff", "--cached", "--quiet"], cwd).returncode == 0: # git tracks none of it: nothing to commit
|
|
275
|
+
return out
|
|
276
|
+
r = git(["commit", "-q", "-m", msg("docs: move existing documents to the legacy folder [lantern]")], cwd, env=SKIP_HOOKS)
|
|
277
|
+
if r.returncode == 0:
|
|
278
|
+
out.append(msg(" one commit {sha} — git revert {sha} undoes it", sha=git_out(["rev-parse", "--short", "HEAD"], cwd)))
|
|
279
|
+
else:
|
|
280
|
+
out.append(msg("⚠ The move is staged but not committed — commit it yourself: {error}", error=r.stderr.strip()[:200]))
|
|
281
|
+
return out
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
def legacy_files(project: Project) -> list[Path]:
|
|
285
|
+
"""List the files kept in the legacy folder (the map itself and hidden files left out).
|
|
286
|
+
|
|
287
|
+
Args:
|
|
288
|
+
project: The project.
|
|
289
|
+
|
|
290
|
+
Returns:
|
|
291
|
+
The files, sorted; empty when there is no legacy folder.
|
|
292
|
+
|
|
293
|
+
Example:
|
|
294
|
+
>>> [p.name for p in legacy_files(project)] # doctest: +SKIP
|
|
295
|
+
['README.md', '설계 메모.md']
|
|
296
|
+
"""
|
|
297
|
+
legacy = project.folder("legacy")
|
|
298
|
+
if not legacy.exists():
|
|
299
|
+
return []
|
|
300
|
+
return sorted(
|
|
301
|
+
p
|
|
302
|
+
for p in legacy.rglob("*")
|
|
303
|
+
if p.is_file()
|
|
304
|
+
and nfc(p.name) != nfc(project.names.file("legacy_map"))
|
|
305
|
+
and not any(x.startswith(".") for x in p.relative_to(legacy).parts)
|
|
306
|
+
)
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
def map_rows(project: Project, files: list[Path]) -> str:
|
|
310
|
+
"""Build the map's table rows for legacy files, with blanks for the person to fill.
|
|
311
|
+
|
|
312
|
+
Args:
|
|
313
|
+
project: The project.
|
|
314
|
+
files: Legacy files.
|
|
315
|
+
|
|
316
|
+
Returns:
|
|
317
|
+
One row per file; a single blank row when there are none.
|
|
318
|
+
|
|
319
|
+
Example:
|
|
320
|
+
>>> map_rows(project, []).count("|") # doctest: +SKIP
|
|
321
|
+
6
|
|
322
|
+
"""
|
|
323
|
+
rows = []
|
|
324
|
+
for p in files:
|
|
325
|
+
rel = project.docs_rel(p)
|
|
326
|
+
target = rel[:-3] if rel.endswith(".md") else rel
|
|
327
|
+
rows.append(
|
|
328
|
+
msg(
|
|
329
|
+
"| [[{target}\\|{nfc}]] | {{{{What it says}}}} | {{{{Still true?}}}} | {{{{Absorb · Archive "
|
|
330
|
+
"· Move}}}} | {{{{New place}}}} |",
|
|
331
|
+
target=target,
|
|
332
|
+
nfc=nfc(p.stem),
|
|
333
|
+
)
|
|
334
|
+
)
|
|
335
|
+
return "\n".join(rows) or msg(
|
|
336
|
+
"| {{{{Document}}}} | {{{{What it says}}}} | {{{{Still true?}}}} | {{{{Absorb · Archive · Move}}}} | {{{{New place}}}} |"
|
|
337
|
+
)
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
def add_map_rows(project: Project) -> Path | None:
|
|
341
|
+
"""Add a row to the legacy map for every legacy file it does not mention yet.
|
|
342
|
+
|
|
343
|
+
Args:
|
|
344
|
+
project: The project.
|
|
345
|
+
|
|
346
|
+
Returns:
|
|
347
|
+
The map; None when there is no map.
|
|
348
|
+
|
|
349
|
+
Example:
|
|
350
|
+
>>> add_map_rows(project).name # doctest: +SKIP
|
|
351
|
+
'기존 문서 지도.md'
|
|
352
|
+
"""
|
|
353
|
+
n = project.names
|
|
354
|
+
legacy = project.folder("legacy")
|
|
355
|
+
m = legacy / n.file("legacy_map")
|
|
356
|
+
if not m.exists() or n.is_unused("legacy_docs"):
|
|
357
|
+
return None if not m.exists() else m
|
|
358
|
+
text = read(m)
|
|
359
|
+
# a folder the map links as a whole (one row for everything in it) covers its files
|
|
360
|
+
whole = [project.docs_rel(d) for d in legacy.iterdir() if d.is_dir() and f"[[{project.docs_rel(d)}\\|" in text]
|
|
361
|
+
missing = [
|
|
362
|
+
p
|
|
363
|
+
for p in legacy_files(project)
|
|
364
|
+
if project.docs_rel(p).rsplit(".", 1)[0] not in text and not any(project.docs_rel(p).startswith(w + "/") for w in whole)
|
|
365
|
+
]
|
|
366
|
+
if not missing:
|
|
367
|
+
return m
|
|
368
|
+
section = sections.find(text, n.titles("legacy_docs"))
|
|
369
|
+
if section is None: # the person removed or renamed the section: check asks about it
|
|
370
|
+
return m
|
|
371
|
+
lines = section.group(2).split("\n")
|
|
372
|
+
# drop the template's blank example row (every cell a {{blank}}) once real rows exist
|
|
373
|
+
lines = [l for l in lines if not _blank_row(l)]
|
|
374
|
+
last = max((i for i, l in enumerate(lines) if l.startswith("|")), default=-1)
|
|
375
|
+
lines[last + 1 : last + 1] = map_rows(project, missing).split("\n")
|
|
376
|
+
write(m, text[: section.start(2)] + "\n".join(lines) + text[section.end(2) :])
|
|
377
|
+
return m
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
def _blank_row(line: str) -> bool:
|
|
381
|
+
"""A table row whose every cell is a {{blank}}."""
|
|
382
|
+
cells = [c.strip() for c in line.strip().strip("|").split("|")] if line.startswith("|") else []
|
|
383
|
+
return bool(cells) and all(re.fullmatch(r"\{\{[^{}]+\}\}", c) for c in cells)
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
def todos(project: Project) -> list[dict[str, str]]:
|
|
387
|
+
"""Find TODO-like lines in legacy text documents (TODO, FIXME, "나중에", open check boxes …).
|
|
388
|
+
|
|
389
|
+
Args:
|
|
390
|
+
project: The project.
|
|
391
|
+
|
|
392
|
+
Returns:
|
|
393
|
+
file (from the docs root), line and text for each match.
|
|
394
|
+
|
|
395
|
+
Example:
|
|
396
|
+
>>> todos(project)[0]["text"] # doctest: +SKIP
|
|
397
|
+
'TODO: 로그인 실패 처리'
|
|
398
|
+
"""
|
|
399
|
+
out = []
|
|
400
|
+
for p in legacy_files(project):
|
|
401
|
+
if p.suffix.lower() not in (".md", ".txt", ".markdown"):
|
|
402
|
+
continue
|
|
403
|
+
for i, line in enumerate(read(p).split("\n"), start=1):
|
|
404
|
+
s = line.strip()
|
|
405
|
+
if s and TODO_RE.search(s) and not s.startswith("- [x]"):
|
|
406
|
+
out.append({"file": project.docs_rel(p), "line": str(i), "text": s[:160]})
|
|
407
|
+
return out
|