Skip to content

fix: loop artifact scoping, PRD regeneration, namespace propagation, graph-before-planning#324

Merged
callmeradical merged 3 commits intomainfrom
dev
Apr 11, 2026
Merged

fix: loop artifact scoping, PRD regeneration, namespace propagation, graph-before-planning#324
callmeradical merged 3 commits intomainfrom
dev

Conversation

@callmeradical
Copy link
Copy Markdown
Owner

Summary

  • Loop artifacts scoped per-loop: All artifacts now under .smith/<loop-id>/ instead of shared .smith/loop/. Prevents concurrent loops from overwriting each other.
  • Stale PRD regeneration: When existing PRD has all stories done, force PRD regeneration from issue body instead of skipping. Closes bug: implementation stage runs zero iterations without story selection #323.
  • Planning docs per-loop: Tech spec and implementation plan scoped to loop directory. Closes bug: tech-spec and implementation-plan overwrite shared paths #322.
  • Graph before planning: Knowledge graph built before tech planning stage so spec/plan agents can query codebase structure.
  • Namespace propagation: target_namespace from project config now injected into loop metadata. Defaults to smith-system. Closes dispatch failures.
  • Namespace in Smithfile: New namespace field so repos can declare their loop namespace.

Test plan

  • go test ./internal/cli/replica/ passes (including updated artifact test)
  • go test ./cmd/smith-api/ passes
  • go build ./... clean

🤖 Generated with Claude Code

Lars Cromley and others added 3 commits April 11, 2026 18:36
…c and plan prompts

Graph was built during prepareLoopReferences (after planning),
meaning the tech spec and implementation plan agents had no
codebase structure to reference. Now buildKnowledgeGraph runs
before the planning stage, and the graph path is passed to both
buildTechSpecPrompt and buildImplementationPlanPrompt so agents
can query architecture before writing specs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nning docs per-loop

Two bugs from smith's first self-hosted loop:

1. When an existing PRD has all stories marked done, the loop skipped
   PRD generation and immediately exited the implementation stage with
   zero iterations (all work already complete). Now detects stale PRDs
   and forces regeneration from the issue body. Closes #323.

2. Tech spec and implementation plan were written to shared paths
   (.agents/tasks/) overwriting existing docs. Now scoped to
   .smith/loop/ which is per-loop workspace. Closes #322.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All loop artifacts (guardrails, progress, errors, activity, run log,
run summary, graph, tech spec, implementation plan, build instructions,
project guardrails) are now written to .smith/<loop-id>/ instead of
the shared .smith/loop/ directory.

This prevents multiple loops from overwriting each other's artifacts
and provides full per-loop history. The loopDir() helper sanitizes
the loop ID for filesystem safety.

Updated: prepareLoopReferences, materializeSmithfileBuildArtifacts,
buildKnowledgeGraph, runTechPlanning, loopArtifactSpecs, and tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@callmeradical callmeradical merged commit 31148d2 into main Apr 11, 2026
29 checks passed
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.

bug: implementation stage runs zero iterations without story selection bug: tech-spec and implementation-plan overwrite shared paths

1 participant