feat: add type annotations to core and tasks modules#3
Closed
Tokenized2027 wants to merge 10 commits intoleonprou:mainfrom
Closed
feat: add type annotations to core and tasks modules#3Tokenized2027 wants to merge 10 commits intoleonprou:mainfrom
Tokenized2027 wants to merge 10 commits intoleonprou:mainfrom
Conversation
Spec the .openstation-only convention: drop dual-path prefix, define vault_path helper, migration checklist for all modules
Research shared artifacts across worktrees; recommended runtime resolution in find_root() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove prefix parameter, add vault_path() helper, simplify find_root() to return single root path with .openstation/ hardcoded
… from all signatures Drop the dual-path vault detection (root-level source repo vs .openstation/). All vault files now live under .openstation/ with a single code path. - Remove `prefix` parameter from remaining run.py functions (cmd_run, cmd_agents_list, cmd_agents_show, _find_agent_artifact, _agent_not_found) - Replace all `if prefix:` path branching with core.vault_path() - Remove source-guard check from init.py (agents/ + install.sh detection) - Update all 7 test files: vault fixtures use .openstation/ + git init, remove source-repo test cases, fix hardcoded path references - Remove stale .specify/ and content artifacts All 416 tests pass. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The zipapp used importlib.metadata which has no package metadata, so --version always showed "dev". Now generates _version.py at build time and falls back to importlib.metadata for pip installs. Also bumps install.sh OPENSTATION_VERSION to v0.11.0. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The 0173 convention moved commands/, skills/, docs/, templates/, and agents/ under .openstation/ in the source repo, but init.py still referenced the old root-level paths — breaking `os init`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace hardcoded INIT_DOCS, INIT_SKILLS, and INIT_DEFAULT_AGENTS with _discover_docs(), _discover_skills(), and _discover_templates() so new files are picked up automatically without editing init.py. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add from __future__ import annotations to core.py and tasks.py - Add typing imports (Any, Optional) where needed - Annotate all public function signatures in core.py (29 functions) - Annotate all public function signatures in tasks.py (13 functions) - Add py.typed PEP 561 marker so type checkers recognise the package - No logic changes, no new dependencies, no docstring additions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Type annotations added to the two foundational modules (
core.pyandtasks.py) plus apy.typedPEP 561 marker file.core.py— 29 public functions annotated, including:find_root,vault_path,tasks_dir_pathparse_frontmatter,parse_multiline_value,parse_inline_list,parse_frontmatter_list,parse_frontmatter_for_json,extract_body,strip_wikilinkslugify,title_from_description,shlex_joininfo,err,warn,header,step,detail,success,failure,hint,remaining_line,format_duration,tips_block,summary_blockset_quiet,set_run_starttasks.py— 13 public functions annotated, including:discover_tasks,resolve_task,group_tasks_for_display,format_tablevalidate_transition,allowed_fromupdate_frontmatter,next_task_id,create_task_filecmd_list,cmd_show,cmd_create,cmd_statusWhy
resolve_taskreturningtuple[str | None, str | None, int]is immediately clear to a readerScope and approach
from __future__ import annotationsat the top of each file — clean Python 3.9+ compatible syntax with no runtime costfrom typing import Any, Optionalonly where needed (union types useX | Ysyntax via the future import)_check_dir,_git_toplevel,_use_color, etc.) intentionally left unannotatedpy.typedempty marker file signals to PEP 561-aware type checkers that this package supports typingTests
All existing tests continue to pass. The annotation-only changes introduce no behavioural differences.