lanternspec 0.3.1__tar.gz → 0.3.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lanternspec-0.3.1/src/lanternspec.egg-info → lanternspec-0.3.3}/PKG-INFO +9 -15
- {lanternspec-0.3.1 → lanternspec-0.3.3}/README.md +8 -14
- {lanternspec-0.3.1 → lanternspec-0.3.3}/pyproject.toml +1 -1
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/check/check_docs.py +2 -1
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/check/templates.py +4 -5
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/cli/report.py +4 -3
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/cli/tools.py +17 -1
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/cli/work.py +2 -1
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/core/enums.py +6 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/core/meta.py +50 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/core/profile.py +28 -5
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/core/sections.py +24 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/core/taskfile.py +6 -6
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/learn/knowledge/__init__.py +3 -1
- lanternspec-0.3.3/src/lanternspec/learn/knowledge/access.py +120 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/learn/knowledge/obsidian.py +76 -12
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/report/evaluate.py +2 -2
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/report/obsidian.py +47 -19
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/report/status.py +3 -5
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/report/views.py +197 -45
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/skills/l-build/SKILL.md +4 -2
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/skills/l-idea/SKILL.md +16 -2
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/skills/l-init/SKILL.md +11 -1
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/skills/l-task/SKILL.md +1 -1
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/skills/l-template/SKILL.md +6 -3
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/ADR.md +11 -6
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/API.md +5 -3
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Architecture.md +7 -4
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Competency Card.md +9 -5
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Data.md +5 -3
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Debt Card.md +9 -5
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Design.md +13 -7
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Docs MOC.md +5 -3
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Feature List.md +5 -3
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Glossary.md +5 -3
- lanternspec-0.3.3/src/lanternspec/resources/locales/en/templates/Idea - Bug.md +90 -0
- lanternspec-0.3.3/src/lanternspec/resources/locales/en/templates/Idea - Experiment.md +81 -0
- lanternspec-0.3.3/src/lanternspec/resources/locales/en/templates/Idea - Feature.md +78 -0
- lanternspec-0.3.3/src/lanternspec/resources/locales/en/templates/Idea - Improvement.md +82 -0
- lanternspec-0.3.3/src/lanternspec/resources/locales/en/templates/Idea - Tech Review.md +95 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Idea.md +11 -6
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Known Tech.md +5 -3
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Legacy Map.md +7 -4
- lanternspec-0.3.3/src/lanternspec/resources/locales/en/templates/Log.md +54 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Meeting Notes.md +5 -3
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Plan.md +19 -10
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Project Definition.md +13 -7
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Screens.md +5 -3
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Session Log.md +7 -4
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Task Breakdown Rules.md +3 -2
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Tasks.md +8 -4
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Work Division Rules.md +5 -3
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/_meta/enums.yaml +3 -3
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/skills/l-build/SKILL.md +4 -2
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/skills/l-idea/SKILL.md +16 -2
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/skills/l-init/SKILL.md +11 -1
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/skills/l-task/SKILL.md +1 -1
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/skills/l-template/SKILL.md +6 -3
- lanternspec-0.3.3/src/lanternspec/resources/locales/ko/templates/ADR.md +51 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/templates/API.md +5 -3
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/templates/_meta/enums.yaml +3 -3
- {lanternspec-0.3.1 → lanternspec-0.3.3}/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.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/templates//352/270/260/353/212/245 /353/252/251/353/241/235.md" +5 -3
- lanternspec-0.3.3/src/lanternspec/resources/locales/ko/templates//352/270/260/353/241/235.md +54 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/templates//352/270/260/354/241/264 /353/254/270/354/204/234 /354/247/200/353/217/204.md" +7 -4
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/templates//352/270/260/355/232/215.md +19 -10
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/templates//353/215/260/354/235/264/355/204/260.md +5 -3
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/templates//353/266/200/354/261/204 /354/271/264/353/223/234.md" +9 -5
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/templates//354/204/244/352/263/204.md +13 -7
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/templates//354/204/270/354/205/230 /352/270/260/353/241/235.md" +7 -4
- {lanternspec-0.3.1 → lanternspec-0.3.3}/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.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/templates//354/225/204/353/212/224 /352/270/260/354/210/240.md" +5 -3
- lanternspec-0.3.3/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.3.3/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.3.3/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.3.3/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.3.3/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.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/templates//354/225/204/354/235/264/353/224/224/354/226/264.md +11 -6
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/templates//354/227/255/353/237/211 /354/271/264/353/223/234.md" +9 -5
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/templates//354/232/251/354/226/264/354/247/221.md +5 -3
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/templates//354/236/221/354/227/205 /353/202/230/353/210/204/352/270/260 /352/270/260/354/244/200.md" +5 -3
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/templates//355/224/204/353/241/234/354/240/235/355/212/270 /354/240/225/354/235/230/354/204/234.md" +13 -7
- {lanternspec-0.3.1 → lanternspec-0.3.3}/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" +3 -2
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/templates//355/225/240 /354/235/274.md" +8 -4
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/templates//355/231/224/353/251/264.md +5 -3
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/templates//355/232/214/354/235/230/353/241/235.md +5 -3
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/messages.yaml +71 -12
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/names.yaml +5 -3
- lanternspec-0.3.3/src/lanternspec/resources/obsidian/lantern-kanban/main.js +283 -0
- lanternspec-0.3.3/src/lanternspec/resources/obsidian/lantern-kanban/manifest.json +9 -0
- lanternspec-0.3.3/src/lanternspec/resources/obsidian/lantern-kanban/styles.css +111 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/obsidian/lantern-timeline/main.js +227 -68
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/obsidian/lantern-timeline/styles.css +24 -4
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/tools/__init__.py +24 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/tools/agent_hooks.py +5 -2
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/tools/antigravity.py +1 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/tools/base.py +25 -1
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/tools/claude.py +1 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/tools/close.py +28 -6
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/tools/codex.py +29 -0
- lanternspec-0.3.3/src/lanternspec/tools/guard.py +338 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/tools/install.py +11 -1
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/work/scaffold.py +25 -1
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/work/tasks.py +9 -4
- {lanternspec-0.3.1 → lanternspec-0.3.3/src/lanternspec.egg-info}/PKG-INFO +9 -15
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec.egg-info/SOURCES.txt +16 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_checks.py +5 -5
- lanternspec-0.3.3/tests/test_guard.py +147 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_install_and_aux.py +9 -9
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_later_features.py +2 -2
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_layout.py +2 -2
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_obsidian.py +60 -8
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_refs.py +1 -1
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_work_line.py +65 -5
- lanternspec-0.3.1/src/lanternspec/resources/locales/en/templates/Log.md +0 -48
- lanternspec-0.3.1/src/lanternspec/resources/locales/ko/templates/ADR.md +0 -46
- lanternspec-0.3.1/src/lanternspec/resources/locales/ko/templates//352/270/260/353/241/235.md +0 -48
- {lanternspec-0.3.1 → lanternspec-0.3.3}/LICENSE +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/setup.cfg +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/__init__.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/__main__.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/check/__init__.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/check/budget.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/check/doctor.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/check/githooks.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/check/layout.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/check/legacy.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/check/pr_check.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/cli/__init__.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/cli/check.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/cli/color.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/cli/common.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/cli/core.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/cli/learn.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/cli/refs.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/core/__init__.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/core/frontmatter.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/core/links.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/core/messages.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/core/names.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/core/new_id.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/core/outline.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/core/principles.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/core/project.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/core/state.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/core/templating.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/learn/__init__.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/learn/debt.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/learn/knowledge/drafts.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/learn/knowledge/mcp_server.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/learn/knowledge/notion.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/refs/__init__.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/refs/convert.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/refs/domain.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/refs/index.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/refs/rules.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/refs/sources.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/refs/terms.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/report/__init__.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/report/build_mode.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/report/doc_map.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/report/principles_doc.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/report/resume.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/report/scan.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/report/sections_doc.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/__init__.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/conventions/go.yaml +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/conventions/python.yaml +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/conventions/rust.yaml +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/conventions/swift.yaml +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/conventions/typescript.yaml +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/agents/AGENTS.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/git/gitmessage.txt +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/github/pull_request_template.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/skills/l-adr/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/skills/l-check/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/skills/l-design/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/skills/l-domain/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/skills/l-finish/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/skills/l-learn/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/skills/l-map/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/skills/l-parallel/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/skills/l-plan/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/skills/l-pr/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/skills/l-ref/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/skills/l-ref/domain.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/skills/l-ref/rules.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/skills/l-ref/terms.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/skills/l-report/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/skills/l-resume/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/skills/l-sync/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Collaboration Rules.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Deployment.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Platform Integration.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Repository File Rules.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Server Operations.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/en/templates/Tech Selection Criteria.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/agents/AGENTS.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/git/gitmessage.txt +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/github/pull_request_template.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/skills/l-adr/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/skills/l-check/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/skills/l-design/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/skills/l-domain/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/skills/l-finish/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/skills/l-learn/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/skills/l-map/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/skills/l-parallel/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/skills/l-plan/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/skills/l-pr/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/skills/l-ref/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/skills/l-ref/domain.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/skills/l-ref/rules.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/skills/l-ref/terms.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/skills/l-report/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/skills/l-resume/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/skills/l-sync/SKILL.md +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/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.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/templates//353/260/260/355/217/254.md" +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/templates//354/204/234/353/262/204 /353/260/260/355/217/254 /302/267 /354/232/264/354/230/201.md" +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/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" +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/templates//355/224/214/353/236/253/355/217/274 /354/227/260/353/217/231.md" +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/locales/ko/templates//355/230/221/354/227/205 /352/267/234/354/271/231.md" +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/obsidian/lantern-timeline/manifest.json +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/resources/principles.yaml +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/tools/docs_mode.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/tools/health.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/tools/parts.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/tools/rules.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/tools/runlog.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/tools/sessions.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/tools/skills.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/work/__init__.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/work/branches.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/work/dbml.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/work/epic_rules.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/work/ideas.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/work/pack.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/work/progress.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/work/screen.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec/work/stages.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec.egg-info/dependency_links.txt +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec.egg-info/entry_points.txt +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec.egg-info/requires.txt +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/src/lanternspec.egg-info/top_level.txt +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_budget.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_color.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_core.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_english.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_enums_single_source.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_git.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_learning_line.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_messages.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_name_overlap.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_names.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_part_delivery.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_parts.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_principles.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_principles_data.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_progress_parallel.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_release_script.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_resume.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_skill_commands.py +0 -0
- {lanternspec-0.3.1 → lanternspec-0.3.3}/tests/test_tool_health.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lanternspec
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: Spec-driven development for agentic software engineering
|
|
5
5
|
Author: Jihyeok Jeong
|
|
6
6
|
License-Expression: MIT
|
|
@@ -101,24 +101,15 @@ 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
|
-
| `/l-task` | an ordered task list (size 15m · 1h ·
|
|
112
|
+
| `/l-task` | an ordered task list (size 15m · 1h · 4h · 8h · acceptance criteria · dependencies · spike tasks) | `Tasks.md` |
|
|
122
113
|
| `/l-build` | implement → test → one commit per task, report **with evidence**, open and check screens itself, merge into the current state when done (in a parallel worktree, only its own tasks) | code, `Log.md` |
|
|
123
114
|
| `/l-learn` | compares unfamiliar tech with your knowledge base → 🟢 · 🟡 · 🔴, debt cards and draft study notes | `📒 Debt/Cards/D-001 …` |
|
|
124
115
|
| `/l-report` | kanban · timeline · domain · traceability · debt · docs-vs-code status + a three-line report | `4. Operations/Reports/Status Report.md` |
|
|
@@ -171,7 +162,8 @@ Sections lantern reads and writes (protected sections, such as "Now" in a log) m
|
|
|
171
162
|
|
|
172
163
|
### Viewing the docs in Obsidian
|
|
173
164
|
Open the `docs/` folder as a vault in Obsidian and it is already set up for reading (`docs/.obsidian/`).
|
|
174
|
-
`lantern obsidian plugins` also adds Lantern Timeline, which shows the report's timeline as bars: stretches with work in fine columns (5 minutes to an hour), time with no task folded away, and how long each finished task took beside it. Drag a task that has not started to move it, or drag its ends to change its length; the dates are saved in its planned and due attributes.
|
|
165
|
+
`lantern obsidian plugins` also adds Lantern Timeline, which shows the report's timeline as bars: stretches with work in fine columns (5 minutes to an hour), time with no task folded away, and how long each finished task took beside it. Tasks without a date wait with their size in a "no date yet" column on the right; drag one onto a day to plan it. Drag a planned task that has not started to move it, or drag its ends to change its length; the dates are saved in its planned and due attributes.
|
|
166
|
+
Lantern Kanban comes along too: works as cards in stage columns (plan · design · tasks · build · done), each opening its tasks in a window when clicked (read only). Turn off a view you don't want in Obsidian's settings, and reports draw without it.
|
|
175
167
|
The task list (`Tasks.md`) reads like a table: names on the left, size · after · criteria in columns on the right. The file keeps one line per task.
|
|
176
168
|
|
|
177
169
|
- **Folder colors, folder and file icons, callouts and quotes** — each document stage has its own folder color, folders and files get icons, and callouts and quotes look clean. Works on top of any theme.
|
|
@@ -271,6 +263,8 @@ Anything you don't understand yet is kept as a debt card, and every time you ask
|
|
|
271
263
|
|
|
272
264
|
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.
|
|
273
265
|
|
|
266
|
+
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).
|
|
267
|
+
|
|
274
268
|
There are three kinds of debt.
|
|
275
269
|
|
|
276
270
|
| Kind | Meaning |
|
|
@@ -311,7 +305,7 @@ Import mockups with `lantern screen import`; `lantern screen compare` finds wher
|
|
|
311
305
|
## CLI at a glance
|
|
312
306
|
|
|
313
307
|
```text
|
|
314
|
-
setup install [--language] [--tools] [--mcp] [--ci|--no-ci] [--pr-template] [--commit-template] · upgrade [--apply] · doctor · build-mode suggest
|
|
308
|
+
setup install [--language] [--tools] [--mcp] [--ci|--no-ci] [--pr-template] [--commit-template] · upgrade [--apply] · doctor · build-mode suggest · guard -- <tool>
|
|
315
309
|
profile profile show|docs|write|set · principles show|detect · parts [add|ignore] · enums list|rename · sections list|rename|off|on
|
|
316
310
|
documents scaffold init [--plan] | work | doc | idea | adr | meeting | custom · new-id · map · meta get|set
|
|
317
311
|
checks check [--changed] [--epic W-012] · check-pr · lint [--ci] · check-dbml · dbml render|from-sql|diff
|
|
@@ -86,24 +86,15 @@ 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
|
-
| `/l-task` | an ordered task list (size 15m · 1h ·
|
|
97
|
+
| `/l-task` | an ordered task list (size 15m · 1h · 4h · 8h · acceptance criteria · dependencies · spike tasks) | `Tasks.md` |
|
|
107
98
|
| `/l-build` | implement → test → one commit per task, report **with evidence**, open and check screens itself, merge into the current state when done (in a parallel worktree, only its own tasks) | code, `Log.md` |
|
|
108
99
|
| `/l-learn` | compares unfamiliar tech with your knowledge base → 🟢 · 🟡 · 🔴, debt cards and draft study notes | `📒 Debt/Cards/D-001 …` |
|
|
109
100
|
| `/l-report` | kanban · timeline · domain · traceability · debt · docs-vs-code status + a three-line report | `4. Operations/Reports/Status Report.md` |
|
|
@@ -156,7 +147,8 @@ Sections lantern reads and writes (protected sections, such as "Now" in a log) m
|
|
|
156
147
|
|
|
157
148
|
### Viewing the docs in Obsidian
|
|
158
149
|
Open the `docs/` folder as a vault in Obsidian and it is already set up for reading (`docs/.obsidian/`).
|
|
159
|
-
`lantern obsidian plugins` also adds Lantern Timeline, which shows the report's timeline as bars: stretches with work in fine columns (5 minutes to an hour), time with no task folded away, and how long each finished task took beside it. Drag a task that has not started to move it, or drag its ends to change its length; the dates are saved in its planned and due attributes.
|
|
150
|
+
`lantern obsidian plugins` also adds Lantern Timeline, which shows the report's timeline as bars: stretches with work in fine columns (5 minutes to an hour), time with no task folded away, and how long each finished task took beside it. Tasks without a date wait with their size in a "no date yet" column on the right; drag one onto a day to plan it. Drag a planned task that has not started to move it, or drag its ends to change its length; the dates are saved in its planned and due attributes.
|
|
151
|
+
Lantern Kanban comes along too: works as cards in stage columns (plan · design · tasks · build · done), each opening its tasks in a window when clicked (read only). Turn off a view you don't want in Obsidian's settings, and reports draw without it.
|
|
160
152
|
The task list (`Tasks.md`) reads like a table: names on the left, size · after · criteria in columns on the right. The file keeps one line per task.
|
|
161
153
|
|
|
162
154
|
- **Folder colors, folder and file icons, callouts and quotes** — each document stage has its own folder color, folders and files get icons, and callouts and quotes look clean. Works on top of any theme.
|
|
@@ -256,6 +248,8 @@ Anything you don't understand yet is kept as a debt card, and every time you ask
|
|
|
256
248
|
|
|
257
249
|
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.
|
|
258
250
|
|
|
251
|
+
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).
|
|
252
|
+
|
|
259
253
|
There are three kinds of debt.
|
|
260
254
|
|
|
261
255
|
| Kind | Meaning |
|
|
@@ -296,7 +290,7 @@ Import mockups with `lantern screen import`; `lantern screen compare` finds wher
|
|
|
296
290
|
## CLI at a glance
|
|
297
291
|
|
|
298
292
|
```text
|
|
299
|
-
setup install [--language] [--tools] [--mcp] [--ci|--no-ci] [--pr-template] [--commit-template] · upgrade [--apply] · doctor · build-mode suggest
|
|
293
|
+
setup install [--language] [--tools] [--mcp] [--ci|--no-ci] [--pr-template] [--commit-template] · upgrade [--apply] · doctor · build-mode suggest · guard -- <tool>
|
|
300
294
|
profile profile show|docs|write|set · principles show|detect · parts [add|ignore] · enums list|rename · sections list|rename|off|on
|
|
301
295
|
documents scaffold init [--plan] | work | doc | idea | adr | meeting | custom · new-id · map · meta get|set
|
|
302
296
|
checks check [--changed] [--epic W-012] · check-pr · lint [--ci] · check-dbml · dbml render|from-sql|diff
|
|
@@ -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(
|
|
@@ -613,7 +613,8 @@ def skeleton_from(project: Project, name: str, source: Path) -> str:
|
|
|
613
613
|
out += [
|
|
614
614
|
"",
|
|
615
615
|
f"{m.group(1)} {current}",
|
|
616
|
-
msg("> [!guide]
|
|
616
|
+
msg("> [!guide]- ✍️ How to write — {current}", current=current),
|
|
617
|
+
msg("> One line on what goes in '{current}'", current=current),
|
|
617
618
|
"",
|
|
618
619
|
]
|
|
619
620
|
filled, table_state = False, ""
|
|
@@ -789,10 +790,8 @@ def migrate_text(
|
|
|
789
790
|
if leftovers or bin_existing:
|
|
790
791
|
parts += [
|
|
791
792
|
f"## {bin_title}",
|
|
792
|
-
msg(
|
|
793
|
-
|
|
794
|
-
"move it to the right section or tidy it up, then delete this section."
|
|
795
|
-
),
|
|
793
|
+
msg("> [!guide]- ✍️ How to write — content the new template has no place for"),
|
|
794
|
+
msg("> Gathered here rather than deleted — move it to the right section or tidy it up, then delete this section."),
|
|
796
795
|
"",
|
|
797
796
|
]
|
|
798
797
|
for c in bin_existing:
|
|
@@ -135,14 +135,15 @@ def cmd_build_mode(a: argparse.Namespace) -> int:
|
|
|
135
135
|
|
|
136
136
|
def cmd_obsidian(a: argparse.Namespace) -> int:
|
|
137
137
|
"""`lantern obsidian plugins` — download the recommended Obsidian plugins into docs/.obsidian/plugins/."""
|
|
138
|
-
from ..report.obsidian import
|
|
138
|
+
from ..report.obsidian import BUNDLED_PLUGINS, install_plugins, write_vault
|
|
139
139
|
|
|
140
140
|
project = _p()
|
|
141
141
|
write_vault(project) # plugin settings and .gitignore must exist first
|
|
142
142
|
for plugin_id, version in install_plugins(project):
|
|
143
143
|
print(f"✔ {plugin_id} {version}")
|
|
144
|
-
write_vault(project) # now that plugins are in use, this also copies the
|
|
145
|
-
|
|
144
|
+
write_vault(project) # now that plugins are in use, this also copies the plugins bundled with the package
|
|
145
|
+
for plugin in BUNDLED_PLUGINS:
|
|
146
|
+
print(f"✔ {plugin}")
|
|
146
147
|
print(msg("Next: open the docs/ folder as a vault in Obsidian, and turn community plugins on when asked (turn off restricted mode)"))
|
|
147
148
|
return 0
|
|
148
149
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""AI-tool commands: install · upgrade · build-adapters · docs-mode · hook · close."""
|
|
1
|
+
"""AI-tool commands: install · upgrade · build-adapters · docs-mode · hook · close · guard."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
@@ -166,6 +166,13 @@ def cmd_close(a: argparse.Namespace) -> int:
|
|
|
166
166
|
return 0
|
|
167
167
|
|
|
168
168
|
|
|
169
|
+
def cmd_guard(a: argparse.Namespace) -> int:
|
|
170
|
+
"""`lantern guard -- <tool>` — start an AI tool inside an OS sandbox that keeps it out of the closed knowledge store folders."""
|
|
171
|
+
from ..tools import guard
|
|
172
|
+
|
|
173
|
+
return guard.run(_p(), [arg for i, arg in enumerate(a.tool_command) if i or arg != "--"])
|
|
174
|
+
|
|
175
|
+
|
|
169
176
|
def register(add: Add) -> None:
|
|
170
177
|
"""Register the AI-tool commands."""
|
|
171
178
|
p = add("install", cmd_install, msg("Install skills · rules · agent hooks into the AI tool folders (before /l-init)"))
|
|
@@ -195,6 +202,15 @@ def register(add: Add) -> None:
|
|
|
195
202
|
p.add_argument("name")
|
|
196
203
|
p.add_argument("args", nargs="*")
|
|
197
204
|
p.add_argument("--agent", default="claude", help="claude | codex | antigravity")
|
|
205
|
+
p = add(
|
|
206
|
+
"guard",
|
|
207
|
+
cmd_guard,
|
|
208
|
+
msg(
|
|
209
|
+
"Start an AI tool inside an OS sandbox that keeps it out of the closed knowledge store folders "
|
|
210
|
+
"(macOS · Linux): lantern guard -- claude"
|
|
211
|
+
),
|
|
212
|
+
)
|
|
213
|
+
p.add_argument("tool_command", nargs=argparse.REMAINDER, help=msg("The tool's command, after --"))
|
|
198
214
|
p = add("close", cmd_close, msg("Common skill wrap-up: check → map → run record"))
|
|
199
215
|
p.add_argument("skill")
|
|
200
216
|
p.add_argument("--work")
|
|
@@ -175,7 +175,7 @@ def cmd_task(a: argparse.Namespace) -> int:
|
|
|
175
175
|
print(msg("▶ Started {id} [{attr}:: {started}]", id=t.id, attr=project.names.attr("start"), started=t.started))
|
|
176
176
|
return 0
|
|
177
177
|
if a.action == "done":
|
|
178
|
-
res = task_cmd.done(project, a.target)
|
|
178
|
+
res = task_cmd.done(project, a.target, by=_csv(a.by))
|
|
179
179
|
print(msg("✔ Finished {id} [{attr}:: {finished}]", id=res.task.id, attr=project.names.attr("finish"), finished=res.task.finished))
|
|
180
180
|
for ac in res.checkpoints:
|
|
181
181
|
print(
|
|
@@ -480,6 +480,7 @@ def register(add: Add) -> None:
|
|
|
480
480
|
p.add_argument("--from", dest="from_date", help=msg("estimate: start date"))
|
|
481
481
|
p.add_argument("--hours", type=float, default=6.0, help=msg("estimate: working hours a day"))
|
|
482
482
|
p.add_argument("--apply", action="store_true", help=msg("estimate: write the suggestion into the tasks document"))
|
|
483
|
+
p.add_argument("--by", help=msg("done: who did it — people's names and exact AI model names, comma-separated"))
|
|
483
484
|
p = add("task-add", cmd_task_add, argparse.SUPPRESS)
|
|
484
485
|
p.add_argument("work")
|
|
485
486
|
p.add_argument("what")
|
|
@@ -48,6 +48,7 @@ class Enum:
|
|
|
48
48
|
values: Name → icon, in the order written in enums.yaml.
|
|
49
49
|
applies: Document type → the frontmatter field that uses this list, e.g. {"debt": "status"}.
|
|
50
50
|
roles: Role → name. The key code uses to find a value.
|
|
51
|
+
previous: Role → names lantern once shipped for it (`was:` in enums.yaml), which an upgrade may rename to today's.
|
|
51
52
|
|
|
52
53
|
Example:
|
|
53
54
|
>>> e = load()["debt_status"]
|
|
@@ -60,6 +61,7 @@ class Enum:
|
|
|
60
61
|
values: dict[str, str]
|
|
61
62
|
applies: dict[str, str]
|
|
62
63
|
roles: dict[str, str] = field(default_factory=dict)
|
|
64
|
+
previous: dict[str, list[str]] = field(default_factory=dict)
|
|
63
65
|
|
|
64
66
|
def icon(self, value: str) -> str:
|
|
65
67
|
"""Return the icon of a value.
|
|
@@ -167,6 +169,7 @@ class Enums:
|
|
|
167
169
|
values = {str(v): "" for v in values}
|
|
168
170
|
icons: dict[str, str] = {}
|
|
169
171
|
roles: dict[str, str] = {}
|
|
172
|
+
previous: dict[str, list[str]] = {}
|
|
170
173
|
for k, v in values.items():
|
|
171
174
|
if isinstance(v, dict):
|
|
172
175
|
icons[str(k)] = str(v.get("icon") or "")
|
|
@@ -175,6 +178,8 @@ class Enums:
|
|
|
175
178
|
if role in roles:
|
|
176
179
|
self._duplicate_roles.append(f"{name}.{role}")
|
|
177
180
|
roles[role] = str(k)
|
|
181
|
+
if v.get("was"):
|
|
182
|
+
previous[role] = [str(x) for x in v["was"]]
|
|
178
183
|
else:
|
|
179
184
|
icons[str(k)] = str(v or "")
|
|
180
185
|
self.enums[name] = Enum(
|
|
@@ -183,6 +188,7 @@ class Enums:
|
|
|
183
188
|
values=icons,
|
|
184
189
|
applies={str(k): str(v) for k, v in (spec.get("applies") or {}).items()},
|
|
185
190
|
roles=roles,
|
|
191
|
+
previous=previous,
|
|
186
192
|
)
|
|
187
193
|
if fallback is not None:
|
|
188
194
|
for name, base in fallback.enums.items():
|
|
@@ -215,6 +215,56 @@ def drop_legacy_sizes(project: Project) -> list[str]:
|
|
|
215
215
|
return [msg("✔ enums.yaml size: dropped {items}", items=" · ".join(gone))]
|
|
216
216
|
|
|
217
217
|
|
|
218
|
+
def previous_names(project: Project) -> list[tuple[str, str, str]]:
|
|
219
|
+
"""Find values the project still names the way lantern once shipped them, where today's default is different.
|
|
220
|
+
|
|
221
|
+
enums.yaml lists them per value as `was:`. A name someone chose themselves is never listed, so it is never suggested.
|
|
222
|
+
|
|
223
|
+
Args:
|
|
224
|
+
project: The project.
|
|
225
|
+
|
|
226
|
+
Returns:
|
|
227
|
+
(list name, current name, today's name) for each one.
|
|
228
|
+
|
|
229
|
+
Example:
|
|
230
|
+
>>> previous_names(project) # doctest: +SKIP
|
|
231
|
+
[('size', '반나절', '4h'), ('size', '1d', '8h')]
|
|
232
|
+
"""
|
|
233
|
+
if not project.enums_file.exists():
|
|
234
|
+
return []
|
|
235
|
+
base = enums_mod.load(language=project.profile.language)
|
|
236
|
+
out = []
|
|
237
|
+
for name, shipped in base.enums.items():
|
|
238
|
+
mine = project.enums.get(name)
|
|
239
|
+
if mine is None:
|
|
240
|
+
continue
|
|
241
|
+
for role, olds in shipped.previous.items():
|
|
242
|
+
current, today_name = mine.roles.get(role, ""), shipped.roles.get(role, "")
|
|
243
|
+
if current in olds and today_name and today_name not in mine.values:
|
|
244
|
+
out.append((name, current, today_name))
|
|
245
|
+
return out
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
def rename_previous_names(project: Project) -> list[str]:
|
|
249
|
+
"""Rename the values named the way lantern once shipped them to today's names, documents included (`lantern upgrade --apply`).
|
|
250
|
+
|
|
251
|
+
Args:
|
|
252
|
+
project: The project.
|
|
253
|
+
|
|
254
|
+
Returns:
|
|
255
|
+
One message per value renamed.
|
|
256
|
+
|
|
257
|
+
Example:
|
|
258
|
+
>>> rename_previous_names(project) # doctest: +SKIP
|
|
259
|
+
['✔ enums.yaml size: 반나절 → 4h (문서 3개)']
|
|
260
|
+
"""
|
|
261
|
+
out = []
|
|
262
|
+
for name, old, new in previous_names(project):
|
|
263
|
+
changed = rename_enum_value(project, name, old, new)
|
|
264
|
+
out.append(msg("✔ enums.yaml {enum}: {old} → {new} ({count} documents)", enum=name, old=old, new=new, count=len(changed)))
|
|
265
|
+
return out
|
|
266
|
+
|
|
267
|
+
|
|
218
268
|
def rename_enum_value(project: Project, enum: str, old: str, new: str) -> list[Path]:
|
|
219
269
|
"""Rename an enum value in enums.yaml and in every document that stores it (`lantern enums rename`).
|
|
220
270
|
|
|
@@ -64,7 +64,8 @@ DEFAULTS: dict[str, Any] = {
|
|
|
64
64
|
"references": {"rules": [], "terms": [], "domain": [], "exclude": [], "outside_rules": False, "terms_detect": "auto"},
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
# allow · deny: folders of the store that are open · closed (learn/knowledge/access.py); deny wins, empty lists leave everything open
|
|
68
|
+
KNOWLEDGE_DEFAULTS: dict[str, Any] = {"type": "obsidian", "path": "", "areas_from": None, "write": "direct", "allow": [], "deny": []}
|
|
68
69
|
|
|
69
70
|
CHOICES: dict[str, tuple[str, ...]] = {
|
|
70
71
|
"project.origin": ("greenfield", "brownfield"),
|
|
@@ -356,6 +357,8 @@ def validate(data: dict[str, Any]) -> list[str]:
|
|
|
356
357
|
k = data["knowledge"]
|
|
357
358
|
if not isinstance(k, dict) or not k.get("path"):
|
|
358
359
|
problems.append(msg("knowledge.path: the knowledge store path is empty (delete the knowledge block if there is none)"))
|
|
360
|
+
if isinstance(k, dict):
|
|
361
|
+
problems += _access_problems(k)
|
|
359
362
|
problems += _section_problems(data)
|
|
360
363
|
problems += _part_problems(data)
|
|
361
364
|
problems += _reference_problems(data)
|
|
@@ -366,6 +369,20 @@ def validate(data: dict[str, Any]) -> list[str]:
|
|
|
366
369
|
return problems
|
|
367
370
|
|
|
368
371
|
|
|
372
|
+
def _access_problems(knowledge: dict[str, Any]) -> list[str]:
|
|
373
|
+
"""Check knowledge.allow · knowledge.deny: lists of folders inside the store, for stores that are folders."""
|
|
374
|
+
problems = []
|
|
375
|
+
for key in ("allow", "deny"):
|
|
376
|
+
value = knowledge.get(key) or []
|
|
377
|
+
if not isinstance(value, list) or not all(isinstance(x, str) and x.strip() for x in value):
|
|
378
|
+
problems.append(msg("knowledge.{key}: must be a list of folders in the knowledge store (e.g. [2. Study])", key=key))
|
|
379
|
+
elif any(x.startswith(("/", "~")) or ".." in x.replace("\\", "/").split("/") for x in value):
|
|
380
|
+
problems.append(msg("knowledge.{key}: write folders relative to the knowledge store, without .. (e.g. [2. Study])", key=key))
|
|
381
|
+
elif value and knowledge.get("type") == "notion":
|
|
382
|
+
problems.append(msg("knowledge.{key}: works for obsidian · folder stores only (Notion: share only the open pages)", key=key))
|
|
383
|
+
return problems
|
|
384
|
+
|
|
385
|
+
|
|
369
386
|
def _reference_problems(data: dict[str, Any]) -> list[str]:
|
|
370
387
|
"""Check that each list under references holds paths (or, for exclude, addresses)."""
|
|
371
388
|
problems = []
|
|
@@ -561,10 +578,16 @@ def render(data: dict[str, Any]) -> str:
|
|
|
561
578
|
lines.append(
|
|
562
579
|
msg(" areas_from: {s} # (optional) read this folder's categories to suggest debt-card topics", s=s(k["areas_from"]))
|
|
563
580
|
)
|
|
564
|
-
lines
|
|
565
|
-
msg(" write: {s} # direct (write right after approval) | propose_only (draft files only)", s=s(k["write"]))
|
|
566
|
-
|
|
567
|
-
|
|
581
|
+
lines.append(
|
|
582
|
+
msg(" write: {s} # direct (write right after approval) | propose_only (draft files only)", s=s(k["write"]))
|
|
583
|
+
)
|
|
584
|
+
if k.get("allow"):
|
|
585
|
+
lines.append(
|
|
586
|
+
msg(" allow: {s} # (optional) only these folders are open; without it, everything not in deny", s=s(k["allow"]))
|
|
587
|
+
)
|
|
588
|
+
if k.get("deny"):
|
|
589
|
+
lines.append(msg(" deny: {s} # (optional) folders never opened; wins over allow (lantern guard)", s=s(k["deny"])))
|
|
590
|
+
lines.append("")
|
|
568
591
|
else:
|
|
569
592
|
lines += [msg("# knowledge: add this block once there is a knowledge store (type · path · write)"), ""]
|
|
570
593
|
lines += [
|
|
@@ -110,6 +110,30 @@ def _split_guides(content: str) -> tuple[list[str], list[str]]:
|
|
|
110
110
|
return guides, rest
|
|
111
111
|
|
|
112
112
|
|
|
113
|
+
def outside_guides(text: str) -> list[tuple[int, str]]:
|
|
114
|
+
r"""Return a document's lines that aren't part of a `> [!guide]` callout, with their 1-based numbers.
|
|
115
|
+
|
|
116
|
+
A guide is a writing note from the template: what it says (an example `❓` line, say) isn't the document's own.
|
|
117
|
+
|
|
118
|
+
Args:
|
|
119
|
+
text: The whole document.
|
|
120
|
+
|
|
121
|
+
Returns:
|
|
122
|
+
(line number, line) for every line outside a guide.
|
|
123
|
+
|
|
124
|
+
Example:
|
|
125
|
+
>>> outside_guides("## 기획\n> [!guide]- 작성법\n> `- ❓ 확인 필요: 질문`\n- ❓ 확인 필요: 실제 질문")
|
|
126
|
+
[(1, '## 기획'), (4, '- ❓ 확인 필요: 실제 질문')]
|
|
127
|
+
"""
|
|
128
|
+
out = []
|
|
129
|
+
in_guide = False
|
|
130
|
+
for number, line in enumerate(text.split("\n"), start=1):
|
|
131
|
+
in_guide = line.startswith("> [!guide]") or (in_guide and line.startswith(">"))
|
|
132
|
+
if not in_guide:
|
|
133
|
+
out.append((number, line))
|
|
134
|
+
return out
|
|
135
|
+
|
|
136
|
+
|
|
113
137
|
def body(text: str, titles: Iterable[str]) -> str:
|
|
114
138
|
r"""Return a section's content without its `> [!guide]` callouts (every `>` line of the callout).
|
|
115
139
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Parse and edit the task lines of `할 일.md` and the acceptance criteria of `기획.md`.
|
|
2
2
|
|
|
3
3
|
Task line:
|
|
4
|
-
- [ ] W-012-T02 무엇 [크기::
|
|
4
|
+
- [ ] W-012-T02 무엇 [크기:: 4h] [기준:: AC-1] [먼저:: T01] [담당:: 이름]
|
|
5
5
|
|
|
6
6
|
Attribute names (`크기` …) and the "❓ 확인 필요" marker come from the project's names.yaml (core/names.py);
|
|
7
7
|
parsed attributes are keyed by role ("size" · "criteria" · "after" …), so callers never spell a name.
|
|
@@ -29,10 +29,10 @@ TASK_LINE = re.compile(r"^(\s*)- \[( |x|X)\] (W-\d{3,}-T\d{2,})\b\s*(.*)$")
|
|
|
29
29
|
ATTR = re.compile(r"\[([^\[\]:]+?)::\s*([^\[\]]*?)\s*\]")
|
|
30
30
|
AC_LINE = re.compile(r"^(\s*)- \[( |x|X)\] (AC-\d+)\b\s*(.*)$")
|
|
31
31
|
|
|
32
|
-
# What each size means: hours
|
|
32
|
+
# What each size means: the hours a person would put into it, added up (not the AI's time). The names in enums.yaml
|
|
33
|
+
# (15m · 1h · 4h · 8h) say the same thing, so a size has one meaning.
|
|
33
34
|
SIZE_HOURS = {"xs": 0.25, "s": 1.0, "m": 4.0, "l": 8.0}
|
|
34
|
-
|
|
35
|
-
LEGACY_SIZES = {"S": "s", "M": "m", "L": "l"} # the names before 15m · 1h · 반나절 · 1d, still read
|
|
35
|
+
LEGACY_SIZES = {"S": "s", "M": "m", "L": "l"} # the names before the sizes were named by their hours, still read
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
def size_role(enums: Enums, value: str) -> str:
|
|
@@ -47,7 +47,7 @@ def size_role(enums: Enums, value: str) -> str:
|
|
|
47
47
|
|
|
48
48
|
Example:
|
|
49
49
|
>>> from lanternspec.core.enums import load
|
|
50
|
-
>>> size_role(load(), "
|
|
50
|
+
>>> size_role(load(), "4h"), size_role(load(), "M"), size_role(load(), "huge")
|
|
51
51
|
('m', 'm', '')
|
|
52
52
|
"""
|
|
53
53
|
role = enums["size"].role_of(value) if enums.get("size") else ""
|
|
@@ -125,7 +125,7 @@ class Task:
|
|
|
125
125
|
|
|
126
126
|
@property
|
|
127
127
|
def size(self) -> str:
|
|
128
|
-
"""The size attribute as written (e.g. "
|
|
128
|
+
"""The size attribute as written (e.g. "4h"), or ""."""
|
|
129
129
|
return self.attrs.get("size", "")
|
|
130
130
|
|
|
131
131
|
@property
|
|
@@ -12,6 +12,7 @@ We never change the other store's structure: counts and status live in our ledge
|
|
|
12
12
|
|
|
13
13
|
Not here:
|
|
14
14
|
- drafts waiting for approval (propose · write) → learn/knowledge/drafts.py
|
|
15
|
+
- which folders of a store are open → learn/knowledge/access.py
|
|
15
16
|
"""
|
|
16
17
|
|
|
17
18
|
from __future__ import annotations
|
|
@@ -179,9 +180,10 @@ def adapter_for(project: Project) -> Adapter:
|
|
|
179
180
|
raise KnowledgeError(msg("No knowledge store is set up (the knowledge block in lantern.yaml)"))
|
|
180
181
|
kind = k["type"]
|
|
181
182
|
if kind in ("obsidian", "folder"): # folder = any Markdown folder (other stores)
|
|
183
|
+
from .access import Access
|
|
182
184
|
from .obsidian import ObsidianAdapter
|
|
183
185
|
|
|
184
|
-
return ObsidianAdapter(Path(str(k["path"])).expanduser())
|
|
186
|
+
return ObsidianAdapter(Path(str(k["path"])).expanduser(), Access.from_config(k))
|
|
185
187
|
if kind == "notion":
|
|
186
188
|
from .notion import from_config
|
|
187
189
|
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"""Decide which folders of a knowledge store are open (knowledge.allow · knowledge.deny).
|
|
2
|
+
|
|
3
|
+
Responsibilities:
|
|
4
|
+
- turn the two lists of lantern.yaml into one answer: may this path be opened?
|
|
5
|
+
- say where a walk of the store may start
|
|
6
|
+
|
|
7
|
+
Not here:
|
|
8
|
+
- reading and writing the store's files → learn/knowledge/obsidian.py
|
|
9
|
+
- keeping an AI tool out of the closed folders at the OS level → tools/guard.py
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
from dataclasses import dataclass
|
|
15
|
+
from typing import Any
|
|
16
|
+
|
|
17
|
+
from ...core.project import nfc
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _parts(path: str) -> tuple[str, ...]:
|
|
21
|
+
"""Split a store-relative path into comparable parts (NFC, lower case, no empty or "." parts)."""
|
|
22
|
+
return tuple(p.casefold() for p in nfc(str(path)).replace("\\", "/").split("/") if p and p != ".")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _under(parts: tuple[str, ...], folders: tuple[str, ...]) -> bool:
|
|
26
|
+
"""Whether the path is one of the folders or inside one."""
|
|
27
|
+
return any(parts[: len(f)] == f for f in (_parts(folder) for folder in folders) if f)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@dataclass(frozen=True)
|
|
31
|
+
class Access:
|
|
32
|
+
"""Which folders of a knowledge store may be opened.
|
|
33
|
+
|
|
34
|
+
With neither list the whole store is open, as before. Once either list is set, hidden
|
|
35
|
+
files and folders (`.git`, `.obsidian` …) are closed too: they often hold copies of the closed notes.
|
|
36
|
+
|
|
37
|
+
Attributes:
|
|
38
|
+
allow: Folders that are open, relative to the store root; empty means everything not denied.
|
|
39
|
+
deny: Folders that are closed; they win over `allow`.
|
|
40
|
+
|
|
41
|
+
Example:
|
|
42
|
+
>>> Access(deny=("4. Work",)).permits("2. Study/JWT.md")
|
|
43
|
+
True
|
|
44
|
+
>>> Access(allow=("2. Study",)).permits("3. Projects/앱.md")
|
|
45
|
+
False
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
allow: tuple[str, ...] = ()
|
|
49
|
+
deny: tuple[str, ...] = ()
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_config(cls, knowledge: dict[str, Any]) -> Access:
|
|
53
|
+
"""Read the two lists from the knowledge block of lantern.yaml.
|
|
54
|
+
|
|
55
|
+
Args:
|
|
56
|
+
knowledge: The knowledge settings.
|
|
57
|
+
|
|
58
|
+
Returns:
|
|
59
|
+
The access rules; open to everything when neither list is set.
|
|
60
|
+
|
|
61
|
+
Example:
|
|
62
|
+
>>> Access.from_config({"path": "~/vault", "deny": ["4. Work"]}).deny
|
|
63
|
+
('4. Work',)
|
|
64
|
+
"""
|
|
65
|
+
return cls(allow=tuple(str(f) for f in knowledge.get("allow") or []), deny=tuple(str(f) for f in knowledge.get("deny") or []))
|
|
66
|
+
|
|
67
|
+
@property
|
|
68
|
+
def restricted(self) -> bool:
|
|
69
|
+
"""Whether any folder is closed."""
|
|
70
|
+
return bool(self.allow or self.deny)
|
|
71
|
+
|
|
72
|
+
def permits(self, path: str) -> bool:
|
|
73
|
+
"""Say whether a path of the store may be opened.
|
|
74
|
+
|
|
75
|
+
Names compare without regard to case or Unicode form, as macOS file names do.
|
|
76
|
+
|
|
77
|
+
Args:
|
|
78
|
+
path: A file or folder, relative to the store root.
|
|
79
|
+
|
|
80
|
+
Returns:
|
|
81
|
+
True when the path is open.
|
|
82
|
+
|
|
83
|
+
Example:
|
|
84
|
+
>>> access = Access(allow=("2. Study",), deny=("2. Study/Exam",))
|
|
85
|
+
>>> access.permits("2. study/Backend/JWT.md"), access.permits("2. Study/Exam/기출.md")
|
|
86
|
+
(True, False)
|
|
87
|
+
>>> Access(deny=("4. Work",)).permits(".git/config"), Access().permits(".git/config")
|
|
88
|
+
(False, True)
|
|
89
|
+
"""
|
|
90
|
+
if not self.restricted:
|
|
91
|
+
return True
|
|
92
|
+
parts = _parts(path)
|
|
93
|
+
if ".." in parts or any(p.startswith(".") for p in parts):
|
|
94
|
+
return False
|
|
95
|
+
if _under(parts, self.deny):
|
|
96
|
+
return False
|
|
97
|
+
return not self.allow or _under(parts, self.allow)
|
|
98
|
+
|
|
99
|
+
def roots(self) -> list[str]:
|
|
100
|
+
"""List the folders a walk of the store may start from.
|
|
101
|
+
|
|
102
|
+
A walk must not start at the store root when only some folders are open:
|
|
103
|
+
under `lantern guard` the root itself cannot be read.
|
|
104
|
+
|
|
105
|
+
Returns:
|
|
106
|
+
The open folders (one inside another is left out); [""] — the store root — when `allow` is empty.
|
|
107
|
+
|
|
108
|
+
Example:
|
|
109
|
+
>>> Access(allow=("2. Study", "2. Study/Backend", "3. Projects"), deny=("3. Projects",)).roots()
|
|
110
|
+
['2. Study']
|
|
111
|
+
>>> Access(deny=("4. Work",)).roots()
|
|
112
|
+
['']
|
|
113
|
+
"""
|
|
114
|
+
if not self.allow:
|
|
115
|
+
return [""]
|
|
116
|
+
roots: list[str] = []
|
|
117
|
+
for folder in sorted(self.allow, key=lambda f: len(_parts(f))):
|
|
118
|
+
if self.permits(folder) and not _under(_parts(folder), tuple(roots)):
|
|
119
|
+
roots.append(folder)
|
|
120
|
+
return roots
|