Skip to content

feat(sync): prepare inputs before resolving generated sources - #89

Draft
srnnkls wants to merge 2 commits into
fix/bound-transitive-sourcesfrom
feat/prepare-targets
Draft

srnnkls wants to merge 2 commits into
fix/bound-transitive-sourcesfrom
feat/prepare-targets

Conversation

@srnnkls

@srnnkls srnnkls commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Summary

Generated sources were resolved before their input targets deployed, forcing consumers to stage Tropos and Loqui through a second Phora project before running Henia. This adds a native preparation boundary so one root phora.toml / phora.local.toml pair can complete the whole sync:

pre_sync → prepare inputs → post_prepare (Henia) → resolve/deploy .henia outputs → post_sync (Scrut)

  • Add phase = "prepare" targets and an ordered, fail-fast post_prepare hook. Imported subtrees inherit the consumer's phase; ordinary targets keep the default deployment phase. Package manifests are composed before preparation, while generated file sources are resolved afterward.
  • Keep one registry, journal, and project lock. Phase-scoped reconciliation preserves deployment records during input pruning. Skipped inputs and preparation/build failures stop deployment, retaining unvisited pins, including separate refs of a shared import. Prepared inputs remain available for retry; arbitrary hook side effects are not rolled back.
  • Add update --prune for removing obsolete generated links in the same update, and document the declarative Tropos/Henia configuration. Frozen replay and --no-hooks retain their existing policies.
  • Recover an empty cache at the locked package commits: ordinary sync fetches missing mirrors before reading imported manifests, while --frozen remains offline. This lets a fresh deployment start with only configuration and pins.

Stacked on #88; base branch: fix/bound-transitive-sources.

Validation

  • cargo test --all-targets: 2,222 passed, 0 failed, 1 existing ignored; doctests passed.
  • cargo fmt --check and cargo clippy --all-targets -- -D warnings: passed, including the unchanged state-store architecture gate.
  • All CLI Scrut suites: 197 passed. Ten new Rust lifecycle regressions cover first-run generation, transitive inputs, failures/retries, conflicts, pruning, separate import refs, configuration merging, physical destination overlap, and recovery after deleting cache, state, prepared inputs and generated output without advancing Tropos or Loqui pins.
  • Real Tropos + transitive Loqui + Henia: 112 artifacts built, all four harness contract checks passed, combined dotfiles deployment and frozen replay passed. Dotfiles builds directly from ~/projects/tropos/.worktrees/henia-phora; Phora prepares only Loqui in that checkout, and Henia writes dotfiles’ .henia outputs. The old resources/tropos copy was removed. Canonical Tropos files and existing edits stayed unchanged, Loqui kept its pin, and deployment targets stayed in a temporary home under an OS sandbox. Dotfiles utility regressions: 7 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.

1 participant