@primitive.ai/prim 0.1.0-alpha.121 → 0.1.0-alpha.122

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.
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  commitAttributionFromEnvironment,
10
10
  toCommitMove
11
- } from "../chunk-DVHD6LBQ.js";
11
+ } from "../chunk-4M23K2KZ.js";
12
12
  import {
13
13
  getOrCreateWorkspaceId
14
14
  } from "../chunk-EZXEWFDG.js";
@@ -16,10 +16,10 @@ import {
16
16
  appendMove,
17
17
  resolveOrg
18
18
  } from "../chunk-OXW6PSPT.js";
19
- import "../chunk-2PFJJO2M.js";
19
+ import "../chunk-4NUGCUQC.js";
20
20
  import {
21
21
  cachedCollectScopeAdmits
22
- } from "../chunk-6DEROXLM.js";
22
+ } from "../chunk-HLMC7VS4.js";
23
23
  import "../chunk-S3ZIMGXV.js";
24
24
  import {
25
25
  githubRepositoryFullName,
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  canonicalRewritePairs,
7
7
  toRewriteMove
8
- } from "../chunk-DVHD6LBQ.js";
8
+ } from "../chunk-4M23K2KZ.js";
9
9
  import {
10
10
  getOrCreateWorkspaceId
11
11
  } from "../chunk-EZXEWFDG.js";
@@ -13,10 +13,10 @@ import {
13
13
  appendMove,
14
14
  resolveOrg
15
15
  } from "../chunk-OXW6PSPT.js";
16
- import "../chunk-2PFJJO2M.js";
16
+ import "../chunk-4NUGCUQC.js";
17
17
  import {
18
18
  cachedCollectScopeAdmits
19
- } from "../chunk-6DEROXLM.js";
19
+ } from "../chunk-HLMC7VS4.js";
20
20
  import "../chunk-S3ZIMGXV.js";
21
21
  import {
22
22
  githubRepositoryFullName,
@@ -1,21 +1,21 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  requireDurableIngestAcknowledgement
4
- } from "../chunk-NQZLXYTW.js";
4
+ } from "../chunk-RRAC76LJ.js";
5
5
  import {
6
6
  enrichHookPayloadWithFileRefs,
7
7
  preserveHookFileMetadata
8
- } from "../chunk-M4NZJCPQ.js";
8
+ } from "../chunk-QG3GASJO.js";
9
9
  import {
10
10
  appendCodexContext,
11
11
  prepareCodexContext
12
- } from "../chunk-2DNC2MUN.js";
13
- import "../chunk-JXRJLHE4.js";
12
+ } from "../chunk-T2T45KF6.js";
13
+ import "../chunk-5ME3WD3P.js";
14
14
  import {
15
15
  postToolInvocationId,
16
16
  toMove,
17
17
  toolOutcomeFor
18
- } from "../chunk-DVHD6LBQ.js";
18
+ } from "../chunk-4M23K2KZ.js";
19
19
  import {
20
20
  getOrCreateWorkspaceId
21
21
  } from "../chunk-EZXEWFDG.js";
@@ -26,22 +26,22 @@ import {
26
26
  import "../chunk-NMZSCSMY.js";
27
27
  import {
28
28
  observeDemoInvocation
29
- } from "../chunk-MRDY7VQP.js";
29
+ } from "../chunk-FT673ALA.js";
30
30
  import {
31
31
  normalizeEnvelope,
32
32
  readHookStdin,
33
33
  shouldSuppressImportedCursorHandler
34
34
  } from "../chunk-HG7FJK7R.js";
35
- import "../chunk-BHT6X3T5.js";
35
+ import "../chunk-JYPVPYW3.js";
36
36
  import "../chunk-AKGRY7OU.js";
