@workit-dev/codex 1.0.4 → 1.1.2

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "workit",
3
- "version": "1.0.4",
3
+ "version": "1.1.2",
4
4
  "description": "Adaptive engineering workflow rails for Codex",
5
5
  "author": {
6
6
  "name": "BrainerVirus"
@@ -22724,36 +22724,54 @@ var DESCRIPTORS = {
22724
22724
  pi: PI_DESCRIPTOR
22725
22725
  };
22726
22726
  var workerOfLead = (input) => input.session.agentType === null || workitRole(DESCRIPTORS[input.host], input.session.agentType) !== null;
22727
- var worksFor = (plan, input, branch) => {
22727
+ var worksFor = (plan, input, branches) => {
22728
22728
  const session = input.session.id;
22729
22729
  if (plan.leads.includes(session) && !input.session.agentId)
22730
- return false;
22730
+ return null;
22731
+ if (branches.some((branch) => plan.branches.includes(branch)))
22732
+ return "slice";
22731
22733
  const lead = leadOf2(input);
22732
22734
  if (lead && plan.leads.includes(lead) && workerOfLead(input))
22733
- return true;
22734
- if (plan.leads.some((each) => session.startsWith(`${each}-w-`)))
22735
- return true;
22736
- const current = branch();
22737
- return current !== null && plan.branches.includes(current);
22735
+ return "lead";
22736
+ return plan.leads.some((each) => session.startsWith(`${each}-w-`)) ? "lead" : null;
22737
+ };
22738
+ var agentBranches = (input, rows) => {
22739
+ const { id, agentId } = input.session;
22740
+ const bound = agentId ? rows.findLast((row) => row.type === "worktree.bound" && row.actor.session === id && row.actor.agentId === agentId && typeof row.worktree === "string")?.worktree : undefined;
22741
+ const dirs = typeof bound === "string" ? [input.cwd, bound] : [input.cwd];
22742
+ return dirs.map((dir) => currentBranch(dir)).filter((branch) => !!branch);
22738
22743
  };
22739
22744
  var standingFor = (input, store, rev) => {
22740
22745
  const orders = new Map;
22741
22746
  const ledger = readLedger(input.cwd);
22742
22747
  const rows = ledger.ok ? ledger.value.rows : [];
22743
- let branch;
22744
- const lazyBranch = () => branch === undefined ? branch = currentBranch(input.cwd) : branch;
22745
- for (const plan of readPlans(store))
22746
- if (worksFor(plan, input, lazyBranch))
22747
- for (const row of activeStanding(rows, plan.name, plan.leads.length ? plan.leads : null))
22748
- orders.set(row.id, row);
22749
- return { rev, orders, rows };
22748
+ const branches = agentBranches(input, rows);
22749
+ const matched = readPlans(store).map((plan) => ({
22750
+ plan,
22751
+ how: worksFor(plan, input, branches)
22752
+ }));
22753
+ const tied = matched.some(({ how }) => how === "slice");
22754
+ const plans = matched.filter(({ how }) => tied ? how === "slice" : how !== null);
22755
+ for (const { plan } of plans)
22756
+ for (const row of activeStanding(rows, plan.name, plan.leads.length ? plan.leads : null))
22757
+ orders.set(row.id, row);
22758
+ return {
22759
+ rev,
22760
+ orders,
22761
+ rows,
22762
+ fanouts: new Set(plans.map(({ plan }) => plan.name))
22763
+ };
22750
22764
  };
22751
22765
  var located = (input) => {
22752
22766
  const store = input.session.id ? gitStoreDir2(input.cwd) : null;
22753
22767
  const rev = store ? readStandingRev2(store) : null;
22754
22768
  if (!store || rev === null)
22755
22769
  return null;
22756
- return { store, rev, file: standingSeenFile2(store, input.session.id, input.session.agentId) };
22770
+ return {
22771
+ store,
22772
+ rev,
22773
+ file: standingSeenFile2(store, input.session.id, input.session.agentId)
22774
+ };
22757
22775
  };
22758
22776
  var seedStanding = (input) => {
22759
22777
  try {
@@ -22761,7 +22779,10 @@ var seedStanding = (input) => {
22761
22779
  if (!where)
22762
22780
  return;
22763
22781
  const now = standingFor(input, where.store, where.rev);
22764
- writeStandingSeen2(where.file, { rev: where.rev, ids: [...now.orders.keys()] });
22782
+ writeStandingSeen2(where.file, {
22783
+ rev: where.rev,
22784
+ ids: [...now.orders.keys()]
22785
+ });
22765
22786
  } catch {}
22766
22787
  };
22767
22788
  var fanoutOf = (row) => typeof row.fanout === "string" ? row.fanout : "?";
@@ -22769,7 +22790,7 @@ var changedSince = (now, ids) => {
22769
22790
  const known = new Set(ids);
22770
22791
  const added = [...now.orders.values()].filter((row) => !known.has(row.id));
22771
22792
  const byId = new Map(now.rows.map((row) => [row.id, row]));
22772
- const dropped = ids.filter((id) => !now.orders.has(id)).map((id) => byId.get(id)).filter((row) => row !== undefined);
22793
+ const dropped = ids.filter((id) => !now.orders.has(id)).map((id) => byId.get(id)).filter((row) => row !== undefined && now.fanouts.has(fanoutOf(row)));
22773
22794
  if (!added.length && !dropped.length)
22774
22795
  return null;
22775
22796
  const fanouts = [...new Set([...added, ...dropped].map(fanoutOf))].join(", ");
@@ -22792,7 +22813,10 @@ var standingDelta = (input) => {
22792
22813
  if (seen.rev === where.rev)
22793
22814
  return null;
22794
22815
  const now = standingFor(input, where.store, where.rev);
22795
- writeStandingSeen2(where.file, { rev: where.rev, ids: [...now.orders.keys()] });
22816
+ writeStandingSeen2(where.file, {
22817
+ rev: where.rev,
22818
+ ids: [...now.orders.keys()]
22819
+ });
22796
22820
  return changedSince(now, seen.ids);
22797
22821
  } catch {
22798
22822
  return null;
@@ -84,7 +84,7 @@ if (quiet) {
84
84
  `);
85
85
  } else {
86
86
  try {
87
- const { runCodexHook } = await import("./workit-hook-f602mw4d.js");
87
+ const { runCodexHook } = await import("./workit-hook-p3rqtsq1.js");
88
88
  await runCodexHook([payload]);
89
89
  } catch (error) {
90
90
  const { answerRuntimeFailure } = await import("./workit-hook-ehy7rps6.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workit-dev/codex",
3
- "version": "1.0.4",
3
+ "version": "1.1.2",
4
4
  "private": false,
5
5
  "description": "Workit Codex CLI/desktop plugin — shared MCP transport, hooks, method skills, and verifier/reviewer/implementer agents",
6
6
  "keywords": [
@@ -41,8 +41,8 @@
41
41
  "build": "bun scripts/build.ts"
42
42
  },
43
43
  "devDependencies": {
44
- "@workit-dev/core": "^1.0.4",
45
- "@workit-dev/mcp": "^1.0.4"
44
+ "@workit-dev/core": "^1.1.2",
45
+ "@workit-dev/mcp": "^1.1.2"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">=24"
@@ -54,7 +54,7 @@ units of ~100+ lines each. Coupled work stays with one owner. Workit never spawn
54
54
  landed. Then `workit ledger check --branch <b>` per slice, land in `fanout
55
55
  status` order, release the worktrees you made, and `workit ledger standing
56
56
  clear`. Only you touch topology: workers never rebase, retarget or merge,
57
- except the integration-tip merge in integration mode. Then ship
57
+ except the integration-tip rebase (integration mode). Then ship
58
58
  (read the `workit-ship` skill's SKILL.md and follow it) up to `defaultEndpoint` from `workit grant show`.
59
59
 
60
60
  ## Example
@@ -21,7 +21,7 @@ TIER: <mundane | standard | hard: how much model the slice needs>
21
21
  TIMEBOX: <wall clock, N tool calls (hard: 180, else 120) and the call by which the full gates ran (60%); past it without a new commit you will be replaced>
22
22
  SCRATCH: <your own temp dir: the one `fanout worktree create` printed, else `mktemp -d`; never a shared path>
23
23
  FORBIDDEN: <no edits outside SCOPE; no new dependencies; ...>
24
- FAN-IN: <one PR per slice: no rebase, retarget, merge or force-push | integration: merge the integration tip before reporting, nothing else>
24
+ FAN-IN: <one PR per slice: no rebase, retarget, merge or force-push | integration: rebase onto the integration tip, nothing else>
25
25
  REPORT: branch, head SHA, files changed, each VERIFY command with its exit code,
26
26
  each ACCEPTANCE line met / not met, rulings you made (`workit ledger ruling`),
27
27
  anything out of scope as a follow-up, not a diff.
@@ -153,12 +153,12 @@ Only when the user wants one PR for the whole fanout:
153
153
  <trunk>`) and plan with `"fanIn": "integration"` and `--trunk
154
154
  <integration>`. Planning refuses integration mode on origin's default
155
155
  branch.
156
- 2. Every brief then tells the worker to merge the integration tip into its
157
- branch before reporting (the fast-forward rule). That merge is the only
158
- one a worker makes, and only in this mode.
156
+ 2. Every brief then tells the worker to run `workit git rebase --onto
157
+ <integration>` before reporting (the fast-forward rule): its only rebase,
158
+ and only in this mode. A conflict comes back to you.
159
159
  3. Land each verified slice with `git merge --ff-only <slice-branch>` in the
160
160
  integration checkout. Not a fast-forward (the tip moved since the worker
161
- merged)? Resume the worker to merge again; never a merge commit of your own.
161
+ rebased)? Resume the worker to rebase again; never a merge commit of your own.
162
162
  4. `workit fanout check` gates against the integration branch; a slice whose
163
163
  tip is on it reads as landed. When all have landed, ship the integration
164
164
  branch as one PR (read the `workit-ship` skill's SKILL.md and follow it).
@@ -41,7 +41,7 @@ the same check. Fix round and recheck both failed: a decider (read the `workit-f
41
41
  and the stop point unless merge is granted.
42
42
  3. **Conflicts or a required rebase.** Rewrite only a branch this session or
43
43
  its stack created (yours in `workit ledger list --type commit.recorded` or
44
- `workit stack status`): rebase onto the base, `workit git push
44
+ `workit stack status`): `workit git rebase`, then `workit git push
45
45
  --force-with-lease` (`workit stack sync` in a stack). Anyone else's branch:
46
46
  report that a rebase is needed and stop.
47
47
  4. **Review threads** (`workit pr threads`). Check each claim in the code; fix