mirror of
https://github.com/Permissionless-Software-Foundation/psf-memo.git
synced 2026-09-21 16:52:01 -07:00
Block handoffs from a dirty working tree
Unrelated tracked changes could ride along with a handoff. Refuse to send when git status --porcelain is non-empty, list the offending files, and keep the draft so it can be fixed and resent. SWARMFORGE_ALLOW_DIRTY=1 overrides. By specifier.
This commit is contained in:
+8
-7
@@ -459,13 +459,14 @@ At the end of each session, update this file:
|
|||||||
- Note the current `master` HEAD commit.
|
- Note the current `master` HEAD commit.
|
||||||
- State the next feature to work on.
|
- State the next feature to work on.
|
||||||
|
|
||||||
Current `master` HEAD: `c8ceb82` (merged architect's thread-query-bounds job —
|
Current `master` HEAD: `a5f8967` (thread-query-bounds merged at `c8ceb82`, then
|
||||||
`GET /posts/:txid/thread` now counts likes only for the thread's txids via
|
a process-improvement pass on this branch: the architect now always notifies
|
||||||
`countLikesForTxids` and prefix-scans `postChildren` per parent through a new
|
the specifier; acceptance LevelDB temp dirs are cleaned up; the handoff daemon
|
||||||
`PostQuery.listChildTxids` seam, so its work is proportional to the thread
|
is self-healing; APS is single-sourced at `tmp/aps`; acceptance generation is
|
||||||
rather than the database. Spec:
|
incremental; `verify.sh` emits a machine-readable verification record;
|
||||||
`psf-memo-db/specs/thread-query-performance.feature`. Verified psf-memo-db unit
|
`mutate-file.sh` guards differential under-selection; and `clean-builds.sh`
|
||||||
(357) + property (44) + acceptance (all 11 suites) + lint all passing).
|
keeps mutation worker copies small. Run `swarmforge/scripts/state.sh` to refresh
|
||||||
|
these HEAD lines.)
|
||||||
Next action: **TBD** — current direction is front-end improvements to
|
Next action: **TBD** — current direction is front-end improvements to
|
||||||
`psf-memo-client` (UI/UX polish, accessibility, performance, responsiveness,
|
`psf-memo-client` (UI/UX polish, accessibility, performance, responsiveness,
|
||||||
state handling, error surfacing). See `specs/feature-backlog.md`.
|
state handling, error surfacing). See `specs/feature-backlog.md`.
|
||||||
|
|||||||
@@ -302,6 +302,20 @@
|
|||||||
(fs/move tmp-file outbox-file)
|
(fs/move tmp-file outbox-file)
|
||||||
outbox-file))
|
outbox-file))
|
||||||
|
|
||||||
|
(defn dirty-files []
|
||||||
|
(->> (:out (command "." "git" "status" "--porcelain"))
|
||||||
|
str/split-lines
|
||||||
|
(remove str/blank?)))
|
||||||
|
|
||||||
|
(defn guard-clean-tree! []
|
||||||
|
(let [dirty (dirty-files)]
|
||||||
|
(when (and (seq dirty) (not (System/getenv "SWARMFORGE_ALLOW_DIRTY")))
|
||||||
|
(binding [*out* *err*]
|
||||||
|
(println "HANDOFF BLOCKED: working tree has uncommitted changes.")
|
||||||
|
(doseq [line dirty] (println " " line))
|
||||||
|
(println "Commit or stash them, or set SWARMFORGE_ALLOW_DIRTY=1 to send anyway."))
|
||||||
|
(System/exit 3))))
|
||||||
|
|
||||||
(defn error-report [draft errors]
|
(defn error-report [draft errors]
|
||||||
(binding [*out* *err*]
|
(binding [*out* *err*]
|
||||||
(println "HANDOFF INVALID:" (str draft))
|
(println "HANDOFF INVALID:" (str draft))
|
||||||
@@ -328,6 +342,7 @@
|
|||||||
(when (seq all-errors)
|
(when (seq all-errors)
|
||||||
(error-report draft all-errors)
|
(error-report draft all-errors)
|
||||||
(System/exit 2))
|
(System/exit 2))
|
||||||
|
(guard-clean-tree!)
|
||||||
(let [outbox-file (write-handoff! {:headers headers
|
(let [outbox-file (write-handoff! {:headers headers
|
||||||
:recipients (:recipients validation)
|
:recipients (:recipients validation)
|
||||||
:canonical-commit (:canonical-commit validation)
|
:canonical-commit (:canonical-commit validation)
|
||||||
|
|||||||
Reference in New Issue
Block a user