@brainervirus/workit-core 1.3.1 → 2.0.0

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": "@brainervirus/workit-core",
3
- "version": "1.3.1",
3
+ "version": "2.0.0",
4
4
  "private": false,
5
5
  "description": "Workit shared core — task, policy, evidence, review, decision, worker, and writer state for agentic coding workflows",
6
6
  "keywords": [
@@ -39,13 +39,12 @@ const TYPE_LEVEL: Record<string, Level> = { fix: "patch", perf: "patch", feat: "
39
39
 
40
40
  const subjectLevel = (commit: string): Level | null => {
41
41
  const firstLine = commit.split("\n")[0] ?? "";
42
- const m = /^(?:fix|perf|feat)(?:\([^)]*\))?!?:/.exec(firstLine);
42
+ const m = /^([a-z][a-z0-9-]*)(?:\([^)]*\))?(!)?:/.exec(firstLine);
43
43
  if (!m) return null;
44
- if (m[0].includes("!")) return "major";
44
+ if (m[2]) return "major";
45
45
  const body = commit.split("\n").slice(1).join("\n");
46
- return /BREAKING[- ]CHANGE:/.test(body)
47
- ? "major"
48
- : TYPE_LEVEL[m[0].split("(")[0].replace("!", "")];
46
+ if (/BREAKING[- ]CHANGE:/.test(body)) return "major";
47
+ return TYPE_LEVEL[m[1]] ?? null;
49
48
  };
50
49
 
51
50
  // Two-pass collection (sanctioned by the task brief): the single-pass
@@ -711,7 +711,7 @@ export const branchSetup = ({
711
711
  if (classifyBranchDirt(cwd) === "stash-required" && stash !== "yes") {
712
712
  return {
713
713
  error:
714
- "dirty working tree — ask with native question, then call workit_branch_setup with stash=yes",
714
+ "dirty working tree — obtain native host approval before stashing and setting up the branch",
715
715
  phase: "preflight",
716
716
  };
717
717
  }
@@ -125,6 +125,11 @@ Preserve uncertain external outcomes and reconcile repository/provider state
125
125
  before retrying. Internal reservations prevent duplicate or ambiguous effects;
126
126
  they are not permission tickets for every edit.
127
127
 
128
+ On OpenCode V1 and V2, use native host tools for external mutations. Workit
129
+ provides read-only workit_context; it has no managed external-action executor.
130
+ Do not create proposals or request Workit approvals merely to invoke native
131
+ tools. Old uncertain managed effects still require evidence before any retry.
132
+
128
133
  Use host-native authorization through the host's supported path. A native
129
134
  question receipt records an actual question interaction; it is not automatic
130
135
  host permission. Record a meaningful user choice once with provenance when
@@ -363,7 +363,7 @@ const CHANGELOG_RULES = `- Use an [Unreleased] section.
363
363
  - Entries should be human-readable and user-facing.
364
364
  - Do not use raw commit messages as changelog bullets.
365
365
  - MERGE into existing ### Category under [Unreleased] — never append a second ### Added / ### Fixed block.
366
- - Apply with the native workit_changelog_apply tool only (not hand-edits under Unreleased).
366
+ - Apply with the host-native editor, preserving the repository changelog conventions.
367
367
  - If Unreleased already has duplicate category headings, normalize_only first.`;
368
368
 
369
369
  /** Port of changelog-context.sh — changelog update context. */
@@ -103,7 +103,7 @@ type PostData = {
103
103
  loggedMinutes: number;
104
104
  outcome?: "unknown" | "not_applied";
105
105
  instructions?: string;
106
- retry?: "workit_youtrack_post" | "workit_youtrack_log_time";
106
+ retry?: "youtrack.update" | "youtrack.time";
107
107
  };
108
108
 
109
109
  const notApplied = (value: LegacyValue): value is NotApplied =>
@@ -130,7 +130,7 @@ export async function postUpdate(
130
130
  postedComment: false,
131
131
  loggedMinutes: 0,
132
132
  outcome: "not_applied",
133
- retry: "workit_youtrack_post",
133
+ retry: "youtrack.update",
134
134
  });
135
135
  unwrap(comment);
136
136
  } catch (error) {
@@ -158,7 +158,7 @@ export async function postUpdate(
158
158
  postedComment: true,
159
159
  loggedMinutes: 0,
160
160
  outcome: "not_applied",
161
- retry: "workit_youtrack_log_time",
161
+ retry: "youtrack.time",
162
162
  });
163
163
  unwrap(time);
164
164
  } catch (error) {
@@ -191,7 +191,7 @@ export async function logTimeUpdate(
191
191
  issueId: input.issueId,
192
192
  loggedMinutes: 0,
193
193
  outcome: "not_applied",
194
- retry: "workit_youtrack_log_time",
194
+ retry: "youtrack.time",
195
195
  });
196
196
  return ok(unwrap(value));
197
197
  } catch (error) {
@@ -846,7 +846,7 @@ export async function postUpdate(
846
846
  postedComment: true,
847
847
  loggedMinutes: 0,
848
848
  error: time.error,
849
- retry: "workit_youtrack_log_time",
849
+ retry: "youtrack.time",
850
850
  };
851
851
  }
852
852
  return { ok: true, issueId, postedComment: true, loggedMinutes: minutes };