Commit graph

17 commits

Author SHA1 Message Date
Jeff Smith
a6333858ee test(ai): add unit coverage for pure helpers in ai.py (#55)
ai.py was documented as fully exempt from unit testing because the dir
loop and synthesis pass require a live Anthropic API. But several
helpers in the module are pure functions with no API dependency, and
they're the kind of thing that breaks silently. The #57 refactor added
two more (_build_dir_loop_context, _flush_partial_dir_entry) that are
also naturally testable.

New tests/test_ai_pure.py — 45 tests across 8 helpers:

- _should_skip_dir: exact-match, *.egg-info glob, no-match cases
- _path_is_safe: inside, nested, equals, outside, traversal,
  sibling-with-target-prefix (the easy-to-miss security case)
- _default_survey: shape, zero confidence guarantees no filtering,
  passes through _filter_dir_tools unchanged
- _format_survey_block: None, empty, minimal, with relevant_tools,
  with skip_tools, with domain_notes, empty-list omission
- _filter_dir_tools: None, empty, low confidence, high confidence
  filters, protected tools never removed, unknown skip silently
  ignored, garbage/None confidence treated as zero, threshold
  boundary inclusive
- _format_survey_signals: None, empty, zero total_files, full,
  partial (only extensions)
- _block_to_dict: text, tool_use, unknown type
- _flush_partial_dir_entry (#57): idempotent when entry exists,
  no-file-entries stub path, with-file-entries summary synthesis,
  notable_files collection

Uses the same _make_manager() pattern as test_cache.py to construct
a _CacheManager rooted in a tempdir, sidestepping CACHE_ROOT entirely.

Doc updates:
- CLAUDE.md, README.md, docs/wiki/DevelopmentGuide.md: ai.py is no
  longer fully exempt — only the API-dependent loops are. Pure
  helpers are covered by test_ai_pure.py.

Verification: 209 tests pass (164 prior + 45 new).
2026-04-11 10:24:47 -06:00
Jeff Smith
171a48f9e6 chore: update CLAUDE.md for session 9 2026-04-11 09:48:35 -06:00
Jeff Smith
c93c748ea3 feat: AI investigation is the product, drop zero-dep constraint (#64)
Two original design constraints are dropped:

1. Zero-dependency Python CLI is no longer a goal. Luminos installs from
   requirements.txt like a normal Python project.
2. AI investigation is the headline. The base scan becomes the agent's
   first input pass, not a standalone product. There is no --ai flag and
   no --no-ai mode. AI runs unconditionally on every invocation.

Watch mode is deleted as part of the same change because a non-AI
filesystem-churn monitor conflicts with the new philosophy. If a live
update mode is wanted later, it gets rebuilt as incremental AI
re-investigation.

Code:
- Delete luminos_lib/watch.py
- Delete luminos_lib/capabilities.py and tests/test_capabilities.py
- Move clear_cache() into luminos_lib/cache.py
- luminos.py: remove --watch, --ai, --install-extras flags. AI runs
  unconditionally after the base scan. If ANTHROPIC_API_KEY is unset,
  exit 0 with a one-line hint before running the base scan.
- ai.py: drop the check_ai_dependencies() call and import.
- New requirements.txt: anthropic, tree-sitter + grammars, python-magic.
- setup_env.sh installs from requirements.txt.

Docs:
- README.md rewritten to lead with AI investigation, drops the two-modes
  framing and the watch feature line.
- CLAUDE.md (project): rewrites Key Constraints, updates module map and
  Running Luminos commands.
- PLAN.md: strips zero-dep philosophy from the file map and reframes the
  watch+incremental note as a future live-mode feature.

Tests: 164 pass (down from 168 with the 4 removed capabilities tests).
2026-04-11 09:43:47 -06:00
Jeff Smith
f589bedf08 chore: update CLAUDE.md for session 8 2026-04-07 14:24:21 -06:00
Jeff Smith
4a847d20aa chore: update CLAUDE.md for session 7 2026-04-07 14:20:53 -06:00
Jeff Smith
fccbca0ce7 chore: update CLAUDE.md for session 6
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 13:48:44 -06:00
Jeff Smith
b2ead84531 chore: extract workflow sections to global ~/.claude/CLAUDE.md
Move Development Workflow, Branching Discipline, Documentation Workflow,
ADHD Session Protocols, and Session Protocols out of the project CLAUDE.md
and into the global one so all projects share them. Move docs/externalize.md
and docs/wrap-up.md to ~/.claude/protocols/ (lightly generalized). Project
CLAUDE.md keeps only luminos-specific state, module map, constraints,
naming, test command, and session log.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 13:47:41 -06:00
Jeff Smith
159ab5207a chore: update CLAUDE.md for session 5 2026-04-06 23:23:23 -06:00
Jeff Smith
74477d8c2a chore(workflow): manually close issues after merge, do not rely on auto-close 2026-04-06 22:58:01 -06:00
Jeff Smith
88ecdb9761 chore: update CLAUDE.md for session 4 2026-04-06 22:52:24 -06:00
Jeff Smith
0a9afc96c9 chore: update CLAUDE.md for session 3 2026-04-06 21:15:27 -06:00
Jeff Smith
6875cf5ed1 feat(tests): add unit test coverage for all testable modules (#37)
129 tests across cache, filetypes, code, disk, recency, tree, report,
and capabilities. Uses stdlib unittest only — no new dependencies.
Also updates CLAUDE.md development workflow to require test coverage
for all future changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 16:57:26 -06:00
Jeff Smith
c7bacb674f chore: update CLAUDE.md for session 2 2026-04-06 16:43:25 -06:00
Jeff Smith
309e3464bc chore: add dev workflow, branching discipline, ADHD protocols, session docs 2026-04-06 16:20:51 -06:00
Jeff Smith
77d4be0221 chore: rewrite CLAUDE.md — thin format, wiki references, dev practices 2026-04-06 16:13:20 -06:00
Jeff Smith
faccf28dd8 chore: document git workflow conventions in CLAUDE.md
Adds branch naming, commit message format, and merge procedure.
All future changes must start on a branch and merge to main with --no-ff.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 12:14:34 -06:00
Jeff Smith
da387289f3 chore: add venv setup script and update CLAUDE.md for optional deps
- setup_env.sh creates ~/luminos-env venv and installs all AI packages
- CLAUDE.md updated to reflect the new dependency model: base tool is
  zero-dep, --ai requires packages installed via venv
- Documents the capabilities module and updated ai.py architecture

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 12:14:13 -06:00