lanternspec 0.3.3__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.3/src/lanternspec.egg-info → lanternspec-0.4.0}/PKG-INFO +3 -2
- {lanternspec-0.3.3 → lanternspec-0.4.0}/README.md +2 -1
- {lanternspec-0.3.3 → lanternspec-0.4.0}/pyproject.toml +1 -1
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/check/check_docs.py +11 -3
- 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.3 → lanternspec-0.4.0}/src/lanternspec/check/templates.py +1 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/cli/check.py +32 -4
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/cli/report.py +56 -3
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/cli/work.py +206 -3
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/core/names.py +35 -1
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/core/profile.py +74 -4
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/core/taskfile.py +34 -4
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/learn/debt.py +30 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/report/build_mode.py +20 -3
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/report/evaluate.py +11 -6
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/report/obsidian.py +43 -2
- lanternspec-0.4.0/src/lanternspec/report/retro.py +581 -0
- lanternspec-0.4.0/src/lanternspec/resources/locales/en/agents/lantern-reviewer.md +27 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-build/SKILL.md +38 -5
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-design/SKILL.md +9 -3
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-finish/SKILL.md +1 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-init/SKILL.md +17 -4
- lanternspec-0.4.0/src/lanternspec/resources/locales/en/skills/l-migrate/SKILL.md +50 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-plan/SKILL.md +4 -0
- lanternspec-0.4.0/src/lanternspec/resources/locales/en/templates/AI Retro.md +27 -0
- lanternspec-0.4.0/src/lanternspec/resources/locales/en/templates/Design System.md +61 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Plan.md +5 -2
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Repository File Rules.md +60 -3
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Screens.md +4 -2
- {lanternspec-0.3.3 → 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.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-build/SKILL.md +38 -5
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-design/SKILL.md +9 -3
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-finish/SKILL.md +1 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-init/SKILL.md +17 -4
- lanternspec-0.4.0/src/lanternspec/resources/locales/ko/skills/l-migrate/SKILL.md +50 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-plan/SKILL.md +4 -0
- lanternspec-0.4.0/src/lanternspec/resources/locales/ko/templates/AI /355/232/214/352/263/240.md" +27 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates/_meta/enums.yaml +43 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//352/270/260/355/232/215.md +5 -2
- 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.3 → 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.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//355/231/224/353/251/264.md +4 -2
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/messages.yaml +207 -0
- {lanternspec-0.3.3 → 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.3 → lanternspec-0.4.0}/src/lanternspec/tools/agent_hooks.py +125 -4
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/tools/antigravity.py +18 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/tools/base.py +121 -1
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/tools/claude.py +125 -1
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/tools/codex.py +59 -1
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/tools/health.py +3 -2
- {lanternspec-0.3.3 → 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.3 → lanternspec-0.4.0}/src/lanternspec/tools/skills.py +1 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/work/branches.py +30 -3
- {lanternspec-0.3.3 → 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.3 → 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.3 → lanternspec-0.4.0}/src/lanternspec/work/scaffold.py +4 -1
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/work/stages.py +67 -4
- {lanternspec-0.3.3 → lanternspec-0.4.0/src/lanternspec.egg-info}/PKG-INFO +3 -2
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec.egg-info/SOURCES.txt +20 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_checks.py +3 -3
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_core.py +1 -1
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_install_and_aux.py +11 -11
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_layout.py +1 -0
- lanternspec-0.4.0/tests/test_legacy.py +138 -0
- lanternspec-0.4.0/tests/test_loop.py +415 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_names.py +1 -1
- lanternspec-0.4.0/tests/test_openspec.py +168 -0
- {lanternspec-0.3.3 → 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.3 → lanternspec-0.4.0}/tests/test_tool_health.py +1 -1
- lanternspec-0.4.0/tests/test_understood.py +181 -0
- lanternspec-0.3.3/src/lanternspec/check/legacy.py +0 -183
- lanternspec-0.3.3/src/lanternspec/tools/runlog.py +0 -183
- {lanternspec-0.3.3 → lanternspec-0.4.0}/LICENSE +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/setup.cfg +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/__init__.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/__main__.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/check/__init__.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/check/budget.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/check/doctor.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/check/githooks.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/check/layout.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/check/pr_check.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/cli/__init__.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/cli/color.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/cli/common.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/cli/core.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/cli/learn.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/cli/refs.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/cli/tools.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/core/__init__.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/core/enums.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/core/frontmatter.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/core/links.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/core/messages.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/core/meta.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/core/new_id.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/core/outline.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/core/principles.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/core/project.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/core/sections.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/core/state.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/core/templating.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/learn/__init__.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/learn/knowledge/__init__.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/learn/knowledge/access.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/learn/knowledge/drafts.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/learn/knowledge/mcp_server.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/learn/knowledge/notion.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/learn/knowledge/obsidian.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/refs/__init__.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/refs/convert.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/refs/domain.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/refs/index.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/refs/rules.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/refs/sources.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/refs/terms.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/report/__init__.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/report/doc_map.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/report/principles_doc.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/report/resume.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/report/scan.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/report/sections_doc.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/report/status.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/report/views.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/__init__.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/conventions/go.yaml +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/conventions/python.yaml +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/conventions/rust.yaml +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/conventions/swift.yaml +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/conventions/typescript.yaml +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/agents/AGENTS.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/git/gitmessage.txt +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/github/pull_request_template.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-adr/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-check/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-domain/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-idea/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-learn/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-map/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-parallel/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-pr/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-ref/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-ref/domain.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-ref/rules.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-ref/terms.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-report/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-resume/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-sync/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-task/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/skills/l-template/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/ADR.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/API.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Architecture.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Collaboration Rules.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Competency Card.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Data.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Debt Card.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Deployment.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Design.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Docs MOC.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Feature List.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Glossary.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Idea - Bug.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Idea - Experiment.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Idea - Feature.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Idea - Improvement.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Idea - Tech Review.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Idea.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Known Tech.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Legacy Map.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Log.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Meeting Notes.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Platform Integration.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Project Definition.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Server Operations.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Session Log.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Task Breakdown Rules.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Tasks.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Tech Selection Criteria.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/en/templates/Work Division Rules.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/agents/AGENTS.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/git/gitmessage.txt +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/github/pull_request_template.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-adr/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-check/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-domain/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-idea/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-learn/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-map/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-parallel/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-pr/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-ref/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-ref/domain.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-ref/rules.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-ref/terms.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-report/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-resume/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-sync/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-task/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/skills/l-template/SKILL.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates/ADR.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates/API.md +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//352/260/234/353/260/234/353/254/270/354/204/234 MOC.md" +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//352/270/260/353/212/245 /353/252/251/353/241/235.md" +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//352/270/260/353/241/235.md" +0 -0
- {lanternspec-0.3.3 → 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.3 → 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" +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//353/215/260/354/235/264/355/204/260.md" +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//353/260/260/355/217/254.md" +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//353/266/200/354/261/204 /354/271/264/353/223/234.md" +0 -0
- {lanternspec-0.3.3 → 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.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//354/204/244/352/263/204.md" +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//354/204/270/354/205/230 /352/270/260/353/241/235.md" +0 -0
- {lanternspec-0.3.3 → 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" +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//354/225/204/353/212/224 /352/270/260/354/210/240.md" +0 -0
- {lanternspec-0.3.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" +0 -0
- {lanternspec-0.3.3 → 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" +0 -0
- {lanternspec-0.3.3 → 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" +0 -0
- {lanternspec-0.3.3 → 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" +0 -0
- {lanternspec-0.3.3 → 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" +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//354/225/204/354/235/264/353/224/224/354/226/264.md" +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//354/227/255/353/237/211 /354/271/264/353/223/234.md" +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//354/232/251/354/226/264/354/247/221.md" +0 -0
- {lanternspec-0.3.3 → 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" +0 -0
- {lanternspec-0.3.3 → 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" +0 -0
- {lanternspec-0.3.3 → 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.3 → 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.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//355/225/240 /354/235/274.md" +0 -0
- {lanternspec-0.3.3 → 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.3 → lanternspec-0.4.0}/src/lanternspec/resources/locales/ko/templates//355/232/214/354/235/230/353/241/235.md" +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/obsidian/lantern-kanban/main.js +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/obsidian/lantern-kanban/manifest.json +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/obsidian/lantern-kanban/styles.css +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/obsidian/lantern-timeline/main.js +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/obsidian/lantern-timeline/manifest.json +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/obsidian/lantern-timeline/styles.css +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/resources/principles.yaml +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/tools/__init__.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/tools/close.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/tools/docs_mode.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/tools/guard.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/tools/parts.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/tools/rules.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/tools/sessions.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/work/__init__.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/work/dbml.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/work/ideas.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/work/progress.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/work/screen.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec/work/tasks.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec.egg-info/dependency_links.txt +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec.egg-info/entry_points.txt +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec.egg-info/requires.txt +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/src/lanternspec.egg-info/top_level.txt +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_budget.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_color.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_english.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_enums_single_source.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_git.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_guard.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_later_features.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_learning_line.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_messages.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_name_overlap.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_obsidian.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_part_delivery.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_parts.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_principles.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_principles_data.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_progress_parallel.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_release_script.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_resume.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_skill_commands.py +0 -0
- {lanternspec-0.3.3 → lanternspec-0.4.0}/tests/test_work_line.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
|
|
@@ -122,6 +122,7 @@ What the concepts in this document mean and where they are used is gathered in [
|
|
|
122
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` |
|
|
123
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") |
|
|
124
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/` |
|
|
125
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 |
|
|
126
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/` |
|
|
127
128
|
|
|
@@ -313,7 +314,7 @@ work task next [--all]|start|done|ac|list|estimate · task add [--parallel
|
|
|
313
314
|
work branch|start|list|overlap|finish|archive|stage|flow · design approve · unit-log add · idea find|status
|
|
314
315
|
learning knowledge search|read|propose|write|areas · debt find|new|ask|resolve|promote|practice|known|status|list · mcp
|
|
315
316
|
reports report [--views] [--summary] · status · resume [--session] [--more] · scan [--tests] [--ci] · sync adopt · eval · obsidian plugins
|
|
316
|
-
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]
|
|
317
318
|
references ref list|check|index|read · tag|exclude|rules · terms|term|glossary|candidate · domain|describe|attach · convert [--apply]|preview
|
|
318
319
|
git hooks install|uninstall|status · docs-mode local|shared
|
|
319
320
|
wrap-up close <skill>
|
|
@@ -107,6 +107,7 @@ What the concepts in this document mean and where they are used is gathered in [
|
|
|
107
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` |
|
|
108
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") |
|
|
109
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/` |
|
|
110
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 |
|
|
111
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/` |
|
|
112
113
|
|
|
@@ -298,7 +299,7 @@ work task next [--all]|start|done|ac|list|estimate · task add [--parallel
|
|
|
298
299
|
work branch|start|list|overlap|finish|archive|stage|flow · design approve · unit-log add · idea find|status
|
|
299
300
|
learning knowledge search|read|propose|write|areas · debt find|new|ask|resolve|promote|practice|known|status|list · mcp
|
|
300
301
|
reports report [--views] [--summary] · status · resume [--session] [--more] · scan [--tests] [--ci] · sync adopt · eval · obsidian plugins
|
|
301
|
-
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]
|
|
302
303
|
references ref list|check|index|read · tag|exclude|rules · terms|term|glossary|candidate · domain|describe|attach · convert [--apply]|preview
|
|
303
304
|
git hooks install|uninstall|status · docs-mode local|shared
|
|
304
305
|
wrap-up close <skill>
|
|
@@ -639,6 +639,12 @@ def check_file(project: Project, path: Path, text: str, ctx: _Ctx) -> list[Findi
|
|
|
639
639
|
if doc_type == "tasks":
|
|
640
640
|
out += _check_tasks(project, path, text, rel)
|
|
641
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
|
+
|
|
642
648
|
# length
|
|
643
649
|
max_lines = int(project.profile.get("check.max_lines") or 300)
|
|
644
650
|
n_lines = text.count("\n") + 1
|
|
@@ -673,6 +679,8 @@ def _check_tasks(project: Project, path: Path, text: str, rel: str) -> list[Find
|
|
|
673
679
|
plan = project.doc_path(path.parent, "plan")
|
|
674
680
|
acs = {c.id for c in parse_criteria(read(plan))} if plan.exists() else set()
|
|
675
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")
|
|
676
684
|
for t in tasks:
|
|
677
685
|
line = t.line_no + 1
|
|
678
686
|
if ids[t.id] > 1:
|
|
@@ -684,7 +692,7 @@ def _check_tasks(project: Project, path: Path, text: str, rel: str) -> list[Find
|
|
|
684
692
|
"warn", rel, "task-size", msg("{id} size is one of {sizes} (now '{size}')", id=t.id, sizes=sizes, size=t.size), line
|
|
685
693
|
)
|
|
686
694
|
)
|
|
687
|
-
if not t.size:
|
|
695
|
+
if not t.size and not t.done and not finished:
|
|
688
696
|
out.append(
|
|
689
697
|
Finding(
|
|
690
698
|
"warn",
|
|
@@ -717,7 +725,7 @@ def _check_tasks(project: Project, path: Path, text: str, rel: str) -> list[Find
|
|
|
717
725
|
out.append(Finding("info", rel, "task-owner", msg("{id} has no {owner} [{owner}:: name]", id=t.id, owner=owner), line))
|
|
718
726
|
covered = {ac for t in tasks for ac in t.criteria}
|
|
719
727
|
real_tasks = [t for t in tasks if "{{" not in t.title]
|
|
720
|
-
if real_tasks:
|
|
728
|
+
if real_tasks and not finished:
|
|
721
729
|
for ac in sorted(acs - covered, key=lambda x: int(x.split("-")[1])):
|
|
722
730
|
out.append(
|
|
723
731
|
Finding(
|
|
@@ -729,7 +737,7 @@ def _check_tasks(project: Project, path: Path, text: str, rel: str) -> list[Find
|
|
|
729
737
|
f"lantern task add … --ac {ac}",
|
|
730
738
|
)
|
|
731
739
|
)
|
|
732
|
-
if len(tasks) > 10:
|
|
740
|
+
if len(tasks) > 10 and not finished:
|
|
733
741
|
out.append(Finding("info", rel, "task-many", msg("{count} tasks — consider splitting the work", count=len(tasks))))
|
|
734
742
|
# cycles
|
|
735
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
|