mason-context 0.19.1 → 0.19.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ ## 0.19.2 — 2026-09-29
6
+
7
+ - Use operating-system trusted certificates in standalone Mason, preserving bundled and extra certificates, so company TLS certificates work for upgrades and other requests. Report GitHub release lookup failures with their underlying error code and certificate or network guidance.
8
+
9
+ - Capture supported lessons immediately as proposals, keeping unimplemented remedies tentative and acceptance subject to explicit review.
10
+ - Give assistants new or worsened audit findings during the task and show remaining findings at response completion. Keep the existing backlog quiet; explicit checks still report it in full.
11
+ - Preserve notification history across restarts, ignore report-only changes, and retain overflow for later notices. Notices never force another agent turn.
12
+ - Recover notification tracking from unreadable upgrade reports while preserving repair evidence. Deduplicate verification warnings per session.
13
+ - Show uncommitted decision records and pending proposals in explicit status, with paths, ages, and oldest proposals first.
14
+
3
15
  ## 0.19.1 — 2026-09-25
4
16
 
5
17
  - Match supported dependency changes to named document passages; retain unmatched manifest recency as information without a review obligation. Preserve specific findings, original baselines and prior assessments, and label historical evidence explicitly.
@@ -2479,8 +2479,30 @@ var init_findings = __esm({
2479
2479
  }
2480
2480
  });
2481
2481
 
2482
- // src/automation/store.ts
2482
+ // src/automation/notifications.ts
2483
2483
  import { z as z5 } from "zod";
2484
+ var conditionSchema, notificationStateSchema;
2485
+ var init_notifications = __esm({
2486
+ "src/automation/notifications.ts"() {
2487
+ "use strict";
2488
+ init_findings();
2489
+ conditionSchema = z5.object({
2490
+ level: z5.number(),
2491
+ facts: z5.array(z5.string()),
2492
+ magnitude: z5.number().optional()
2493
+ });
2494
+ notificationStateSchema = z5.object({
2495
+ version: z5.literal(1),
2496
+ baselineHead: z5.string(),
2497
+ baseline: z5.record(conditionSchema),
2498
+ delivered: z5.record(conditionSchema),
2499
+ cleared: z5.array(z5.string())
2500
+ });
2501
+ }
2502
+ });
2503
+
2504
+ // src/automation/store.ts
2505
+ import { z as z6 } from "zod";
2484
2506
  function withLock(root, directory, run, waitMs = 5e3) {
2485
2507
  return withStoreLock(root, directory, run, waitMs, "Automation");
2486
2508
  }
@@ -2489,29 +2511,28 @@ var init_store = __esm({
2489
2511
  "src/automation/store.ts"() {
2490
2512
  "use strict";
2491
2513
  init_store_lock();
2492
- hostSchema = z5.enum(["claude", "codex"]);
2493
- stateSchema = z5.object({
2494
- version: z5.literal(1),
2495
- root: z5.string(),
2496
- gitDir: z5.string(),
2497
- branch: z5.string(),
2498
- baselines: z5.array(z5.object({ path: z5.string(), at: z5.string(), event: z5.string(), fingerprint: z5.string() })).max(128),
2499
- sessions: z5.record(z5.object({
2514
+ init_notifications();
2515
+ hostSchema = z6.enum(["claude", "codex"]);
2516
+ stateSchema = z6.object({
2517
+ version: z6.literal(1),
2518
+ root: z6.string(),
2519
+ gitDir: z6.string(),
2520
+ branch: z6.string(),
2521
+ baselines: z6.array(z6.object({ path: z6.string(), at: z6.string(), event: z6.string(), fingerprint: z6.string() })).max(128),
2522
+ sessions: z6.record(z6.object({
2500
2523
  host: hostSchema,
2501
- seen: z5.string().nullable(),
2502
- continued: z5.boolean(),
2503
- initialIssues: z5.array(z5.string()),
2504
- initialDocs: z5.record(z5.string().nullable()),
2505
- lastUsed: z5.string(),
2506
- mutationObserved: z5.boolean(),
2507
- pending: z5.record(z5.string()),
2508
- coverageGaps: z5.array(z5.string()),
2509
- events: z5.record(z5.object({ at: z5.string(), count: z5.number().int().positive() }))
2524
+ lastUsed: z6.string(),
2525
+ notifiedDiagnostics: z6.array(z6.string()).default([]),
2526
+ pending: z6.record(z6.string()),
2527
+ coverageGaps: z6.array(z6.string()),
2528
+ events: z6.record(z6.object({ at: z6.string(), count: z6.number().int().positive() }))
2510
2529
  })),
2511
- updatedAt: z5.string(),
2512
- fingerprint: z5.string().nullable(),
2513
- latest: z5.string().nullable(),
2514
- analysis: z5.object({ id: z5.string(), fingerprint: z5.string(), completedAt: z5.number(), path: z5.string() }).optional()
2530
+ updatedAt: z6.string(),
2531
+ fingerprint: z6.string().nullable(),
2532
+ latest: z6.string().nullable(),
2533
+ notifications: notificationStateSchema.optional(),
2534
+ agentNotifications: notificationStateSchema.optional(),
2535
+ analysis: z6.object({ id: z6.string(), fingerprint: z6.string(), completedAt: z6.number(), path: z6.string() }).optional()
2515
2536
  });
2516
2537
  }
2517
2538
  });
@@ -2533,7 +2554,7 @@ __export(repair_exports, {
2533
2554
  import fs10 from "fs/promises";
2534
2555
  import path20 from "path";
2535
2556
  import { randomUUID as randomUUID2 } from "crypto";
2536
- import { z as z6 } from "zod";
2557
+ import { z as z7 } from "zod";
2537
2558
  function recheckable(finding) {
2538
2559
  return !("confidence" in finding) && finding.resolution === "recheck" && ["deleted-reference", "dead-command", "new-module"].includes(finding.type) && ["missing-path", "missing-script", "unmentioned-dir"].includes(finding.evidence.kind);
2539
2560
  }
@@ -2604,7 +2625,7 @@ async function withRepairSession(root, options, run, validate, cachedAudit) {
2604
2625
  }
2605
2626
  async function prepareOriginal(rootDir, checks, options, session) {
2606
2627
  const root = await fs10.realpath(rootDir);
2607
- const selected = z6.array(checkSchema).nonempty().parse(checks);
2628
+ const selected = z7.array(checkSchema).nonempty().parse(checks);
2608
2629
  const report = await (session ? session.audit(selected) : stableAudit(root, selected, options));
2609
2630
  if (!report) throw new Error("No context files found to prepare a repair.");
2610
2631
  if (!report.gitAvailable) throw new Error("Readable Git history is required to prepare a repair.");
@@ -2761,42 +2782,42 @@ var init_repair = __esm({
2761
2782
  init_findings();
2762
2783
  init_advisory_review();
2763
2784
  init_findings();
2764
- count2 = z6.number().int().nonnegative();
2765
- reportSchema = z6.object({
2766
- version: z6.literal(1),
2767
- root: z6.string(),
2768
- gitAvailable: z6.literal(true),
2785
+ count2 = z7.number().int().nonnegative();
2786
+ reportSchema = z7.object({
2787
+ version: z7.literal(1),
2788
+ root: z7.string(),
2789
+ gitAvailable: z7.literal(true),
2769
2790
  headHash: commitSchema.shape.hash,
2770
- checksRun: z6.array(checkSchema).nonempty(),
2771
- docs: z6.array(z6.object({
2772
- path: z6.string().refine((value) => normalizeRepoPath(value) === value),
2773
- scope: z6.string().optional(),
2774
- kind: z6.enum(["instructions", "readme", "guide"]).optional(),
2791
+ checksRun: z7.array(checkSchema).nonempty(),
2792
+ docs: z7.array(z7.object({
2793
+ path: z7.string().refine((value) => normalizeRepoPath(value) === value),
2794
+ scope: z7.string().optional(),
2795
+ kind: z7.enum(["instructions", "readme", "guide"]).optional(),
2775
2796
  lastCommit: commitSchema.nullable(),
2776
- dirty: z6.boolean(),
2797
+ dirty: z7.boolean(),
2777
2798
  lineCount: count2
2778
2799
  })).nonempty(),
2779
- decisionsChecked: z6.boolean(),
2780
- clean: z6.boolean(),
2781
- excludedChecks: z6.array(z6.object({ check: checkSchema, doc: z6.string() })).optional(),
2782
- issues: z6.array(issueSchema),
2783
- advisories: z6.array(advisorySchema),
2784
- suppressedAdvisories: z6.array(advisorySchema).optional(),
2785
- skippedChecks: z6.array(z6.object({ check: z6.string(), reason: z6.string(), doc: z6.string().optional() }))
2800
+ decisionsChecked: z7.boolean(),
2801
+ clean: z7.boolean(),
2802
+ excludedChecks: z7.array(z7.object({ check: checkSchema, doc: z7.string() })).optional(),
2803
+ issues: z7.array(issueSchema),
2804
+ advisories: z7.array(advisorySchema),
2805
+ suppressedAdvisories: z7.array(advisorySchema).optional(),
2806
+ skippedChecks: z7.array(z7.object({ check: z7.string(), reason: z7.string(), doc: z7.string().optional() }))
2786
2807
  });
2787
- baselineSchema = z6.object({
2788
- kind: z6.literal("mason-audit-repair"),
2789
- version: z6.literal(1),
2790
- createdAt: z6.string().datetime(),
2808
+ baselineSchema = z7.object({
2809
+ kind: z7.literal("mason-audit-repair"),
2810
+ version: z7.literal(1),
2811
+ createdAt: z7.string().datetime(),
2791
2812
  report: reportSchema,
2792
- digest: z6.string().regex(/^[a-f0-9]{64}$/)
2813
+ digest: z7.string().regex(/^[a-f0-9]{64}$/)
2793
2814
  });
2794
- repairFindingSchema = z6.object({
2795
- id: z6.string(),
2796
- original: z6.union([issueSchema, advisorySchema]),
2797
- status: z6.enum(["resolved", "unresolved", "review-required", "unverified"]),
2798
- reason: z6.string(),
2799
- current: z6.union([issueSchema, advisorySchema]).optional(),
2815
+ repairFindingSchema = z7.object({
2816
+ id: z7.string(),
2817
+ original: z7.union([issueSchema, advisorySchema]),
2818
+ status: z7.enum(["resolved", "unresolved", "review-required", "unverified"]),
2819
+ reason: z7.string(),
2820
+ current: z7.union([issueSchema, advisorySchema]).optional(),
2800
2821
  review: reviewSummarySchema.optional()
2801
2822
  });
2802
2823
  }
@@ -2804,7 +2825,7 @@ var init_repair = __esm({
2804
2825
 
2805
2826
  // src/audit/advisory-review.ts
2806
2827
  import fs11 from "fs/promises";
2807
- import { z as z7 } from "zod";
2828
+ import { z as z8 } from "zod";
2808
2829
  async function readRecord(root, id) {
2809
2830
  const raw = await readStoreJson(root, recordPath(id));
2810
2831
  if (raw === null) return null;
@@ -3023,41 +3044,41 @@ var init_advisory_review = __esm({
3023
3044
  init_decisions();
3024
3045
  init_drift2();
3025
3046
  git2 = async (root, ...args) => (await (["log", "ls-tree", "ls-files", "merge-base"].includes(args[0]) ? inspectionGit : execGit)(args, { cwd: root, timeout: 1e4, maxBuffer: 8 * 1024 * 1024 })).stdout;
3026
- hashSchema = z7.string().regex(/^[a-f0-9]{64}$/);
3027
- commitSchema2 = z7.string().regex(/^[a-f0-9]{40,64}$/);
3028
- evidenceSchema2 = z7.object({
3047
+ hashSchema = z8.string().regex(/^[a-f0-9]{64}$/);
3048
+ commitSchema2 = z8.string().regex(/^[a-f0-9]{40,64}$/);
3049
+ evidenceSchema2 = z8.object({
3029
3050
  head: commitSchema2,
3030
3051
  fingerprint: hashSchema,
3031
- scope: z7.array(z7.string()).min(1).max(1e3),
3032
- tree: z7.string().max(2 * 1024 * 1024),
3052
+ scope: z8.array(z8.string()).min(1).max(1e3),
3053
+ tree: z8.string().max(2 * 1024 * 1024),
3033
3054
  lastScopeCommit: commitSchema2,
3034
- paths: z7.array(z7.object({ path: z7.string(), exists: z7.boolean() })).max(1e3)
3055
+ paths: z8.array(z8.object({ path: z8.string(), exists: z8.boolean() })).max(1e3)
3035
3056
  });
3036
- dismissalReasonSchema = z7.enum(["no-dependency-claims", "unrelated-manifest-change"]);
3037
- eventSchema2 = z7.object({
3038
- at: z7.string().datetime(),
3039
- reviewer: z7.string().trim().min(1).max(200).optional(),
3040
- note: z7.string().trim().min(1).max(2500),
3041
- outcome: z7.enum(["addressed", "inapplicable", "deferred", "dismissed"]),
3057
+ dismissalReasonSchema = z8.enum(["no-dependency-claims", "unrelated-manifest-change"]);
3058
+ eventSchema2 = z8.object({
3059
+ at: z8.string().datetime(),
3060
+ reviewer: z8.string().trim().min(1).max(200).optional(),
3061
+ note: z8.string().trim().min(1).max(2500),
3062
+ outcome: z8.enum(["addressed", "inapplicable", "deferred", "dismissed"]),
3042
3063
  reasonCode: dismissalReasonSchema.optional(),
3043
3064
  finding: advisorySchema.refine((finding) => finding.evidence.kind !== "decision-anchor", "Decision findings use decision reviews"),
3044
3065
  evidence: evidenceSchema2
3045
3066
  });
3046
- recordSchema = z7.object({ version: z7.literal(1), id: hashSchema, events: z7.array(eventSchema2).min(1).max(200), digest: hashSchema });
3047
- reviewSummarySchema = z7.object({
3067
+ recordSchema = z8.object({ version: z8.literal(1), id: hashSchema, events: z8.array(eventSchema2).min(1).max(200), digest: hashSchema });
3068
+ reviewSummarySchema = z8.object({
3048
3069
  id: hashSchema,
3049
- status: z7.enum(["current", "reopened", "deferred", "unverified"]),
3050
- reason: z7.string(),
3051
- recordPath: z7.string().optional(),
3052
- reviewer: z7.string().optional(),
3053
- note: z7.string().optional(),
3054
- outcome: z7.enum(["addressed", "inapplicable", "deferred", "accepted", "reaffirmed", "retired", "dismissed"]).optional(),
3055
- reviewedHead: z7.string().optional()
3070
+ status: z8.enum(["current", "reopened", "deferred", "unverified"]),
3071
+ reason: z8.string(),
3072
+ recordPath: z8.string().optional(),
3073
+ reviewer: z8.string().optional(),
3074
+ note: z8.string().optional(),
3075
+ outcome: z8.enum(["addressed", "inapplicable", "deferred", "accepted", "reaffirmed", "retired", "dismissed"]).optional(),
3076
+ reviewedHead: z8.string().optional()
3056
3077
  });
3057
- advisoryReviewRequest = z7.object({
3058
- baselinePath: z7.string().min(1),
3078
+ advisoryReviewRequest = z8.object({
3079
+ baselinePath: z8.string().min(1),
3059
3080
  findingId: hashSchema,
3060
- action: z7.enum(["prepare", "addressed", "inapplicable", "deferred", "dismiss"]).default("prepare"),
3081
+ action: z8.enum(["prepare", "addressed", "inapplicable", "deferred", "dismiss"]).default("prepare"),
3061
3082
  reasonCode: dismissalReasonSchema.optional(),
3062
3083
  reviewer: eventSchema2.shape.reviewer.optional(),
3063
3084
  note: eventSchema2.shape.note.optional(),