37
37
  import {
38
38
  scrubFromCwd
39
- } from "../chunk-2PFJJO2M.js";
39
+ } from "../chunk-4NUGCUQC.js";
40
40
  import {
41
41
  bold,
42
42
  cachedCollectScopeAdmits,
43
43
  color
44
- } from "../chunk-6DEROXLM.js";
44
+ } from "../chunk-HLMC7VS4.js";
45
45
  import {
46
46
  getClient,
47
47
  terminalSafeLine
@@ -10,10 +10,10 @@ import {
10
10
  resultForPreflight,
11
11
  toolInputDigest,
12
12
  waitForPreflight
13
- } from "../chunk-LQLP26RL.js";
13
+ } from "../chunk-ZQ7UK5US.js";
14
14
  import {
15
15
  observeDemoInvocation
16
- } from "../chunk-MRDY7VQP.js";
16
+ } from "../chunk-FT673ALA.js";
17
17
  import {
18
18
  normalizeEnvelope,
19
19
  readHookStdin,
@@ -30,12 +30,12 @@ import {
30
30
  failOpenHermes,
31
31
  failOpenOutput,
32
32
  readHookMode
33
- } from "../chunk-BHT6X3T5.js";
33
+ } from "../chunk-JYPVPYW3.js";
34
34
  import "../chunk-AKGRY7OU.js";
35
- import "../chunk-2PFJJO2M.js";
35
+ import "../chunk-4NUGCUQC.js";
36
36
  import {
37
37
  cachedCollectScopeAdmits
38
- } from "../chunk-6DEROXLM.js";
38
+ } from "../chunk-HLMC7VS4.js";
39
39
  import "../chunk-S3ZIMGXV.js";
40
40
  import {
41
41
  canonicalGitRoot,
@@ -18,16 +18,16 @@ import {
18
18
  import {
19
19
  enrichHookPayloadWithFileRefs,
20
20
  preserveHookFileMetadata
21
- } from "../chunk-M4NZJCPQ.js";
21
+ } from "../chunk-QG3GASJO.js";
22
22
  import {
23
23
  prepareCodexContext
24
- } from "../chunk-2DNC2MUN.js";
25
- import "../chunk-JXRJLHE4.js";
24
+ } from "../chunk-T2T45KF6.js";
25
+ import "../chunk-5ME3WD3P.js";
26
26
  import {
27
27
  postToolInvocationId,
28
28
  shouldFlushAfter,
29
29
  toMove
30
- } from "../chunk-DVHD6LBQ.js";
30
+ } from "../chunk-4M23K2KZ.js";
31
31
  import {
32
32
  getOrCreateWorkspaceId
33
33
  } from "../chunk-EZXEWFDG.js";
@@ -38,21 +38,21 @@ import {
38
38
  import "../chunk-NMZSCSMY.js";
39
39
  import {
40
40
  observeDemoInvocation
41
- } from "../chunk-MRDY7VQP.js";
41
+ } from "../chunk-FT673ALA.js";
42
42
  import {
43
43
  normalizeEnvelope,
44
44
  readHookStdin,
45
45
  shouldSuppressImportedCursorHandler
46
46
  } from "../chunk-HG7FJK7R.js";
47
- import "../chunk-BHT6X3T5.js";
47
+ import "../chunk-JYPVPYW3.js";
48
48
  import "../chunk-AKGRY7OU.js";
49
49
  import {
50
50
  scrubFromCwd,
51
51
  writeHookDebug
52
- } from "../chunk-2PFJJO2M.js";
52
+ } from "../chunk-4NUGCUQC.js";
53
53
  import {
54
54
  cachedCollectScopeAdmits
55
- } from "../chunk-6DEROXLM.js";
55
+ } from "../chunk-HLMC7VS4.js";
56
56
  import "../chunk-S3ZIMGXV.js";
