feat(lanes): clearLane archives the active feature before resetting (B)
This commit is contained in:
@@ -334,10 +334,16 @@ function recordDetection(id, { nodeId, signal } = {}) {
|
||||
* never be advanced past.
|
||||
*/
|
||||
function clearLane(id) {
|
||||
// Opt-in: only a lane that has activated a feature has anything to archive.
|
||||
// Requiring the module here (not at file top) avoids a require cycle —
|
||||
// lane-features.js itself requires this file for lanesLib.getLane/setStage.
|
||||
require("./lane-features").archiveActiveFeature(id);
|
||||
|
||||
db.prepare(
|
||||
`UPDATE lanes SET stage = 'idle', stage_since = ?, status = 'idle', gate_decision = NULL,
|
||||
ci_status = NULL, needs_action = NULL, stages = '{}', notes = NULL, run_id = NULL,
|
||||
detected_stage = NULL, detected_signal = NULL, detected_at = NULL,
|
||||
active_feature_id = NULL,
|
||||
updated_at = ? WHERE id = ?`
|
||||
).run(nowIso(), nowIso(), id);
|
||||
return getLane(id);
|
||||
|
||||
Reference in New Issue
Block a user