@brainervirus/workit-opencode 7.7.0 → 8.0.1

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.
@@ -51,8 +51,8 @@ the base keeps moving, or after 3 failed fix attempts on the same check.
51
51
  flake|infra` per head. Real: reproduce with `workit check`, fix the root
52
52
  cause, batch fixes into one push.
53
53
  6. **Verified.** After the last push a non-author records a verdict
54
- (call the skill tool with `workit-review`). Land only when granted: `workit stack land` (the
55
- contiguous verified run from the root) or `workit pr merge`.
54
+ (call the skill tool with `workit-review`). Land only when granted: `workit stack land` (verified run
55
+ from the root) or `workit pr merge`; `--unverified --reason` only if user-asked.
56
56
  7. **Observe it landed:** `workit verify-delivery pr` or `merge`. After a failed
57
57
  verdict or a check red 3+ times, at any endpoint: offer `/wk-retro` in one
58
58
  line of the final or stop report; never pause the babysit loop for it.
package/dist/plugin.js CHANGED
@@ -12723,7 +12723,7 @@ var independenceReasons = (row, authors) => {
12723
12723
  reasons.push("self");
12724
12724
  return reasons;
12725
12725
  };
12726
- function effectiveOf(rows, authors) {
12726
+ function effectiveOf(rows, authors, sameCode) {
12727
12727
  let effective = null;
12728
12728
  for (const row of rows) {
12729
12729
  if (!effective) {
@@ -12734,7 +12734,7 @@ function effectiveOf(rows, authors) {
12734
12734
  const effIndependent = independenceReasons(effective, authors).length === 0;
12735
12735
  if (effIndependent && !rowIndependent)
12736
12736
  continue;
12737
- if (effIndependent && FAILING.has(String(effective.result)) && row.actor.session === effective.actor.session)
12737
+ if (effIndependent && FAILING.has(String(effective.result)) && row.actor.session === effective.actor.session && sameCode(effective, row))
12738
12738
  continue;
12739
12739
  effective = row;
12740
12740
  }
@@ -12765,16 +12765,22 @@ function checkVerdicts(cwd, branch, rows) {
12765
12765
  const head = branchHead(cwd, branch);
12766
12766
  const fallbackBase = defaultBase(cwd);
12767
12767
  const keyCache = new Map;
12768
- const keyFor = (base) => {
12769
- if (!base || !head)
12768
+ const keysAt = (base, at) => {
12769
+ if (!base || !at)
12770
12770
  return { patchId: null, diffHash: null };
12771
- let key = keyCache.get(base);
12771
+ const cacheKey = `${base}\x00${at}`;
12772
+ let key = keyCache.get(cacheKey);
12772
12773
  if (!key) {
12773
- key = { patchId: patchId(cwd, base, head), diffHash: diffHash(cwd, base, head) };
12774
- keyCache.set(base, key);
12774
+ key = { patchId: patchId(cwd, base, at), diffHash: diffHash(cwd, base, at) };
12775
+ keyCache.set(cacheKey, key);
12775
12776
  }
12776
12777
  return key;
12777
12778
  };
12779
+ const keyFor = (base) => keysAt(base, head);
12780
+ const sameCode = (failed, row) => verdictBasis(failed, {
12781
+ head: row.head,
12782
+ ...keysAt(failed.base ?? fallbackBase, row.head)
12783
+ }) !== "stale" || restackCarries(rows, branch, failed.head, row.head);
12778
12784
  const authors = authorSessions(cwd, rows, branch, { base: fallbackBase, head });
12779
12785
  const byKind = new Map;
12780
12786
  for (const row of rows)
@@ -12784,7 +12790,7 @@ function checkVerdicts(cwd, branch, rows) {
12784
12790
  }
12785
12791
  const verdicts = [];
12786
12792
  for (const [kind, list] of byKind) {
12787
- const row = effectiveOf(list, authors);
12793
+ const row = effectiveOf(list, authors, sameCode);
12788
12794
  if (!row)
12789
12795
  continue;
12790
12796
  let basis = verdictBasis(row, { head, ...keyFor(row.base ?? fallbackBase) });
@@ -12810,11 +12816,11 @@ function checkVerdicts(cwd, branch, rows) {
12810
12816
  verdicts.sort((a, b) => a.verdict.seq - b.verdict.seq);
12811
12817
  const newestCurrent = verdicts.findLast((entry) => entry.current) ?? verdicts.at(-1) ?? null;
12812
12818
  const failing = verdicts.find((entry) => entry.current && entry.independent && FAILING.has(String(entry.verdict.result)));
12813
- const newestAccepted = verdicts.findLast((entry) => entry.accepted) ?? null;
12819
+ const newestAccepted = verdicts.findLast((entry) => entry.accepted && STRONG_RESULTS.has(String(entry.verdict.result))) ?? null;
12814
12820
  const accepted = newestAccepted && !failing ? { accepted: true, verdict: newestAccepted.verdict, reasons: [] } : {
12815
12821
  accepted: false,
12816
12822
  verdict: failing?.verdict ?? null,
12817
- reasons: failing ? ["failing_verdict"] : newestCurrent?.reasons ?? ["no_verdict"]
12823
+ reasons: failing ? ["failing_verdict"] : !newestCurrent ? ["no_verdict"] : newestCurrent.reasons.length ? newestCurrent.reasons : ["type_check_only"]
12818
12824
  };
12819
12825
  const selfEntry = failing ? undefined : verdicts.findLast((entry) => entry.current && !entry.independent && STRONG_RESULTS.has(String(entry.verdict.result)));
12820
12826
  return {
@@ -12830,7 +12836,7 @@ function checkVerdicts(cwd, branch, rows) {
12830
12836
  authors: [...authors].toSorted()
12831
12837
  };
12832
12838
  }
12833
- var OBSERVED_ONLY = new Set(["check", ...PR_ROW_TYPES]);
12839
+ var OBSERVED_ONLY = new Set(["check", "merge.unverified", ...PR_ROW_TYPES]);
12834
12840
 
12835
12841
  // packages/workit-core/src/core/policy/derive.ts
12836
12842
  var RULES = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/workit-opencode",
3
- "version": "7.7.0",
3
+ "version": "8.0.1",
4
4
  "private": false,
5
5
  "description": "Workit OpenCode plugin — native tools, adaptive policy, and sixteen method skills",
6
6
  "keywords": [
@@ -39,7 +39,7 @@
39
39
  "typecheck": "tsc --noEmit"
40
40
  },
41
41
  "dependencies": {
42
- "@brainervirus/workit-core": "^7.7.0"
42
+ "@brainervirus/workit-core": "^8.0.1"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@opencode/plugin": "2.0.18"