57
57
  import {
58
58
  currentBranch,
@@ -25,8 +25,8 @@ import {
25
25
  import "../chunk-OYHYCK4K.js";
26
26
  import {
27
27
  prepareCodexContext
28
- } from "../chunk-2DNC2MUN.js";
29
- import "../chunk-JXRJLHE4.js";
28
+ } from "../chunk-T2T45KF6.js";
29
+ import "../chunk-5ME3WD3P.js";
30
30
  import {
31
31
  getOrCreateWorkspaceId
32
32
  } from "../chunk-EZXEWFDG.js";
@@ -43,7 +43,7 @@ import {
43
43
  } from "../chunk-AKGRY7OU.js";
44
44
  import {
45
45
  fetchAndCacheCollectScope
46
- } from "../chunk-6DEROXLM.js";
46
+ } from "../chunk-HLMC7VS4.js";
47
47
  import {
48
48
  getSiteUrl,
49
49
  isSessionEnded
package/dist/index.js CHANGED
@@ -25,7 +25,7 @@ import {
25
25
  } from "./chunk-7LXRFXZG.js";
26
26
  import {
27
27
  requireDurableIngestAcknowledgement
28
- } from "./chunk-NQZLXYTW.js";
28
+ } from "./chunk-RRAC76LJ.js";
29
29
  import {
30
30
  checkAffectedDecisions,
31
31
  daemonOrDirectGet,
@@ -35,7 +35,7 @@ import {
35
35
  hasCompleteCoverage,
36
36
  requestPreflight,
37
37
  waitForPreflight
38
- } from "./chunk-LQLP26RL.js";
38
+ } from "./chunk-ZQ7UK5US.js";
39
39
  import {
40
40
  fetchFeedbackCapability
41
41
  } from "./chunk-JZC2LHS6.js";
@@ -58,7 +58,7 @@ import {
58
58
  formatStatusline,
59
59
  formatTeammates,
60
60
  repositoryBindingDiagnosticLabel
61
- } from "./chunk-JXRJLHE4.js";
61
+ } from "./chunk-5ME3WD3P.js";
62
62
  import {
63
63
  JOURNAL_DIR,
64
64
  SESSIONS_DIR,
@@ -98,7 +98,7 @@ import {
98
98
  readRun,
99
99
  runIds,
100
100
  saveRun
101
- } from "./chunk-BHT6X3T5.js";
101
+ } from "./chunk-JYPVPYW3.js";
102
102
  import {
103
103
  MANAGED_GIT_HOOK_NAMES,
104
104
  assertOwnedHookRuntime,
@@ -125,7 +125,7 @@ import {
125
125
  stageHookRuntime,
126
126
  stripCommand
127
127
  } from "./chunk-AKGRY7OU.js";
128
- import "./chunk-2PFJJO2M.js";
128
+ import "./chunk-4NUGCUQC.js";
129
129
  import {
130
130
  bold,
131
131
  boundedHealthError,
@@ -150,7 +150,7 @@ import {
150
150
  isMoveIngestRequest,
151
151
  isReconcileResolutionResponse,
152
152
  stripAnsi
153
- } from "./chunk-6DEROXLM.js";
153
+ } from "./chunk-HLMC7VS4.js";
154
154
  import {
155
155
  CliManagementResponseError,
156
156
  HttpError,
@@ -4452,6 +4452,60 @@ function registerDaemonCommands(program2) {
4452
4452
  // src/commands/decisions.ts
4453
4453
  import { Option as Option3 } from "commander";
4454
4454
 
4455
+ // src/decisions/metadata.ts
4456
+ function decisionMakerName(row) {
4457
+ if (row.producerKind === "seed") {
4458
+ return row.decisionMaker?.kind === "external" ? terminalSafeLine(row.decisionMaker.displayName) : "Decision maker unknown";
4459
+ }
4460
+ return terminalSafeLine(row.authorName);
4461
+ }
4462
+ function validDate(at) {
4463
+ const date = new Date(at);
4464
+ return Number.isNaN(date.getTime()) ? void 0 : date;
4465
+ }
4466
+ function formatHistoricalAdoption(adoption) {
4467
+ if (!adoption) {
4468
+ return "date unknown";
4469
+ }
4470
+ const date = validDate(adoption.at);
4471
+ if (!date) {
4472
+ return "date unknown";
4473
+ }
4474
+ const iso = date.toISOString();
4475
+ const timestamp = adoption.precision === "day" ? iso.slice(0, 10) : `${iso.slice(0, adoption.precision === "minute" ? 16 : 19).replace("T", " ")} UTC`;
4476
+ switch (adoption.qualifier) {
4477
+ case "on_or_about":
4478
+ return `on or about ${timestamp}`;
4479
+ case "no_later_than":
4480
+ return `no later than ${timestamp}`;
4481
+ default:
4482
+ return timestamp;
4483
+ }
4484
+ }
4485
+ function formatDecidedAt(row) {
4486
+ if (row.producerKind === "seed") {
4487
+ return formatHistoricalAdoption(row.adoption);
4488
+ }
4489
+ return validDate(row.classifiedAt)?.toISOString() ?? "date unknown";
4490
+ }
4491
+ function pad2(value) {
4492
+ return String(value).padStart(2, "0");
4493
+ }
4494
+ function formatRecentDecisionDate(row, now) {
4495
+ if (row.producerKind === "seed") {
4496
+ return formatHistoricalAdoption(row.adoption);
4497
+ }
4498
+ const date = validDate(row.classifiedAt);
4499
+ if (!date) {
4500
+ return "date unknown";
4501
+ }
4502
+ const today = new Date(now);
4503
+ if (date.getFullYear() === today.getFullYear() && date.getMonth() === today.getMonth() && date.getDate() === today.getDate()) {
4504
+ return `${pad2(date.getHours())}:${pad2(date.getMinutes())}`;
4505
+ }
4506
+ return `${date.getFullYear()}-${pad2(date.getMonth() + 1)}-${pad2(date.getDate())}`;
4507
+ }
4508
+
4455
4509
  // src/decisions/recent.ts
4456
4510
  var RECENT_TIMEOUT_MS = 1e4;
4457
4511
  var defaultDeps = { getClient };
@@ -4511,15 +4565,10 @@ async function fetchRecent(args, deps = defaultDeps) {
4511
4565
  return { decisions: [], unavailable: `recent feed failed: ${detail}` };
4512
4566
  }
4513
4567
  }
4514
- var ZERO_PAD_TWO = 2;
4515
- function pad2(n) {
4516
- return n.toString().padStart(ZERO_PAD_TWO, "0");
4517
- }
4518
- function formatClock(ms) {
4519
- const d = new Date(ms);
4520
- return `${pad2(d.getHours())}:${pad2(d.getMinutes())}`;
4521
- }
4522
4568
  function authorLabel(row) {
4569
+ if (row.producerKind === "seed") {
4570
+ return decisionMakerName(row);
4571
+ }
4523
4572
  if (!row.authorIsSelf) {
4524
4573
  return terminalSafeLine(row.authorName);
4525
4574
  }
@@ -4548,13 +4597,13 @@ function padRight(s, width) {
4548
4597
  return s.length >= width ? `${s.slice(0, width - 1)} ` : s.padEnd(width, " ");
4549
4598
  }
4550
4599
  function formatRecentRow(row) {
4551
- const clock = formatClock(row.classifiedAt);
4552
- const author = padRight(authorLabel(row), AUTHOR_WIDTH);
4600
+ const date = formatRecentDecisionDate(row, Date.now()).padEnd(10, " ");
4601
+ const author = authorLabel(row).padEnd(AUTHOR_WIDTH, " ");
4553
4602
  const area = terminalSafeLine(row.area ?? "");
4554
4603
  const areaText = area ? `\u2022 ${area}` : "\u2022";
4555
4604
  const areaPlain = padRight(areaText, AREA_WIDTH);
4556
4605
  const areaCol = area ? areaPlain.replace("\u2022", color("\u2022", colorForArea(area))) : areaPlain;
4557
- return ` ${clock} ${author}${areaCol}${terminalSafeLine(row.intent)}`;
4606
+ return ` ${date} ${author} ${areaCol}${terminalSafeLine(row.intent)}`;
4558
4607
  }
4559
4608
  var RECENT_LIMIT_CEILING = 100;
4560
4609
  function remainingHint(result) {
@@ -4770,7 +4819,8 @@ function renderCascade(result) {
4770
4819
  }
4771
4820
  const decisionLine = `\u2022 ${idColored} ${truncate(d.intent, INTENT_TRUNC)}`;
4772
4821
  const fanOutFragment = result.fanOut > 0 ? ` \xB7 ${String(result.fanOut)} decision(s) depend on this` : "";
4773
- const meta = ` ${terminalSafeLine(d.authorName)} \xB7 ${formatDate(d.classifiedAt)}${fanOutFragment} \xB7 ${terminalSafeLine(result.reversibility ?? "(unset)")} reversibility`;
4822
+ const date = d.producerKind === "seed" ? formatHistoricalAdoption(d.adoption) : formatDate(d.classifiedAt);
4823
+ const meta = ` ${decisionMakerName(d)} \xB7 ${date}${fanOutFragment} \xB7 ${terminalSafeLine(result.reversibility ?? "(unset)")} reversibility`;
4774
4824
  lines.push("", decisionLine, meta);
4775
4825
  lines.push("");
4776
4826
  lines.push("dependents");
@@ -6123,7 +6173,7 @@ function describeNode(node) {
6123
6173
  const id = renderIdentifier({ shortId: node.shortId, id: node.id });
6124
6174
  const safeArea = terminalSafeLine(node.area ?? "");
6125
6175
  const area = safeArea ? ` \u2022 ${safeArea}` : "";
6126
- return `${id}${area} ${terminalSafeLine(node.intent)} (${terminalSafeLine(node.authorName)})`;
6176
+ return `${id}${area} ${terminalSafeLine(node.intent)} (${decisionMakerName(node)})`;
6127
6177
  }
6128
6178
  function pushFiles(lines, files) {
6129
6179
  if (files.length === 0) {
@@ -6203,8 +6253,14 @@ function formatShowHuman(result) {
6203
6253
  const displayedStatus = d.stage ?? d.status;
6204
6254
  const lines = [
6205
6255
  `[prim] ${id} \u2014 ${terminalSafeLine(d.intent)}`,
6206
- ` status: ${colorStatus(displayedStatus)}${d.confirmed ? " (confirmed)" : ""} \xB7 confidence: ${terminalSafeLine(confidence)} \xB7 reversibility: ${terminalSafeLine(d.reversibility ?? "(unset)")}`
6256
+ ` status: ${colorStatus(displayedStatus)}${d.confirmed ? " (confirmed)" : ""} \xB7 confidence: ${terminalSafeLine(confidence)} \xB7 reversibility: ${terminalSafeLine(d.reversibility ?? "(unset)")}`,
6257
+ ` maker: ${decisionMakerName(d)}`,
6258
+ ` decided: ${formatDecidedAt(d)}`
6207
6259
  ];
6260
+ if (d.producerKind === "seed" && d.importedAt !== void 0) {
6261
+ const importer = d.importedByName ? ` by ${terminalSafeLine(d.importedByName)}` : "";
6262
+ lines.push(` imported: ${effectiveTimestamp(d.importedAt)}${importer}`);
6263
+ }
6208
6264
  if (d.supersededBy) {
6209
6265
  lines.push(` superseded by: ${terminalSafeLine(d.supersededBy)}`);
6210
6266
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primitive.ai/prim",
3
- "version": "0.1.0-alpha.121",
3
+ "version": "0.1.0-alpha.122",
4
4
  "description": "CLI for Primitive's decision graph — passive decision capture, conflict gate, and team presence",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -55,6 +55,7 @@
55
55
  "contracts:check": "node scripts/generate-cli-contract.mjs --check",
56
56
  "contracts:provenance": "node scripts/update-cli-contract.mjs --check",
57
57
  "check:decision-identity-golden": "node scripts/check-decision-identity-golden.mjs",
58
+ "check:seed-metadata-golden": "node scripts/check-seed-metadata-golden.mjs",
58
59
  "check:gameplan-companion": "node scripts/check-gameplan-companion.mjs",
59
60
  "check:gameplan-e2e": "node scripts/check-gameplan-e2e.mjs",
60
61
  "check:gameplan-package": "node scripts/check-gameplan-package.mjs",