@mrciphersmith/keryx 0.2.37 → 0.2.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrciphersmith/keryx",
3
- "version": "0.2.37",
3
+ "version": "0.2.39",
4
4
  "description": "Version-controlled project context for AI coding agents: code graph, architecture wiki, project memory, relevant tests, quality signals, and task flows.",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -81,12 +81,17 @@ flowchart TD
81
81
  G --> H{"All tasks, checks, review OK?"}
82
82
  H -- "no" --> F
83
83
  H -- "yes" --> I{"Ask user how to finish"}
84
- I -- "draft PR" --> J["create or confirm draft PR"]
85
- J --> K["keryx flow implemented --pr"]
86
- K --> L["confirm AC evidence"]
87
- L --> M["keryx flow complete"]
88
- I -- "verified handoff" --> N["report completion; keep flow in-progress"]
89
- I -- "keep open" --> O["journal next steps; keep flow in-progress"]
84
+ I -- "create PR" --> J["create PR and run review/fix loop"]
85
+ J --> K{"review clean, PR mergeable?"}
86
+ K -- "no, attempts < 6" --> J
87
+ K -- "no, attempts = 6" --> R["enrich context and change fix strategy"]
88
+ R --> J
89
+ K -- "yes" --> L["merge PR into recorded base branch"]
90
+ L --> M["keryx flow implemented --pr"]
91
+ M --> N["confirm AC evidence"]
92
+ N --> O["keryx flow complete"]
93
+ I -- "verified handoff" --> P["report completion; keep flow in-progress"]
94
+ I -- "keep open" --> Q["journal next steps; keep flow in-progress"]
90
95
  ```
91
96
 
92
97
  ## Phase 0: Route And Resume
@@ -107,6 +112,9 @@ keryx flow init --title "<short formalized problem>"
107
112
  ```
108
113
 
109
114
  5. Run `keryx flow status <id>` and read the flow package.
115
+ 6. Record the git base branch from which the flow branch was created in
116
+ `context.md` and `journal.md`; the PR must later be merged into this exact
117
+ branch.
110
118
 
111
119
  ## Phase 1: Initialize The Flow Package
112
120
 
@@ -288,7 +296,7 @@ When tasks, verification and review are complete:
288
296
  ```text
289
297
  How should this flow end?
290
298
 
291
- A) Create a draft PR and complete the managed flow
299
+ A) Create a PR, review it, merge it into the flow's base branch, and complete the managed flow
292
300
  B) Finish with a verified handoff and no PR
293
301
  C) Keep the flow open for more work
294
302
 
@@ -297,11 +305,34 @@ How should this flow end?
297
305
 
298
306
  3. Follow the selected outcome:
299
307
 
300
- - **A - Draft PR:** create or confirm a draft PR in the author's name, then
301
- record it through the CLI:
308
+ - **A - Create PR and merge:** create or confirm a PR in the author's name.
309
+ Preserve the base branch recorded during initialization. Do not mark the
310
+ flow implemented or complete before the PR is merged into that branch.
311
+
312
+ ### PR review/fix loop
313
+
314
+ 1. Run the relevant `review-orchestrator` checks against the PR and current
315
+ branch state.
316
+ 2. If findings or required check failures remain, create or update a flow fix
317
+ task, dispatch `task-implementer`, push the fix, and run review again.
318
+ 3. Allow at most six review/fix attempts for the current approach. Count an
319
+ attempt when review/check results are available, including a clean result.
320
+ 4. If attempt six is not clean, do not blindly repeat the same loop. Enrich
321
+ context from the findings, affected graph, relevant wiki, and
322
+ health/testing artifacts; identify the likely cycle cause; choose a
323
+ materially different fix strategy or split the work into narrower tasks;
324
+ record the decision in `journal.md`; then continue with the enriched
325
+ context.
326
+ 5. Never merge while findings or required checks remain unresolved. If the
327
+ re-planned approach still cannot produce a mergeable PR, leave the flow
328
+ `in-progress` and report the blocker instead of forcing completion.
329
+
330
+ When the PR is mergeable and required checks are green, merge it into the
331
+ recorded base branch (the branch from which the flow branch was created),
332
+ verify that the merge completed, and only then record it through the CLI:
302
333
 
303
334
  ```bash
304
- keryx flow implemented <id> --pr <draft-pr-url>
335
+ keryx flow implemented <id> --pr <pr-url>
305
336
  ```
306
337
 
307
338
  - **B - Verified handoff without PR:** do not create a PR and do not run
@@ -313,7 +344,8 @@ keryx flow implemented <id> --pr <draft-pr-url>
313
344
  - **C - Keep open:** record remaining or deferred work in `journal.md`, report
314
345
  the current verification state, and leave the flow `in-progress` for resume.
315
346
 
316
- Only continue to Phase 5 after the user selects A and the draft PR is recorded.
347
+ Only continue to Phase 5 after the user selects A, the review/fix loop is
348
+ clean, and the merge into the recorded base branch is confirmed.
317
349
 
318
350
  ## Phase 5: Complete The Flow
319
351
 
@@ -331,6 +363,10 @@ Then run:
331
363
  keryx flow complete <id>
332
364
  ```
333
365
 
366
+ Completion is allowed only after the PR merge has been confirmed. The merge
367
+ target must be the base branch captured when the flow was created; do not
368
+ silently retarget or close against another branch.
369
+
334
370
  If gates fail, the CLI returns the flow to `in-progress`. Add a journal note,
335
371
  create fix tasks, and repeat Phase 2.
336
372