Skip to content

feat(arckit-build): v0.4 — file-hash change detection + orchestrator-side skill fallback #420

@tractorjuice

Description

@tractorjuice

Summary

Two related v0.4 items for the arckit-build skill (currently v0.4 banner, but with these features still listed under "Future versions"). Both are documented in arckit-claude/skills/arckit-build/SKILL.md § "Future versions" but not yet tracked as issues.

Item 1 — File-hash-based change detection

Today's idempotency rule is state.targets[id].status == "complete" AND file exists. This misses the case where an input file changed (e.g. you edited REQ) but a downstream artefact (RISK, HLD, …) wasn't rebuilt.

Proposed

  • Record SHA-256 of every input file at build time in state.targets[id].input_hashes
  • On next run, if any input's current hash ≠ recorded hash, mark the target as stale and rebuild it (plus everything downstream of it via the DAG)
  • Skip targets where all input hashes match — true idempotency, not just "I once finished"

Why now

The "State drift — user manually deletes/edits artefacts after build" failure mode in §"Failure modes" (SKILL.md) is currently detected only via test -f. Hash detection catches edits, not just deletions.

Item 2 — Orchestrator-side fallback for skills inaccessible to subagents

The current smoke-test (step 6 in the run order) catches the failure mode where subagents in this session don't have access to plugin skills, but gives up if it fails — halts and asks the user to fix the session.

Proposed

  • On NOT_AVAILABLE smoke-test response, the orchestrator reads the relevant arckit:* skill prompts itself (one-time, into main context)
  • Inlines those prompts as plain text into worker prompts, instead of relying on Skill({skill: "..."})
  • Workers then run the skill instructions without ever needing the Skill tool

Trade-off

Trades main-context tokens for resilience. It's the only way the harness works in sessions where plugin skills don't propagate to subagents. v1.0's dedicated arckit:artefact-worker subagent type makes this obsolete (see #TBD), but that's a much bigger refactor.

Acceptance criteria

  • state.json schema bumped to state_format_version: "0.4" with new input_hashes field per target
  • DAG-aware staleness propagation: editing REQ marks RISK, HLD, SOBC, PLAN, …, TRACE all stale, in dep order
  • --refresh NAME continues to force-rebuild regardless of hash status (existing behaviour)
  • New flag --skip-hash-check for users who want fast resume without staleness checks
  • Smoke-test failure no longer halts the build; orchestrator inlines skill prompts as fallback
  • Test on v48 test repo: edit ARC-001-REQ-v1.0.md, run /arckit:build 001 --resume, verify only the affected downstream artefacts rebuild

References

  • arckit-claude/skills/arckit-build/SKILL.md § "Future versions" → v0.4 line
  • arckit-claude/skills/arckit-build/SKILL.md § "Failure modes" → State drift, Subagent skill access
  • v4.13.1 baseline shipped 2026-05-03

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions