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 +12 -0
- package/dist/mason-audit.js +99 -78
- package/dist/mason-audit.js.map +1 -1
- package/dist/mason-auto.js +651 -458
- package/dist/mason-auto.js.map +1 -1
- package/dist/mason-mcp.js +630 -431
- package/dist/mason-mcp.js.map +1 -1
- package/dist/mason-runtime.js +157 -54
- package/dist/mason-runtime.js.map +1 -1
- package/dist/mason.js +714 -501
- package/dist/mason.js.map +1 -1
- package/package.json +1 -1
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.
|
package/dist/mason-audit.js
CHANGED
|
@@ -2479,8 +2479,30 @@ var init_findings = __esm({
|
|
|
2479
2479
|
}
|
|
2480
2480
|
});
|
|
2481
2481
|
|
|
2482
|
-
// src/automation/
|
|
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
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
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
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
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:
|
|
2512
|
-
fingerprint:
|
|
2513
|
-
latest:
|
|
2514
|
-
|
|
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
|
|
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 =
|
|
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 =
|
|
2765
|
-
reportSchema =
|
|
2766
|
-
version:
|
|
2767
|
-
root:
|
|
2768
|
-
gitAvailable:
|
|
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:
|
|
2771
|
-
docs:
|
|
2772
|
-
path:
|
|
2773
|
-
scope:
|
|
2774
|
-
kind:
|
|
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:
|
|
2797
|
+
dirty: z7.boolean(),
|
|
2777
2798
|
lineCount: count2
|
|
2778
2799
|
})).nonempty(),
|
|
2779
|
-
decisionsChecked:
|
|
2780
|
-
clean:
|
|
2781
|
-
excludedChecks:
|
|
2782
|
-
issues:
|
|
2783
|
-
advisories:
|
|
2784
|
-
suppressedAdvisories:
|
|
2785
|
-
skippedChecks:
|
|
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 =
|
|
2788
|
-
kind:
|
|
2789
|
-
version:
|
|
2790
|
-
createdAt:
|
|
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:
|
|
2813
|
+
digest: z7.string().regex(/^[a-f0-9]{64}$/)
|
|
2793
2814
|
});
|
|
2794
|
-
repairFindingSchema =
|
|
2795
|
-
id:
|
|
2796
|
-
original:
|
|
2797
|
-
status:
|
|
2798
|
-
reason:
|
|
2799
|
-
current:
|
|
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
|
|
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 =
|
|
3027
|
-
commitSchema2 =
|
|
3028
|
-
evidenceSchema2 =
|
|
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:
|
|
3032
|
-
tree:
|
|
3052
|
+
scope: z8.array(z8.string()).min(1).max(1e3),
|
|
3053
|
+
tree: z8.string().max(2 * 1024 * 1024),
|
|
3033
3054
|
lastScopeCommit: commitSchema2,
|
|
3034
|
-
paths:
|
|
3055
|
+
paths: z8.array(z8.object({ path: z8.string(), exists: z8.boolean() })).max(1e3)
|
|
3035
3056
|
});
|
|
3036
|
-
dismissalReasonSchema =
|
|
3037
|
-
eventSchema2 =
|
|
3038
|
-
at:
|
|
3039
|
-
reviewer:
|
|
3040
|
-
note:
|
|
3041
|
-
outcome:
|
|
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 =
|
|
3047
|
-
reviewSummarySchema =
|
|
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:
|
|
3050
|
-
reason:
|
|
3051
|
-
recordPath:
|
|
3052
|
-
reviewer:
|
|
3053
|
-
note:
|
|
3054
|
-
outcome:
|
|
3055
|
-
reviewedHead:
|
|
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 =
|
|
3058
|
-
baselinePath:
|
|
3078
|
+
advisoryReviewRequest = z8.object({
|
|
3079
|
+
baselinePath: z8.string().min(1),
|
|
3059
3080
|
findingId: hashSchema,
|
|
3060
|
-
action:
|
|
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(),
|