Description
Make the custom Git-source lifecycle understandable and preflight failures before users wait for automatic behavior that does not exist. Surface the full configured-to-fetched-to-staged-to-loaded transition and the required restart.
Acceptance Criteria
- #1 Source creation validates HTTPS URL, stable ID, namespace slug, and ref before saving
- #2 Users can add and test/fetch a source in one guided operation with actionable authentication/network errors
- #3 The UI reports fetched file count, effective names, fetched SHA, loaded SHA, and pending-restart state
- #4 Wording says Add source, Fetch now, then restart to apply; polling is described as change detection rather than automatic apply
- #5 Pending banners provide deployment-specific restart commands and after restart show loaded versus skipped results
Definition of Done
- #1 make gate (build vet test race rw-proto-check spdx-check forbidden-words)
- #2 make blueprint-schema (only if a blueprint field or construct/workload config struct changed)
- #3 DRY_RUN=true go run ./cmd/synthkit -once -dump — inventory diffed against signals/
Implementation Plan
- Test and implement strict Git-source validation plus a guided add-and-fetch operation without changing the apply-on-restart contract.\n\n2. Persist and expose fetched SHA/file/effective-name state separately from loaded SHA and pending restart.\n\n3. Update the source-management UI and documentation with deployment-specific restart guidance and loaded/skipped results.\n\n4. Run focused Go/UI/docs checks, integrate shared control wiring, obtain root CodeRabbit review, then run the full gate and inventory proof.
Formatting correction to the preceding single-line rendering:
- Test and implement strict Git-source validation plus a guided add-and-fetch operation without changing the apply-on-restart contract.
- Persist and expose fetched SHA/file/effective-name state separately from loaded SHA and pending restart.
- Update the source-management UI and documentation with deployment-specific restart guidance and loaded/skipped results.
- Run focused Go/UI/docs checks, integrate shared control wiring, obtain root CodeRabbit review, then run the full gate and inventory proof.
Implementation Notes
Continuation authorized with a fresh CodeRabbit budget and live reference-stack/standing-host verification. Root owns all external writes and will record only de-identified evidence in this public tracker.
Wave A implementation complete pending standing-host verification. Strict source validation, guided add-and-fetch, fetched/observed/loaded lifecycle state, restart guidance, and skipped-result reporting are implemented. CodeRabbit review found and the implementation repaired a concurrent source-update race by serializing persisted read-modify-write state while rejecting stale network results. Focused Go/UI/docs checks, race/vet, the full make gate, and the dry-run inventory completed successfully.
Standing-host verification passed at exact image revision b6c4ea5. A public source was added and fetched at that SHA: 26 files and effective names were exposed with pending restart true. After a Compose restart, loaded SHA equalled fetched SHA, pending restart cleared, and all 26 intentionally deselected files were reported explicitly while the selected built-in remained the only active blueprint. The temporary source and staged files were removed and a clean restart left no pending changes.
Final Summary
Implemented strict Git-source validation, guided add-and-fetch, separate fetched/observed/loaded lifecycle state, restart guidance, and loaded/skipped reporting. Verified with focused Go and UI tests, CodeRabbit, make gate, dry-run inventory, and an exact-head standing-host add/fetch/restart/cleanup exercise.