Skip to content

feat(spec-loop): add spec-scope deterministic mapper for the update beat#930

Open
justinmclean wants to merge 1 commit into
apache:mainfrom
justinmclean:spec-scope
Open

feat(spec-loop): add spec-scope deterministic mapper for the update beat#930
justinmclean wants to merge 1 commit into
apache:mainfrom
justinmclean:spec-scope

Conversation

@justinmclean

Copy link
Copy Markdown
Member

Summary

Add a spec-scope entry point to tools/spec-inventory that maps a list of changed file paths to the spec files most likely relevant to those changes. The update beat now pipes the output of git diff --name-only through spec-scope so the agent receives a pre-computed list of specs to inspect instead of deriving the mapping itself -- closing the known gap in specs/spec-loop-runner.md.

Pattern extraction reads each spec Where it lives section: backtick-quoted tokens containing a slash become path-prefix patterns, and Skill: name bullets produce skills/ patterns. .claude/skills/magpie- symlink entries are expanded to skills/ aliases so skill-name patterns resolve correctly.

Ships 18 new unit tests covering extract_path_patterns, _changed_path_candidates, scope_map, and the scope_main CLI. loop.sh is updated to call spec-scope inside update_scope_context and include the result in the context block for the update beat prompt. Failures from the mapper are non-fatal (advisory only).

Generated-by: Claude (claude-sonnet-4-6)

Type of change

  • Skill change (.claude/skills/<name>/) — eval fixtures updated below
  • Tool / bridge contract (tools/<system>/*.md)
  • Python package (tools/*/ with pyproject.toml)
  • Groovy reference impl
  • Cross-cutting (RFC, AGENTS.md, sandbox, privacy-LLM)
  • Documentation (docs/, README.md, CONTRIBUTING.md)
  • Project template (projects/_template/)
  • CI / dev loop (prek, workflows, validators)
  • Other:

Test plan

  • prek run --all-files passes
  • For Python packages touched: uv run pytest / ruff check / mypy passes
  • For Groovy bridges touched: command-line invocation tested end-to-end
  • For skill changes: eval suite passes for the affected skill
    (PYTHONPATH=tools/skill-evals/src python3 -m skill_evals.runner tools/skill-evals/evals/<skill>/)
  • For skill behaviour changes: a new or updated eval fixture is included in this PR
    (a regression test for the bug fixed / the behaviour added — see CONTRIBUTING.md)
  • Other:

Add a spec-scope entry point to tools/spec-inventory that maps a list of
changed file paths to the spec files most likely relevant to those changes.
The update beat now pipes the output of git diff --name-only through
spec-scope so the agent receives a pre-computed list of specs to inspect
instead of deriving the mapping itself -- closing the known gap in
specs/spec-loop-runner.md.

Pattern extraction reads each spec Where it lives section: backtick-quoted
tokens containing a slash become path-prefix patterns, and Skill: name bullets
produce skills/<name> patterns. .claude/skills/magpie-<name> symlink entries
are expanded to skills/<name> aliases so skill-name patterns resolve correctly.

Ships 18 new unit tests covering extract_path_patterns, _changed_path_candidates,
scope_map, and the scope_main CLI. loop.sh is updated to call spec-scope inside
update_scope_context and include the result in the context block for the update
beat prompt. Failures from the mapper are non-fatal (advisory only).

Generated-by: Claude (claude-sonnet-4-6)
@justinmclean justinmclean self-assigned this Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant