@staix/agent-hub 0.36.0 → 0.38.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/CHANGELOG.md +27 -0
- package/README.md +6 -2
- package/THIRD_PARTY_NOTICES.md +0 -18
- package/docs/agent-notes/README.md +13 -3
- package/docs/agent-notes/daemon.md +4 -4
- package/docs/agent-notes/local-worker.md +1 -0
- package/docs/agent-notes/models.md +2 -1
- package/docs/agent-notes/tasks.md +1 -1
- package/docs/agent-notes/tests.md +1 -2
- package/docs/contracts/companion-cli-v1.json +70 -0
- package/docs/design/adapters.md +43 -2
- package/docs/design/agent-hub-architecture.md +9 -1
- package/docs/design/guidance-probes.md +1167 -0
- package/docs/design/model-routes.md +437 -12
- package/docs/dogfood.md +12 -13
- package/docs/events.md +20 -1
- package/docs/memory.md +3 -3
- package/docs/operations.md +123 -151
- package/docs/profiles.md +1 -1
- package/docs/quickstart.md +15 -3
- package/docs/research.md +1 -1
- package/docs/sdlc.md +5 -3
- package/docs/security.md +25 -1
- package/docs/specs/2026-09-19-agent-hub-design.md +9 -7
- package/docs/specs/2026-10-04-switchyard-source-port-design.md +3 -1
- package/docs/verification/2026-11-08-qwen-0269-model-setter-1317.md +25 -11
- package/docs/verification/2026-11-09-qwen-0270-model-setter-1317.md +21 -6
- package/docs/verification/2026-11-11-0.37.0.md +40 -0
- package/docs/verification/2026-11-11-0.38.0.md +41 -0
- package/docs/verification/2026-11-11-guidance-probe-t2-1226.md +153 -0
- package/docs/verification/2026-11-11-guidance-probe-t3-1226.md +85 -0
- package/docs/verification/2026-11-11-guidance-probe-t4-1226.md +65 -0
- package/docs/verification/2026-11-11-qwen-setter-suggestions-off.md +167 -0
- package/docs/verified.json +25 -25
- package/package.json +3 -4
- package/plugins/agent-hub/.claude-plugin/plugin.json +1 -1
- package/plugins/agent-hub/kimi-hook.js +2403 -1444
- package/plugins/agent-hub/server.js +2480 -1509
- package/src/adapters/channel-peer.ts +7 -1
- package/src/adapters/claude-channel.ts +2 -1
- package/src/adapters/compat.ts +1 -1
- package/src/adapters/local-probe.ts +233 -0
- package/src/adapters/local-worker.ts +232 -21
- package/src/cli/console-state.ts +25 -6
- package/src/cli/console-versions.ts +99 -0
- package/src/cli/console.ts +13 -1
- package/src/cli/help.ts +2 -1
- package/src/cli/init.ts +3 -1
- package/src/cli/install-paths.ts +7 -2
- package/src/cli/main.ts +78 -7
- package/src/cli/output.ts +8 -4
- package/src/cli/runtime-version-warning.ts +2 -2
- package/src/cli/sdlc-output.ts +9 -5
- package/src/cli/upgrade-runtime.ts +1 -1
- package/src/hub/bus.ts +2 -2
- package/src/hub/config-apply.ts +4 -2
- package/src/hub/config-trust.ts +6 -1
- package/src/hub/control-client.ts +5 -2
- package/src/hub/daemon.ts +195 -13
- package/src/hub/envelope.ts +6 -1
- package/src/hub/events.ts +3 -2
- package/src/hub/guidance-probe-store.ts +1044 -0
- package/src/hub/guidance-probes.ts +692 -0
- package/src/hub/inference.ts +18 -5
- package/src/hub/manager.ts +24 -1
- package/src/hub/operational-authority.ts +14 -1
- package/src/hub/peers.ts +5 -0
- package/src/hub/person-command.ts +25 -0
- package/src/hub/ports.ts +1 -1
- package/src/hub/progress.ts +23 -16
- package/src/hub/report.ts +2 -0
- package/src/hub/research.ts +1 -0
- package/src/hub/restart.ts +7 -0
- package/src/hub/sdlc-release-authorization.ts +139 -17
- package/src/hub/sdlc-release-policy.ts +100 -0
- package/src/hub/sdlc-release.ts +59 -7
- package/src/hub/supervision.ts +3 -2
- package/src/hub/tasks.ts +363 -7
- package/src/local/probe-errors.ts +28 -0
- package/src/local/probe-sandbox.ts +224 -0
- package/src/local/probe-types.ts +110 -0
- package/src/local/probe-workspace.ts +426 -0
- package/src/local/sandbox.ts +71 -2
- package/src/local/tools.ts +135 -9
- package/src/models/route/advisor-trigger.ts +88 -0
- package/src/models/route/config.ts +21 -17
- package/src/models/route/conversation-view.ts +179 -0
- package/src/models/route/decision-evidence.ts +1 -1
- package/src/models/route/decision.ts +114 -19
- package/src/models/route/escalation-control.ts +30 -0
- package/src/models/route/hub-prompts.ts +97 -0
- package/src/models/route/judge-choice.ts +155 -0
- package/src/models/route/judge-replies.ts +102 -0
- package/src/models/route/labels.ts +14 -70
- package/src/models/route/observation-signals.ts +250 -0
- package/src/models/route/plan-execute-choice.ts +27 -0
- package/src/models/route/relay-selector.ts +2 -2
- package/src/models/route/runtime.ts +115 -52
- package/src/models/route/turn-state.ts +77 -0
- package/src/omniroute/client.ts +3 -0
- package/src/ui/guidance-panel.ts +34 -2
- package/src/ui/guidance-view.ts +33 -0
- package/src/ui/plugin.ts +80 -23
- package/src/version.ts +4 -0
- package/templates/AGENTS.block.md +14 -14
- package/templates/adec/README.md +32 -0
- package/templates/adec/ahub.plan-execute.json +23 -0
- package/templates/adec/ahub.stage.json +23 -0
- package/templates/profiles/general.json +1 -1
- package/templates/profiles/research.json +1 -1
- package/templates/profiles/writing.json +1 -1
- package/LICENSES/Apache-2.0.txt +0 -204
- package/src/models/route/advisor.ts +0 -102
- package/src/models/route/escalation.ts +0 -82
- package/src/models/route/judge.ts +0 -23
- package/src/models/route/normalize.ts +0 -103
- package/src/models/route/plan-execute.ts +0 -52
- package/src/models/route/prompts.ts +0 -8
- package/src/models/route/signals.ts +0 -247
- package/src/models/route/state.ts +0 -54
- package/src/models/route/text.ts +0 -61
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { ReleaseGit } from "./sdlc-release.ts";
|
|
2
|
+
|
|
3
|
+
export type ReleaseVersionPolicy =
|
|
4
|
+
| { source: "package.json" }
|
|
5
|
+
| { source: "release-notes"; notesPath: string }
|
|
6
|
+
| { source: "none" };
|
|
7
|
+
export type ReleaseDocsPolicy = { source: "checker" } | { source: "none" };
|
|
8
|
+
export interface ReleasePolicy { version: ReleaseVersionPolicy; docs: ReleaseDocsPolicy }
|
|
9
|
+
|
|
10
|
+
export const DEFAULT_RELEASE_POLICY: ReleasePolicy = {
|
|
11
|
+
version: { source: "package.json" },
|
|
12
|
+
docs: { source: "checker" },
|
|
13
|
+
};
|
|
14
|
+
export const DEFAULT_RELEASE_NOTES_PATH = "docs/releases/v{version}.md";
|
|
15
|
+
|
|
16
|
+
const record = (value: unknown): Record<string, unknown> | undefined =>
|
|
17
|
+
!!value && typeof value === "object" && !Array.isArray(value) ? value as Record<string, unknown> : undefined;
|
|
18
|
+
|
|
19
|
+
function checkedNotesPath(value: unknown): string {
|
|
20
|
+
if (typeof value !== "string" || value.length > 1024 || !value.includes("{version}")
|
|
21
|
+
|| (value.match(/\{version\}/g)?.length ?? 0) !== 1 || /[\p{Cc}\\:*?\[\]]/u.test(value)
|
|
22
|
+
|| value.startsWith("/") || value.startsWith("-") || /^[A-Za-z]:/.test(value)
|
|
23
|
+
|| value.split("/").some(part => !part || part === "." || part === ".." || part.startsWith("-"))) {
|
|
24
|
+
throw new Error("release.notesPath must be a safe repository-relative path with exactly one {version} placeholder");
|
|
25
|
+
}
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Parse only the release contract; unrelated project configuration is deliberately outside this policy reader. */
|
|
30
|
+
export function parseReleasePolicy(config: unknown): ReleasePolicy {
|
|
31
|
+
const root = record(config);
|
|
32
|
+
if (!root) throw new Error("committed .agenthub/config.json must be a JSON object");
|
|
33
|
+
if (root.release === undefined) return DEFAULT_RELEASE_POLICY;
|
|
34
|
+
const release = record(root.release);
|
|
35
|
+
if (!release || Object.keys(release).some(key => !["version", "notesPath", "docs"].includes(key))) {
|
|
36
|
+
throw new Error("committed release config must contain only version, notesPath and docs");
|
|
37
|
+
}
|
|
38
|
+
const rawVersion = release.version === undefined ? "package.json" : release.version;
|
|
39
|
+
if (rawVersion !== "package.json" && rawVersion !== "release-notes" && rawVersion !== "none") {
|
|
40
|
+
throw new Error("release.version in committed .agenthub/config.json must be package.json, release-notes or none");
|
|
41
|
+
}
|
|
42
|
+
const rawDocs = release.docs === undefined ? "checker" : release.docs;
|
|
43
|
+
if (rawDocs !== "checker" && rawDocs !== "none") throw new Error("release.docs in committed .agenthub/config.json must be checker or none");
|
|
44
|
+
const notesPath = checkedNotesPath(release.notesPath === undefined ? DEFAULT_RELEASE_NOTES_PATH : release.notesPath);
|
|
45
|
+
return {
|
|
46
|
+
version: rawVersion === "release-notes" ? { source: rawVersion, notesPath }
|
|
47
|
+
: rawVersion === "none" ? { source: rawVersion } : { source: rawVersion },
|
|
48
|
+
docs: rawDocs === "none" ? { source: rawDocs } : { source: rawDocs },
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
interface TreeEntry { mode: string; type: string; oid: string; path: string }
|
|
53
|
+
function treeEntry(git: ReleaseGit, commit: string, path: string): TreeEntry | undefined {
|
|
54
|
+
const result = git(["--literal-pathspecs", "ls-tree", "-z", "--full-tree", commit, "--", path]);
|
|
55
|
+
if (result.code !== 0 || Buffer.byteLength(result.stdout) > 16 * 1024) throw new Error("committed release policy tree is unreadable");
|
|
56
|
+
const rows = result.stdout.split("\0").filter(Boolean);
|
|
57
|
+
if (rows.length > 1) throw new Error("committed release policy path is ambiguous");
|
|
58
|
+
if (!rows.length) return undefined;
|
|
59
|
+
const match = rows[0]!.match(/^(\d{6}) (blob|tree|commit) ([0-9a-f]{40})\t([^\0]+)$/);
|
|
60
|
+
if (!match || match[4] !== path) throw new Error("committed release policy tree is malformed");
|
|
61
|
+
return { mode: match[1]!, type: match[2]!, oid: match[3]!, path: match[4]! };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function regularBlob(git: ReleaseGit, commit: string, path: string): boolean {
|
|
65
|
+
const parts = path.split("/");
|
|
66
|
+
for (let index = 1; index < parts.length; index++) {
|
|
67
|
+
const parent = parts.slice(0, index).join("/");
|
|
68
|
+
const entry = treeEntry(git, commit, parent);
|
|
69
|
+
if (!entry || entry.mode !== "040000" || entry.type !== "tree") return false;
|
|
70
|
+
}
|
|
71
|
+
const file = treeEntry(git, commit, path);
|
|
72
|
+
return !!file && (file.mode === "100644" || file.mode === "100755") && file.type === "blob";
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Read policy only from the candidate commit. Missing shared config means the legacy defaults; unreadable data fails closed. */
|
|
76
|
+
export function readCommittedReleasePolicy(git: ReleaseGit, commit: string): ReleasePolicy {
|
|
77
|
+
const agentHub = treeEntry(git, commit, ".agenthub");
|
|
78
|
+
if (!agentHub) return DEFAULT_RELEASE_POLICY;
|
|
79
|
+
if (agentHub.mode !== "040000" || agentHub.type !== "tree") throw new Error("committed .agenthub is not a regular directory");
|
|
80
|
+
const path = ".agenthub/config.json";
|
|
81
|
+
const configEntry = treeEntry(git, commit, path);
|
|
82
|
+
if (!configEntry) return DEFAULT_RELEASE_POLICY;
|
|
83
|
+
if ((configEntry.mode !== "100644" && configEntry.mode !== "100755") || configEntry.type !== "blob") {
|
|
84
|
+
throw new Error("committed .agenthub/config.json is not a regular file");
|
|
85
|
+
}
|
|
86
|
+
const result = git(["show", `${commit}:${path}`]);
|
|
87
|
+
if (result.code !== 0 || Buffer.byteLength(result.stdout) > 256 * 1024) throw new Error("committed .agenthub/config.json is unreadable");
|
|
88
|
+
let parsed: unknown;
|
|
89
|
+
try { parsed = JSON.parse(result.stdout); } catch { throw new Error("committed .agenthub/config.json is malformed JSON"); }
|
|
90
|
+
const policy = parseReleasePolicy(parsed);
|
|
91
|
+
if (policy.docs.source === "none" && regularBlob(git, commit, "docs/verified.json")) {
|
|
92
|
+
throw new Error("release.docs is none but the candidate commits docs/verified.json; remove release.docs from .agenthub/config.json or delete the manifest, then authorize again");
|
|
93
|
+
}
|
|
94
|
+
return policy;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Ensure every directory component and the final notes path are committed as non-symlink tree/blob entries. */
|
|
98
|
+
export function hasCommittedReleaseNotes(git: ReleaseGit, commit: string, path: string): boolean {
|
|
99
|
+
try { return regularBlob(git, commit, path); } catch { return false; }
|
|
100
|
+
}
|
package/src/hub/sdlc-release.ts
CHANGED
|
@@ -22,9 +22,18 @@ const sdlcGh: SdlcGh = async (...args) => {
|
|
|
22
22
|
catch { return { code: 1, stdout: "" }; }
|
|
23
23
|
};
|
|
24
24
|
export interface DocEvidence { schemaVersion: 1; head?: string; version?: string; documents: { path?: string; state: "fresh" | "stale" | "nonancestor" | "unknown"; verifiedAgainst?: string; commits?: number; dirty?: boolean }[]; errors: number; fresh: boolean; }
|
|
25
|
-
export
|
|
25
|
+
export type ReleaseReportSource = "package.json" | "release-notes" | "none" | "unknown";
|
|
26
|
+
export type ReleaseReportDocsSource = "checker" | "none" | "unknown";
|
|
27
|
+
export type ReleaseReportAuthorizationState = "matched" | "missing" | "stale" | "unavailable";
|
|
28
|
+
export interface ReleaseReportPolicy {
|
|
29
|
+
versionSource: ReleaseReportSource;
|
|
30
|
+
docsSource: ReleaseReportDocsSource;
|
|
31
|
+
authorization: ReleaseReportAuthorizationState;
|
|
32
|
+
version?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ReleaseReadiness { /** #481 AC12: interval, approval-to-release lead time and hotfix rate over shipped releases, filled by Tasks.releaseReadiness. */ releaseMetrics?: ReturnType<typeof releaseMetrics>; releasePolicy?: ReleaseReportPolicy; repo: string; head?: string; version?: string; tag?: string; tagCommit?: string; commits: string[]; mergedPrs: { pr: number; commit: string }[]; documents?: DocEvidence; liveIssues: { id: number; state: "open" | "closed" | "unknown" }[]; blockers: string[]; sourceReady: boolean; native: "unverified"; ready: false; }
|
|
26
35
|
export type ReleaseGit = (args: string[]) => { code: number; stdout: string };
|
|
27
|
-
export interface ReleaseReaders { gh?: SdlcGh; git?: ReleaseGit; docs?: (root: string, timeoutMs: number) => Promise<DocEvidence | undefined>; /** Test seam (#1120): the checker program the default docs reader spawns. */ checker?: string; }
|
|
36
|
+
export interface ReleaseReaders { gh?: SdlcGh; git?: ReleaseGit; docs?: (root: string, timeoutMs: number) => Promise<DocEvidence | undefined>; /** Host-only selected authorization/config metadata; absent preserves standalone package.json behavior. */ reportPolicy?: (head: string, repo: string) => ReleaseReportPolicy | undefined; /** Test seam (#1120): the checker program the default docs reader spawns. */ checker?: string; }
|
|
28
37
|
const SHA = /^[0-9a-f]{40}$/;
|
|
29
38
|
const VERSION = /^[0-9]+\.[0-9]+\.[0-9]+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
30
39
|
const REPO = /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;
|
|
@@ -72,7 +81,34 @@ export async function readReleaseReadiness(root: string, repo: string, liveIssue
|
|
|
72
81
|
const git: ReleaseGit = readers.git ?? (args => { const r = hubGitSync(args, { cwd: root, encoding: "utf8", timeout: Math.max(1, Math.min(1000, deadline - performance.now())), maxBuffer: 256 * 1024 }); return { code: r.status ?? 1, stdout: r.stdout ?? "" }; });
|
|
73
82
|
const first = git(["rev-parse","--verify","HEAD"]); const head = first.stdout.trim();
|
|
74
83
|
if (first.code !== 0 || !SHA.test(head)) { report.blockers.push("local HEAD unknown"); return report; } report.head = head;
|
|
75
|
-
|
|
84
|
+
let releasePolicy: ReleaseReportPolicy | undefined;
|
|
85
|
+
if (readers.reportPolicy) {
|
|
86
|
+
try { releasePolicy = readers.reportPolicy(head, repo); } catch { releasePolicy = { versionSource: "unknown", docsSource: "unknown", authorization: "unavailable" }; }
|
|
87
|
+
if (releasePolicy) {
|
|
88
|
+
report.releasePolicy = { versionSource: releasePolicy.versionSource, docsSource: releasePolicy.docsSource, authorization: releasePolicy.authorization };
|
|
89
|
+
if (releasePolicy.versionSource === "package.json") {
|
|
90
|
+
try { const r = git(["show",`${head}:package.json`]), pkg = JSON.parse(r.stdout); if (r.code === 0 && typeof pkg.version === "string" && VERSION.test(pkg.version)) report.version = pkg.version; else report.blockers.push("package version unknown"); } catch { report.blockers.push("package version unknown"); }
|
|
91
|
+
if (releasePolicy.authorization === "unavailable") report.blockers.push("committed release policy unavailable; commit a valid release policy and authorize the candidate");
|
|
92
|
+
else if (releasePolicy.authorization === "stale") report.blockers.push("release authorization source is stale; authorize the exact candidate version again");
|
|
93
|
+
else if (releasePolicy.authorization === "missing") report.blockers.push("release authorization not recorded for the committed package.json version; run ahub sdlc authorize-release <version>");
|
|
94
|
+
} else if (releasePolicy.authorization === "matched" && typeof releasePolicy.version === "string" && VERSION.test(releasePolicy.version)) {
|
|
95
|
+
report.version = releasePolicy.version;
|
|
96
|
+
} else if (releasePolicy.authorization === "unavailable" || releasePolicy.versionSource === "unknown") {
|
|
97
|
+
report.blockers.push("committed release policy unavailable; commit a valid release policy and authorize the candidate");
|
|
98
|
+
} else if (releasePolicy.authorization === "stale") {
|
|
99
|
+
report.blockers.push(releasePolicy.versionSource === "release-notes"
|
|
100
|
+
? "release-notes source is stale; commit the configured notes file and authorize the exact version"
|
|
101
|
+
: "release authorization source is stale; authorize the exact candidate version again");
|
|
102
|
+
} else {
|
|
103
|
+
report.blockers.push(`release version undetermined from configured ${releasePolicy.versionSource} source; run ahub sdlc authorize-release <version>`);
|
|
104
|
+
}
|
|
105
|
+
} else {
|
|
106
|
+
// The committed package.json/checker default keeps its existing report shape.
|
|
107
|
+
try { const r = git(["show",`${head}:package.json`]), pkg = JSON.parse(r.stdout); if (r.code === 0 && typeof pkg.version === "string" && VERSION.test(pkg.version)) report.version = pkg.version; else report.blockers.push("package version unknown"); } catch { report.blockers.push("package version unknown"); }
|
|
108
|
+
}
|
|
109
|
+
} else {
|
|
110
|
+
try { const r = git(["show",`${head}:package.json`]), pkg = JSON.parse(r.stdout); if (r.code === 0 && typeof pkg.version === "string" && VERSION.test(pkg.version)) report.version = pkg.version; else report.blockers.push("package version unknown"); } catch { report.blockers.push("package version unknown"); }
|
|
111
|
+
}
|
|
76
112
|
const published = await gh(["release","list","--repo",repo,"--exclude-drafts","--order","desc","--limit","1","--json","tagName,isDraft,isPrerelease"]);
|
|
77
113
|
let tag: string | undefined;
|
|
78
114
|
try { const rows = JSON.parse(published.stdout), p = Array.isArray(rows) && rows.length === 1 ? rows[0] : undefined; if (published.code === 0 && p && typeof p.tagName === "string" && p.tagName.startsWith("v") && VERSION.test(p.tagName.slice(1)) && p.isDraft === false && typeof p.isPrerelease === "boolean") tag = p.tagName; } catch { /* unknown metadata */ }
|
|
@@ -91,7 +127,8 @@ export async function readReleaseReadiness(root: string, repo: string, liveIssue
|
|
|
91
127
|
if (work.code !== 0 || commits.length > 1000 || commits.some(c => !SHA.test(c))) report.blockers.push("merged work coverage unknown or truncated"); else report.commits = commits;
|
|
92
128
|
let advanced = false;
|
|
93
129
|
try { advanced = !!report.version && Bun.semver.order(report.version, tag.slice(1)) > 0; } catch { /* invalid version remains blocked */ }
|
|
94
|
-
if (!advanced) report.blockers.push("package version has not advanced past published release");
|
|
130
|
+
if (!advanced && (!report.releasePolicy || report.releasePolicy.versionSource === "package.json")) report.blockers.push("package version has not advanced past published release");
|
|
131
|
+
else if (!advanced && report.version) report.blockers.push("release version has not advanced past published release");
|
|
95
132
|
}
|
|
96
133
|
}
|
|
97
134
|
if (report.tagCommit) {
|
|
@@ -112,10 +149,13 @@ export async function readReleaseReadiness(root: string, repo: string, liveIssue
|
|
|
112
149
|
} catch { report.blockers.push("merged PR coverage unknown or truncated"); break; }
|
|
113
150
|
}
|
|
114
151
|
}
|
|
115
|
-
const
|
|
116
|
-
|
|
152
|
+
const skipDocs = report.releasePolicy?.docsSource === "none" || report.releasePolicy?.authorization === "unavailable"
|
|
153
|
+
|| !!report.releasePolicy && report.releasePolicy.versionSource !== "package.json" && report.releasePolicy.authorization !== "matched";
|
|
154
|
+
const left = deadline - performance.now();
|
|
155
|
+
report.documents = !skipDocs && left > 0 ? await (readers.docs ?? ((dir, ms) => readDocEvidenceDetailed(dir, ms, readers.checker).then(read => "evidence" in read ? read.evidence : undefined)))(root,Math.min(10_000,left)) : undefined;
|
|
156
|
+
const checkerMissing = !skipDocs && !readers.docs && !existsSync(readers.checker ?? CHECKER_PATH); // #1120: a hub without the checker says so instead of calling the documents stale
|
|
117
157
|
if (checkerMissing) report.blockers.push("documentation checker unavailable in the running hub: " + CHECKER_MISSING);
|
|
118
|
-
else if (!report.documents || report.documents.head !== head || !report.documents.fresh || report.documents.errors || report.documents.documents.some(d => d.state !== "fresh")) report.blockers.push("documentation freshness or ancestry is unknown or stale");
|
|
158
|
+
else if (!skipDocs && (!report.documents || report.documents.head !== head || !report.documents.fresh || report.documents.errors || report.documents.documents.some(d => d.state !== "fresh"))) report.blockers.push("documentation freshness or ancestry is unknown or stale");
|
|
119
159
|
if (!liveIssues.length) report.blockers.push("native verification ledger unspecified");
|
|
120
160
|
for (const id of liveIssues) {
|
|
121
161
|
const reply = await gh(["issue","view",String(id),"--repo",repo,"--json","number,state"]); let state: "open"|"closed"|"unknown" = "unknown";
|
|
@@ -148,6 +188,18 @@ export async function readReleaseReadiness(root: string, repo: string, liveIssue
|
|
|
148
188
|
if (!issuesStable) report.blockers.push("live issue states changed or could not be reverified");
|
|
149
189
|
}
|
|
150
190
|
const last = git(["rev-parse","--verify","HEAD"]); if (last.code !== 0 || last.stdout.trim() !== head) report.blockers.push("local HEAD changed during release readback");
|
|
191
|
+
if (report.releasePolicy?.authorization === "matched" && readers.reportPolicy) {
|
|
192
|
+
let current: ReleaseReportPolicy | undefined;
|
|
193
|
+
try { current = readers.reportPolicy(head, repo); } catch { /* a report recheck failure is stale authorization */ }
|
|
194
|
+
const prior = report.releasePolicy;
|
|
195
|
+
if (!current || current.authorization !== "matched" || current.versionSource !== prior.versionSource
|
|
196
|
+
|| current.docsSource !== prior.docsSource || current.version !== report.version) {
|
|
197
|
+
report.releasePolicy = { ...prior, authorization: "stale" };
|
|
198
|
+
if (prior.versionSource !== "package.json") report.version = undefined;
|
|
199
|
+
report.sourceReady = false;
|
|
200
|
+
report.blockers.push("release authorization source changed during release readback; authorize the exact candidate version again");
|
|
201
|
+
}
|
|
202
|
+
}
|
|
151
203
|
report.blockers = [...new Set(report.blockers)]; report.sourceReady = report.blockers.length === 0;
|
|
152
204
|
// Closed issue metadata is not a native receipt or permission to publish.
|
|
153
205
|
report.blockers.push("native acceptance and person release decision unverified");
|
package/src/hub/supervision.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { queueResolveCommand } from "./person-command.ts";
|
|
1
2
|
import { isClosedTaskState, type HistoryEntry, type Task, type TaskMoveReason, type TaskStall } from "./board.ts";
|
|
2
3
|
import { sanitize, type Kind, type Priority } from "./envelope.ts";
|
|
3
4
|
|
|
@@ -139,11 +140,11 @@ export class SupervisionFeed {
|
|
|
139
140
|
return sent;
|
|
140
141
|
}
|
|
141
142
|
|
|
142
|
-
needsReview(peer: string, deliveryId: string): boolean {
|
|
143
|
+
needsReview(peer: string, deliveryId: string, command: string | (() => string) = () => queueResolveCommand({ id: deliveryId, peer })): boolean { // a thunk is built only when the notice is sent, not on every tick
|
|
143
144
|
const conductor = this.recipient();
|
|
144
145
|
const key = `${conductor}:${peer}:${deliveryId}`;
|
|
145
146
|
if (!conductor || this.holds.has(key)) return false;
|
|
146
|
-
const sent = this.send(`hold:${peer}:${deliveryId}`, `${peer}: needs_review hold; delivery ${deliveryId};
|
|
147
|
+
const sent = this.send(`hold:${peer}:${deliveryId}`, `${peer}: needs_review hold; delivery ${deliveryId}; give the person this command exactly as printed: ${typeof command === "string" ? command : command()}`, "important");
|
|
147
148
|
if (sent) this.holds.add(key);
|
|
148
149
|
return sent;
|
|
149
150
|
}
|