@mstar-harness/cli 4.0.5 → 4.0.6
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/dist/mstar-harness.js +185 -136
- package/package.json +1 -1
package/dist/mstar-harness.js
CHANGED
|
@@ -92,6 +92,7 @@ __export(exports_engine, {
|
|
|
92
92
|
KNOWLEDGE_SEVERITIES: () => KNOWLEDGE_SEVERITIES,
|
|
93
93
|
LEGACY_ARCHIVE_SKILL: () => LEGACY_ARCHIVE_SKILL,
|
|
94
94
|
LEGACY_WORKTREE_PATH_CODE: () => LEGACY_WORKTREE_PATH_CODE,
|
|
95
|
+
MAX_DASHBOARD_SEARCH_LENGTH: () => MAX_DASHBOARD_SEARCH_LENGTH,
|
|
95
96
|
MAX_STATUS_CONTENT_LENGTH: () => MAX_STATUS_CONTENT_LENGTH,
|
|
96
97
|
MAX_SYMLINK_HOPS: () => MAX_SYMLINK_HOPS,
|
|
97
98
|
MERGE_CLASSES: () => MERGE_CLASSES,
|
|
@@ -219,6 +220,8 @@ __export(exports_engine, {
|
|
|
219
220
|
createFsStore: () => createFsStore,
|
|
220
221
|
createLocalExecutionIdentity: () => createLocalExecutionIdentity,
|
|
221
222
|
currentAuthorityHandle: () => currentAuthorityHandle,
|
|
223
|
+
dashboardFailure: () => dashboardFailure,
|
|
224
|
+
dashboardFilters: () => dashboardFilters,
|
|
222
225
|
decodeExecutionSessionRef: () => decodeExecutionSessionRef,
|
|
223
226
|
deliveryBranchOf: () => deliveryBranchOf,
|
|
224
227
|
deliveryEvidenceViolations: () => deliveryEvidenceViolations,
|
|
@@ -320,6 +323,7 @@ __export(exports_engine, {
|
|
|
320
323
|
queryMilestones: () => queryMilestones,
|
|
321
324
|
readCatalogCompleteness: () => readCatalogCompleteness,
|
|
322
325
|
readCatalogRevisions: () => readCatalogRevisions,
|
|
326
|
+
readDashboardView: () => readDashboardView,
|
|
323
327
|
readDeclaredNodeFloor: () => readDeclaredNodeFloor,
|
|
324
328
|
readDshLedgerWindow: () => readDshLedgerWindow,
|
|
325
329
|
readDshScanBound: () => readDshScanBound,
|
|
@@ -344,11 +348,13 @@ __export(exports_engine, {
|
|
|
344
348
|
recoverExecutionCoordinator: () => recoverExecutionCoordinator,
|
|
345
349
|
referenceExists: () => referenceExists,
|
|
346
350
|
refreshProjections: () => refreshProjections,
|
|
351
|
+
refuse: () => refuse,
|
|
347
352
|
registerCatalogEntity: () => registerCatalogEntity,
|
|
348
353
|
registerShippedCatalogExecution: () => registerShippedCatalogExecution,
|
|
349
354
|
reopenIssue: () => reopenIssue,
|
|
350
355
|
reopenIssueOn: () => reopenIssueOn,
|
|
351
356
|
replaceRoadmapAuthority: () => replaceRoadmapAuthority,
|
|
357
|
+
requireSafeId: () => requireSafeId,
|
|
352
358
|
resolveArtifactPath: () => resolveArtifactPath,
|
|
353
359
|
resolveAssetPath: () => resolveAssetPath,
|
|
354
360
|
resolveCompassEnforcement: () => resolveCompassEnforcement,
|
|
@@ -13424,7 +13430,7 @@ function unresolvedOwnSession(address, rows) {
|
|
|
13424
13430
|
const code2 = holder === undefined ? "coordination.session-not-found" : "coordination.identity-mismatch";
|
|
13425
13431
|
const currentFacts = [
|
|
13426
13432
|
`the trusted caller is coordinator session ${address.sessionId} of workflow ${address.workflowId}`,
|
|
13427
|
-
holder === undefined ? `workflow ${address.workflowId} records no coordinator session ${address.sessionId} and holds no ACTIVE coordinator session` : `workflow ${address.workflowId} holds
|
|
13433
|
+
holder === undefined ? `workflow ${address.workflowId} records no coordinator session ${address.sessionId} and holds no ACTIVE coordinator session` : `workflow ${address.workflowId} holds an ACTIVE coordinator session at epoch ${holder.ref.epoch}`
|
|
13428
13434
|
];
|
|
13429
13435
|
const problem = {
|
|
13430
13436
|
component: "session",
|
|
@@ -13435,7 +13441,7 @@ function unresolvedOwnSession(address, rows) {
|
|
|
13435
13441
|
"the trusted caller identity (workflow, role, session)"
|
|
13436
13442
|
],
|
|
13437
13443
|
currentFacts,
|
|
13438
|
-
needed: holder === undefined ? `a binding this identity can resume: bind coordinator session ${address.sessionId} to workflow ${address.workflowId}` : `the stop/recovery decision for the live coordinator
|
|
13444
|
+
needed: holder === undefined ? `a binding this identity can resume: bind coordinator session ${address.sessionId} to workflow ${address.workflowId}` : `the stop/recovery decision for the live coordinator: the named coordinator recovery with ` + `stop evidence for that holder`,
|
|
13439
13445
|
withheldEffect: `only this identity's own session binding and reference \u2014 no row was written, and the coordinator scope of ` + `workflow ${address.workflowId} is never taken over by another name here`,
|
|
13440
13446
|
availableWork: [
|
|
13441
13447
|
`read the state of workflow ${address.workflowId} and every plan row it holds`,
|
|
@@ -13451,7 +13457,7 @@ function unresolvedOwnSession(address, rows) {
|
|
|
13451
13457
|
workflow_id: address.workflowId,
|
|
13452
13458
|
role: address.role,
|
|
13453
13459
|
session_id: address.sessionId,
|
|
13454
|
-
...holder === undefined ? {} : {
|
|
13460
|
+
...holder === undefined ? {} : { holder_epoch: holder.ref.epoch },
|
|
13455
13461
|
sources_tried: problem.sourcesTried,
|
|
13456
13462
|
current_facts: problem.currentFacts,
|
|
13457
13463
|
available_work: problem.availableWork,
|
|
@@ -28476,6 +28482,98 @@ async function registerShippedCatalogExecution(context, input) {
|
|
|
28476
28482
|
request.expectedCatalogRevision = resolved.catalogRevision;
|
|
28477
28483
|
return commitExecutionRegistration(context, { ...request, expected: resolved.expected });
|
|
28478
28484
|
}
|
|
28485
|
+
function refuse(message) {
|
|
28486
|
+
throw new SddScriptError(message, 2);
|
|
28487
|
+
}
|
|
28488
|
+
function requireSafeId(label, value) {
|
|
28489
|
+
if (value === "" || value === "." || value === ".." || /[/\\\u0000]/.test(value)) {
|
|
28490
|
+
refuse(`${label} must be a single safe id`);
|
|
28491
|
+
}
|
|
28492
|
+
return value;
|
|
28493
|
+
}
|
|
28494
|
+
function queryValue(params, field) {
|
|
28495
|
+
const value = params[field];
|
|
28496
|
+
if (value === undefined || value === "")
|
|
28497
|
+
return;
|
|
28498
|
+
return value;
|
|
28499
|
+
}
|
|
28500
|
+
function parsePageInteger(raw, field, max) {
|
|
28501
|
+
if (raw === undefined)
|
|
28502
|
+
return;
|
|
28503
|
+
if (!/^[0-9]+$/.test(raw))
|
|
28504
|
+
refuse(`${field} must be a nonnegative integer`);
|
|
28505
|
+
const value = Number(raw);
|
|
28506
|
+
if (max !== undefined && (value < 1 || value > max))
|
|
28507
|
+
refuse(`${field} must be an integer between 1 and ${max}`);
|
|
28508
|
+
return value;
|
|
28509
|
+
}
|
|
28510
|
+
function dashboardFilters(view, params = {}, id) {
|
|
28511
|
+
const accepted = VIEW_QUERY_FIELDS[view];
|
|
28512
|
+
if (!Array.isArray(accepted))
|
|
28513
|
+
refuse(`unknown dashboard view ${JSON.stringify(String(view))}`);
|
|
28514
|
+
for (const field of Object.keys(params)) {
|
|
28515
|
+
if (!accepted.includes(field))
|
|
28516
|
+
refuse(`${JSON.stringify(field)} is not a supported ${view} query parameter`);
|
|
28517
|
+
}
|
|
28518
|
+
const limit = parsePageInteger(queryValue(params, "limit"), "limit", 200);
|
|
28519
|
+
const offset = parsePageInteger(queryValue(params, "offset"), "offset");
|
|
28520
|
+
const project2 = queryValue(params, "project");
|
|
28521
|
+
const scoped = project2 === undefined ? undefined : requireSafeId("project", project2);
|
|
28522
|
+
if (view === "issues") {
|
|
28523
|
+
const disposition = queryValue(params, "disposition");
|
|
28524
|
+
if (disposition !== undefined && DISPOSITIONS3[disposition] !== true) {
|
|
28525
|
+
refuse(`disposition must be one of ${Object.keys(DISPOSITIONS3).join(", ")}`);
|
|
28526
|
+
}
|
|
28527
|
+
const kind = queryValue(params, "kind");
|
|
28528
|
+
if (kind !== undefined && KINDS2[kind] !== true)
|
|
28529
|
+
refuse(`kind must be one of ${Object.keys(KINDS2).join(", ")}`);
|
|
28530
|
+
const severity = queryValue(params, "severity");
|
|
28531
|
+
if (severity !== undefined && SEVERITIES2[severity] !== true) {
|
|
28532
|
+
refuse(`severity must be one of ${Object.keys(SEVERITIES2).join(", ")}`);
|
|
28533
|
+
}
|
|
28534
|
+
const search2 = queryValue(params, "q");
|
|
28535
|
+
if (search2 !== undefined && search2.length > MAX_DASHBOARD_SEARCH_LENGTH) {
|
|
28536
|
+
refuse(`q must be at most ${MAX_DASHBOARD_SEARCH_LENGTH} characters`);
|
|
28537
|
+
}
|
|
28538
|
+
const issue = {
|
|
28539
|
+
...scoped === undefined ? {} : { projectId: scoped },
|
|
28540
|
+
...disposition === undefined ? {} : { disposition },
|
|
28541
|
+
...kind === undefined ? {} : { kind },
|
|
28542
|
+
...severity === undefined ? {} : { severity },
|
|
28543
|
+
...search2 === undefined ? {} : { query: search2 },
|
|
28544
|
+
...limit === undefined ? {} : { limit },
|
|
28545
|
+
...offset === undefined ? {} : { offset }
|
|
28546
|
+
};
|
|
28547
|
+
return { issue };
|
|
28548
|
+
}
|
|
28549
|
+
if (view === "issue-detail" || view === "workflow-detail" || view === "iteration-detail") {
|
|
28550
|
+
if (id === undefined)
|
|
28551
|
+
refuse(`the ${view} route requires an id`);
|
|
28552
|
+
return { id: requireSafeId(`${view} id`, id) };
|
|
28553
|
+
}
|
|
28554
|
+
if (view === "roadmap" && scoped === undefined) {
|
|
28555
|
+
refuse("the roadmap view requires a project query parameter");
|
|
28556
|
+
}
|
|
28557
|
+
return {
|
|
28558
|
+
...scoped === undefined ? {} : { projectId: scoped },
|
|
28559
|
+
...limit === undefined ? {} : { limit },
|
|
28560
|
+
...offset === undefined ? {} : { offset }
|
|
28561
|
+
};
|
|
28562
|
+
}
|
|
28563
|
+
async function readDashboardView(input) {
|
|
28564
|
+
const filters = dashboardFilters(input.view, input.params ?? {}, input.id);
|
|
28565
|
+
const query = queryDashboard(input.view, filters);
|
|
28566
|
+
return withStoreRead(input.context, query);
|
|
28567
|
+
}
|
|
28568
|
+
function dashboardFailure(error) {
|
|
28569
|
+
if (error instanceof SddScriptError)
|
|
28570
|
+
return { code: "usage", message: error.message };
|
|
28571
|
+
const code2 = error?.code;
|
|
28572
|
+
if (typeof code2 === "string" && code2 !== "") {
|
|
28573
|
+
return { code: code2, message: error instanceof Error ? error.message : String(error) };
|
|
28574
|
+
}
|
|
28575
|
+
return { code: "internal-error", message: error instanceof Error ? error.message : String(error) };
|
|
28576
|
+
}
|
|
28479
28577
|
function sha256Bytes4(bytes) {
|
|
28480
28578
|
return createHash19("sha256").update(bytes).digest("hex");
|
|
28481
28579
|
}
|
|
@@ -30846,7 +30944,7 @@ drop table issue_transitions_v12_stage;
|
|
|
30846
30944
|
select issues.registered_at as ts
|
|
30847
30945
|
union all select o.discovered_at from occurrences o where o.issue_id = issues.id
|
|
30848
30946
|
union all select t.occurred_at from issue_transitions t where t.issue_id = issues.id
|
|
30849
|
-
))`, ISSUE_ORDER_SQL, TERMINAL_DISPOSITIONS = "'resolved', 'waived', 'duplicate', 'superseded'", IDENTITY_COLUMNS = "kind, id, title, description, root_kind, relative_path, document_kind, lifecycle, revision, registered_at, updated_at", completeWitnessGapForTest, workflowWitnessGapForTest, RECOVER_COORDINATOR_OPERATION = "recoverExecutionCoordinator", COMMIT_REGISTRATION_OPERATION = "commitExecutionRegistration", REGISTRATION_SEMANTICS, MIGRATION_MANIFEST_VERSION = 1, LEGACY_ISSUE_KIND = "review-obligation", StoreMigrationError, MIGRATION_VOCABULARY, LEGACY_REQUIRED_FIELDS, HISTORY_ONLY_ABSENT_FIELDS, EXECUTION_LEDGER_ERROR_CODES, ExecutionLedgerError, NOTE_KEYS, NOTE_KEY_ORDER, UNRECOGNIZED_LINE, EXECUTION_RECOVERY_PROTOCOL_VERSION = 3, ExecutionRecoveryError, EXECUTION_MIGRATION_VERSION2, CATALOG_MIGRATION_VERSION, PROVENANCE_ORIGIN_MIGRATION_VERSION, ROADMAP_MIGRATION_VERSION, EXECUTION_COVERAGE_MIGRATION_VERSION, MILESTONE_MIGRATION_VERSION, DSH_MIGRATION_VERSION, EXECUTION_COORDINATOR_ONLY_MIGRATION_VERSION, DSH_LEGACY_PROVENANCE_MIGRATION_VERSION, AUTHORITY_TABLES, REPLACEMENT_ORDER, DATABASE_HEADER_BYTES2 = 100, WAL_FILE_FORMAT_VERSION2 = 2, RESTORE_SCRATCH_NAME, RESTORE_SCRATCH_SIDECARS, REDACTED_KEYS;
|
|
30947
|
+
))`, ISSUE_ORDER_SQL, TERMINAL_DISPOSITIONS = "'resolved', 'waived', 'duplicate', 'superseded'", IDENTITY_COLUMNS = "kind, id, title, description, root_kind, relative_path, document_kind, lifecycle, revision, registered_at, updated_at", completeWitnessGapForTest, workflowWitnessGapForTest, RECOVER_COORDINATOR_OPERATION = "recoverExecutionCoordinator", COMMIT_REGISTRATION_OPERATION = "commitExecutionRegistration", REGISTRATION_SEMANTICS, MAX_DASHBOARD_SEARCH_LENGTH = 200, VIEW_QUERY_FIELDS, DISPOSITIONS3, KINDS2, SEVERITIES2, MIGRATION_MANIFEST_VERSION = 1, LEGACY_ISSUE_KIND = "review-obligation", StoreMigrationError, MIGRATION_VOCABULARY, LEGACY_REQUIRED_FIELDS, HISTORY_ONLY_ABSENT_FIELDS, EXECUTION_LEDGER_ERROR_CODES, ExecutionLedgerError, NOTE_KEYS, NOTE_KEY_ORDER, UNRECOGNIZED_LINE, EXECUTION_RECOVERY_PROTOCOL_VERSION = 3, ExecutionRecoveryError, EXECUTION_MIGRATION_VERSION2, CATALOG_MIGRATION_VERSION, PROVENANCE_ORIGIN_MIGRATION_VERSION, ROADMAP_MIGRATION_VERSION, EXECUTION_COVERAGE_MIGRATION_VERSION, MILESTONE_MIGRATION_VERSION, DSH_MIGRATION_VERSION, EXECUTION_COORDINATOR_ONLY_MIGRATION_VERSION, DSH_LEGACY_PROVENANCE_MIGRATION_VERSION, AUTHORITY_TABLES, REPLACEMENT_ORDER, DATABASE_HEADER_BYTES2 = 100, WAL_FILE_FORMAT_VERSION2 = 2, RESTORE_SCRATCH_NAME, RESTORE_SCRATCH_SIDECARS, REDACTED_KEYS;
|
|
30850
30948
|
var init_engine = __esm(() => {
|
|
30851
30949
|
__defProp2 = Object.defineProperty;
|
|
30852
30950
|
init_coordination_write = __esm2(() => {
|
|
@@ -35687,6 +35785,27 @@ var init_engine = __esm(() => {
|
|
|
35687
35785
|
init_recovery_intent();
|
|
35688
35786
|
init_workflow();
|
|
35689
35787
|
REGISTRATION_SEMANTICS = ["actor", "workflow", "delta"];
|
|
35788
|
+
VIEW_QUERY_FIELDS = {
|
|
35789
|
+
issues: ["project", "disposition", "kind", "severity", "q", "limit", "offset"],
|
|
35790
|
+
"issue-detail": [],
|
|
35791
|
+
workflows: ["project", "limit", "offset"],
|
|
35792
|
+
"workflow-detail": [],
|
|
35793
|
+
iterations: ["project", "limit", "offset"],
|
|
35794
|
+
"iteration-detail": [],
|
|
35795
|
+
roadmap: ["project"],
|
|
35796
|
+
"issue-flow": ["project"],
|
|
35797
|
+
projects: []
|
|
35798
|
+
};
|
|
35799
|
+
DISPOSITIONS3 = { open: true, resolved: true, waived: true, duplicate: true, superseded: true };
|
|
35800
|
+
KINDS2 = {
|
|
35801
|
+
bug: true,
|
|
35802
|
+
risk: true,
|
|
35803
|
+
improvement: true,
|
|
35804
|
+
request: true,
|
|
35805
|
+
decision: true,
|
|
35806
|
+
"review-obligation": true
|
|
35807
|
+
};
|
|
35808
|
+
SEVERITIES2 = { critical: true, high: true, medium: true, low: true, nit: true };
|
|
35690
35809
|
init_catalog_import();
|
|
35691
35810
|
init_catalog();
|
|
35692
35811
|
init_store_db();
|
|
@@ -36205,7 +36324,7 @@ import fs23 from "node:fs";
|
|
|
36205
36324
|
// package.json
|
|
36206
36325
|
var package_default = {
|
|
36207
36326
|
name: "@mstar-harness/cli",
|
|
36208
|
-
version: "4.0.
|
|
36327
|
+
version: "4.0.6",
|
|
36209
36328
|
description: "Morning Star harness CLI \u2014 installer bootstrap, canonical command adapter, and stdio MCP server.",
|
|
36210
36329
|
repository: {
|
|
36211
36330
|
type: "git",
|
|
@@ -36255,7 +36374,7 @@ var package_default = {
|
|
|
36255
36374
|
// ../engine/package.json
|
|
36256
36375
|
var package_default2 = {
|
|
36257
36376
|
name: "@mstar-harness/engine",
|
|
36258
|
-
version: "4.0.
|
|
36377
|
+
version: "4.0.6",
|
|
36259
36378
|
description: "Morning Star Harness Workflow Engine \u2014 deterministic workflow enforcement library (path, status, lease, dispatch, sdd, iteration, lint gates).",
|
|
36260
36379
|
license: "MIT",
|
|
36261
36380
|
repository: {
|
|
@@ -36307,6 +36426,7 @@ var package_default2 = {
|
|
|
36307
36426
|
|
|
36308
36427
|
// ../commands/dist/index.js
|
|
36309
36428
|
init_engine();
|
|
36429
|
+
init_engine();
|
|
36310
36430
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
36311
36431
|
import http from "node:http";
|
|
36312
36432
|
|
|
@@ -55803,8 +55923,8 @@ var init_iteration2 = __esm3(() => {
|
|
|
55803
55923
|
var init_roadmap_content2 = __esm3(() => {
|
|
55804
55924
|
init_iteration2();
|
|
55805
55925
|
});
|
|
55806
|
-
var
|
|
55807
|
-
var
|
|
55926
|
+
var KINDS3;
|
|
55927
|
+
var SEVERITIES3;
|
|
55808
55928
|
var ISSUE_KIND_VALUES2;
|
|
55809
55929
|
var SEVERITY_VALUES2;
|
|
55810
55930
|
var ISSUE_ACTIONS2;
|
|
@@ -55812,7 +55932,7 @@ var ISSUE_ACTION_NAMES2;
|
|
|
55812
55932
|
var init_issue2 = __esm3(() => {
|
|
55813
55933
|
init_audit2();
|
|
55814
55934
|
init_store_db2();
|
|
55815
|
-
|
|
55935
|
+
KINDS3 = {
|
|
55816
55936
|
bug: true,
|
|
55817
55937
|
risk: true,
|
|
55818
55938
|
improvement: true,
|
|
@@ -55820,15 +55940,15 @@ var init_issue2 = __esm3(() => {
|
|
|
55820
55940
|
decision: true,
|
|
55821
55941
|
"review-obligation": true
|
|
55822
55942
|
};
|
|
55823
|
-
|
|
55943
|
+
SEVERITIES3 = {
|
|
55824
55944
|
critical: true,
|
|
55825
55945
|
high: true,
|
|
55826
55946
|
medium: true,
|
|
55827
55947
|
low: true,
|
|
55828
55948
|
nit: true
|
|
55829
55949
|
};
|
|
55830
|
-
ISSUE_KIND_VALUES2 = Object.keys(
|
|
55831
|
-
SEVERITY_VALUES2 = Object.keys(
|
|
55950
|
+
ISSUE_KIND_VALUES2 = Object.keys(KINDS3);
|
|
55951
|
+
SEVERITY_VALUES2 = Object.keys(SEVERITIES3);
|
|
55832
55952
|
ISSUE_ACTIONS2 = {
|
|
55833
55953
|
add: { payload: "CaptureInput", read: false, cas: false, disposition: null },
|
|
55834
55954
|
list: { payload: null, read: true, cas: false, disposition: null },
|
|
@@ -57035,7 +57155,6 @@ import path28 from "node:path";
|
|
|
57035
57155
|
init_engine();
|
|
57036
57156
|
import { constants as constants22 } from "node:os";
|
|
57037
57157
|
import { spawn as nodeSpawn } from "node:child_process";
|
|
57038
|
-
var MAX_DASHBOARD_SEARCH_LENGTH = 200;
|
|
57039
57158
|
var DASHBOARD_API_VIEWS = {
|
|
57040
57159
|
"/api/issues": "issues",
|
|
57041
57160
|
"/api/issue-flow": "issue-flow",
|
|
@@ -57049,36 +57168,6 @@ var DASHBOARD_DETAIL_VIEWS = {
|
|
|
57049
57168
|
workflows: "workflow-detail",
|
|
57050
57169
|
iterations: "iteration-detail"
|
|
57051
57170
|
};
|
|
57052
|
-
var VIEW_QUERY_FIELDS = {
|
|
57053
|
-
issues: ["project", "disposition", "kind", "severity", "q", "limit", "offset"],
|
|
57054
|
-
"issue-detail": [],
|
|
57055
|
-
workflows: ["project", "limit", "offset"],
|
|
57056
|
-
"workflow-detail": [],
|
|
57057
|
-
iterations: ["project", "limit", "offset"],
|
|
57058
|
-
"iteration-detail": [],
|
|
57059
|
-
roadmap: ["project"],
|
|
57060
|
-
"issue-flow": ["project"],
|
|
57061
|
-
projects: []
|
|
57062
|
-
};
|
|
57063
|
-
var DISPOSITIONS3 = { open: true, resolved: true, waived: true, duplicate: true, superseded: true };
|
|
57064
|
-
var KINDS3 = {
|
|
57065
|
-
bug: true,
|
|
57066
|
-
risk: true,
|
|
57067
|
-
improvement: true,
|
|
57068
|
-
request: true,
|
|
57069
|
-
decision: true,
|
|
57070
|
-
"review-obligation": true
|
|
57071
|
-
};
|
|
57072
|
-
var SEVERITIES3 = { critical: true, high: true, medium: true, low: true, nit: true };
|
|
57073
|
-
function refuse(message) {
|
|
57074
|
-
throw new SddScriptError(message, 2);
|
|
57075
|
-
}
|
|
57076
|
-
function requireSafeId(label, value) {
|
|
57077
|
-
if (value === "" || value === "." || value === ".." || /[/\\\u0000]/.test(value)) {
|
|
57078
|
-
refuse(`${label} must be a single safe id`);
|
|
57079
|
-
}
|
|
57080
|
-
return value;
|
|
57081
|
-
}
|
|
57082
57171
|
function resolveDashboardRoute(pathname) {
|
|
57083
57172
|
const exact = DASHBOARD_API_VIEWS[pathname];
|
|
57084
57173
|
if (exact !== undefined)
|
|
@@ -57097,89 +57186,6 @@ function resolveDashboardRoute(pathname) {
|
|
|
57097
57186
|
}
|
|
57098
57187
|
return { view: detail, id: requireSafeId("the detail id", id) };
|
|
57099
57188
|
}
|
|
57100
|
-
function queryValue(params, field) {
|
|
57101
|
-
const value = params[field];
|
|
57102
|
-
if (value === undefined || value === "")
|
|
57103
|
-
return;
|
|
57104
|
-
return value;
|
|
57105
|
-
}
|
|
57106
|
-
function parsePageInteger(raw, field, max) {
|
|
57107
|
-
if (raw === undefined)
|
|
57108
|
-
return;
|
|
57109
|
-
if (!/^[0-9]+$/.test(raw))
|
|
57110
|
-
refuse(`${field} must be a nonnegative integer`);
|
|
57111
|
-
const value = Number(raw);
|
|
57112
|
-
if (max !== undefined && (value < 1 || value > max))
|
|
57113
|
-
refuse(`${field} must be an integer between 1 and ${max}`);
|
|
57114
|
-
return value;
|
|
57115
|
-
}
|
|
57116
|
-
function dashboardFilters(view, params = {}, id) {
|
|
57117
|
-
const accepted = VIEW_QUERY_FIELDS[view];
|
|
57118
|
-
if (!Array.isArray(accepted))
|
|
57119
|
-
refuse(`unknown dashboard view ${JSON.stringify(String(view))}`);
|
|
57120
|
-
for (const field of Object.keys(params)) {
|
|
57121
|
-
if (!accepted.includes(field))
|
|
57122
|
-
refuse(`${JSON.stringify(field)} is not a supported ${view} query parameter`);
|
|
57123
|
-
}
|
|
57124
|
-
const limit = parsePageInteger(queryValue(params, "limit"), "limit", 200);
|
|
57125
|
-
const offset = parsePageInteger(queryValue(params, "offset"), "offset");
|
|
57126
|
-
const project2 = queryValue(params, "project");
|
|
57127
|
-
const scoped = project2 === undefined ? undefined : requireSafeId("project", project2);
|
|
57128
|
-
if (view === "issues") {
|
|
57129
|
-
const disposition = queryValue(params, "disposition");
|
|
57130
|
-
if (disposition !== undefined && DISPOSITIONS3[disposition] !== true) {
|
|
57131
|
-
refuse(`disposition must be one of ${Object.keys(DISPOSITIONS3).join(", ")}`);
|
|
57132
|
-
}
|
|
57133
|
-
const kind = queryValue(params, "kind");
|
|
57134
|
-
if (kind !== undefined && KINDS3[kind] !== true)
|
|
57135
|
-
refuse(`kind must be one of ${Object.keys(KINDS3).join(", ")}`);
|
|
57136
|
-
const severity = queryValue(params, "severity");
|
|
57137
|
-
if (severity !== undefined && SEVERITIES3[severity] !== true) {
|
|
57138
|
-
refuse(`severity must be one of ${Object.keys(SEVERITIES3).join(", ")}`);
|
|
57139
|
-
}
|
|
57140
|
-
const search2 = queryValue(params, "q");
|
|
57141
|
-
if (search2 !== undefined && search2.length > MAX_DASHBOARD_SEARCH_LENGTH) {
|
|
57142
|
-
refuse(`q must be at most ${MAX_DASHBOARD_SEARCH_LENGTH} characters`);
|
|
57143
|
-
}
|
|
57144
|
-
const issue2 = {
|
|
57145
|
-
...scoped === undefined ? {} : { projectId: scoped },
|
|
57146
|
-
...disposition === undefined ? {} : { disposition },
|
|
57147
|
-
...kind === undefined ? {} : { kind },
|
|
57148
|
-
...severity === undefined ? {} : { severity },
|
|
57149
|
-
...search2 === undefined ? {} : { query: search2 },
|
|
57150
|
-
...limit === undefined ? {} : { limit },
|
|
57151
|
-
...offset === undefined ? {} : { offset }
|
|
57152
|
-
};
|
|
57153
|
-
return { issue: issue2 };
|
|
57154
|
-
}
|
|
57155
|
-
if (view === "issue-detail" || view === "workflow-detail" || view === "iteration-detail") {
|
|
57156
|
-
if (id === undefined)
|
|
57157
|
-
refuse(`the ${view} route requires an id`);
|
|
57158
|
-
return { id: requireSafeId(`${view} id`, id) };
|
|
57159
|
-
}
|
|
57160
|
-
if (view === "roadmap" && scoped === undefined) {
|
|
57161
|
-
refuse("the roadmap view requires a project query parameter");
|
|
57162
|
-
}
|
|
57163
|
-
return {
|
|
57164
|
-
...scoped === undefined ? {} : { projectId: scoped },
|
|
57165
|
-
...limit === undefined ? {} : { limit },
|
|
57166
|
-
...offset === undefined ? {} : { offset }
|
|
57167
|
-
};
|
|
57168
|
-
}
|
|
57169
|
-
async function readDashboardView(input2) {
|
|
57170
|
-
const filters = dashboardFilters(input2.view, input2.params ?? {}, input2.id);
|
|
57171
|
-
const query = queryDashboard(input2.view, filters);
|
|
57172
|
-
return withStoreRead(input2.context, query);
|
|
57173
|
-
}
|
|
57174
|
-
function dashboardFailure(error62) {
|
|
57175
|
-
if (error62 instanceof SddScriptError)
|
|
57176
|
-
return { code: "usage", message: error62.message };
|
|
57177
|
-
const code2 = error62?.code;
|
|
57178
|
-
if (typeof code2 === "string" && code2 !== "") {
|
|
57179
|
-
return { code: code2, message: error62 instanceof Error ? error62.message : String(error62) };
|
|
57180
|
-
}
|
|
57181
|
-
return { code: "internal-error", message: error62 instanceof Error ? error62.message : String(error62) };
|
|
57182
|
-
}
|
|
57183
57189
|
var dashboardHtml = `<!doctype html>
|
|
57184
57190
|
<html lang="en">
|
|
57185
57191
|
<head>
|
|
@@ -58307,7 +58313,38 @@ function decodeInputDiagnostics(error62, input2) {
|
|
|
58307
58313
|
};
|
|
58308
58314
|
});
|
|
58309
58315
|
}
|
|
58310
|
-
var
|
|
58316
|
+
var REDACTED_SESSION_ID = "[redacted]";
|
|
58317
|
+
var SESSION_ID_FIELDS = new Set([
|
|
58318
|
+
"sessionId",
|
|
58319
|
+
"session_id",
|
|
58320
|
+
"prepared_by",
|
|
58321
|
+
"completed_by",
|
|
58322
|
+
"actor_session_id",
|
|
58323
|
+
"prior_session_id",
|
|
58324
|
+
"holder"
|
|
58325
|
+
]);
|
|
58326
|
+
var SESSION_ID_ARRAY_FIELDS = new Set(["stopped_session_ids"]);
|
|
58327
|
+
function redactSessionIds(value) {
|
|
58328
|
+
if (Array.isArray(value))
|
|
58329
|
+
return value.map(redactSessionIds);
|
|
58330
|
+
if (value === null || typeof value !== "object")
|
|
58331
|
+
return value;
|
|
58332
|
+
const record2 = value;
|
|
58333
|
+
const out = {};
|
|
58334
|
+
for (const [key, entry] of Object.entries(record2)) {
|
|
58335
|
+
if (SESSION_ID_FIELDS.has(key) && typeof entry === "string" && entry.trim() !== "") {
|
|
58336
|
+
out[key] = REDACTED_SESSION_ID;
|
|
58337
|
+
continue;
|
|
58338
|
+
}
|
|
58339
|
+
if (SESSION_ID_ARRAY_FIELDS.has(key) && Array.isArray(entry)) {
|
|
58340
|
+
out[key] = entry.map(() => REDACTED_SESSION_ID);
|
|
58341
|
+
continue;
|
|
58342
|
+
}
|
|
58343
|
+
out[key] = redactSessionIds(entry);
|
|
58344
|
+
}
|
|
58345
|
+
return out;
|
|
58346
|
+
}
|
|
58347
|
+
var IDENTITY_SUPPLIES = "CLI: pass --session-id or set MSTAR_HOST_SESSION_ID (dsh shells also export DSH_SESSION_ID, which the CLI reads); MCP: pass sessionId on a connection launched with --trust-caller-session-id \u2014 the shipped dsh and omp launcher rows pass it, and there the value is a bearer identity that selects the caller's own coordinator binding; on a connection that did not opt in, use the dsh native tool that covers the operation (plan bind, audit report validation and execution clear) or run the CLI command";
|
|
58311
58348
|
var TOKEN_SUPPLIES = {
|
|
58312
58349
|
root: "the store's root execution token: read `mstar status validate` output field data.token",
|
|
58313
58350
|
workflow: "the addressed workflow's execution token: read `mstar status validate` output data.workflows[].token for this workflow's id",
|
|
@@ -58415,14 +58452,14 @@ function getStatusCommandDefinitions() {
|
|
|
58415
58452
|
try {
|
|
58416
58453
|
const authority = await resolveCurrentAuthority({ harnessDir });
|
|
58417
58454
|
const read = await readExecutionAuthority({ harnessDir });
|
|
58418
|
-
return ok3("status.validate", {
|
|
58455
|
+
return ok3("status.validate", redactSessionIds({
|
|
58419
58456
|
authority: read.data,
|
|
58420
58457
|
token: read.token,
|
|
58421
58458
|
workflows: "workflows" in read.data ? read.data.workflows.map((entry) => ({ id: entry.state.id, token: entry.workflowToken })) : [],
|
|
58422
58459
|
terminalUnregistered: "terminalUnregistered" in read.data ? read.data.terminalUnregistered : [],
|
|
58423
58460
|
terminalAdoptions: "terminalAdoptions" in read.data ? read.data.terminalAdoptions : [],
|
|
58424
58461
|
state: authority.route
|
|
58425
|
-
});
|
|
58462
|
+
}));
|
|
58426
58463
|
} catch (error62) {
|
|
58427
58464
|
const code2 = engineCode(error62, "status.authority-unreadable");
|
|
58428
58465
|
const cause = messageOf(error62);
|
|
@@ -65379,12 +65416,12 @@ function getExecutionLedgerCommandDefinitions() {
|
|
|
65379
65416
|
{ name: "ts", ownership: "caller", route: "cli", required: false, constraint: "defaults to current time when omitted" },
|
|
65380
65417
|
{ name: "ts", ownership: "caller", route: "mcp", required: false, constraint: "defaults to current time when omitted" },
|
|
65381
65418
|
{ name: "sessionId", ownership: "caller", route: "cli", required: true, constraint: "acquired coordinator identity via flag or MSTAR_HOST_SESSION_ID" },
|
|
65382
|
-
{ name: "sessionId", ownership: "caller", route: "mcp", required: true, constraint: "
|
|
65419
|
+
{ name: "sessionId", ownership: "caller", route: "mcp", required: true, constraint: "acquired coordinator identity: sessionId on a connection launched with --trust-caller-session-id (the shipped dsh and omp rows pass it), the dsh native tool, or the CLI" }
|
|
65383
65420
|
],
|
|
65384
65421
|
description: "Append one note to the addressed workflow's retained notes ledger. Requires acquired coordinator identity and a matching active coordinator session reference; the engine proves the bound session is current immediately before the fsynced append, so a stale, revoked or foreign session refuses and no byte is written. The ledger is a plain append log, so a repeated id is a new record, not a replay.",
|
|
65385
65422
|
async execute(raw, context2) {
|
|
65386
65423
|
if (context2.sessionId === undefined || context2.sessionId.trim() === "") {
|
|
65387
|
-
return usage22(APPEND_ID, "appending a workflow note requires an acquired coordinator identity (CLI: pass --session-id or set MSTAR_HOST_SESSION_ID; MCP:
|
|
65424
|
+
return usage22(APPEND_ID, "appending a workflow note requires an acquired coordinator identity (CLI: pass --session-id or set MSTAR_HOST_SESSION_ID; MCP: sessionId on a --trust-caller-session-id connection, otherwise run this command from the session's shell).", "sessionId");
|
|
65388
65425
|
}
|
|
65389
65426
|
const parsed = appendInput.safeParse(raw);
|
|
65390
65427
|
if (!parsed.success)
|
|
@@ -65454,7 +65491,7 @@ function getExecutionLedgerCommandDefinitions() {
|
|
|
65454
65491
|
}
|
|
65455
65492
|
const file2 = input2.file ?? workflowNotesLedgerPath({ harnessDir: root }, input2.workflow);
|
|
65456
65493
|
const bytes = readLedgerBytes(file2);
|
|
65457
|
-
return ok15(COVERAGE_ID, normalizeWorkflowNotesCoverage({ workflowId: input2.workflow, path: file2, bytes }));
|
|
65494
|
+
return ok15(COVERAGE_ID, redactSessionIds(normalizeWorkflowNotesCoverage({ workflowId: input2.workflow, path: file2, bytes })));
|
|
65458
65495
|
} catch (error62) {
|
|
65459
65496
|
return engineRefusal3(COVERAGE_ID, error62);
|
|
65460
65497
|
}
|
|
@@ -66341,6 +66378,10 @@ function getReportCommandDefinitions() {
|
|
|
66341
66378
|
}
|
|
66342
66379
|
}];
|
|
66343
66380
|
}
|
|
66381
|
+
var CLI_ONLY_PREFIXES = ["store."];
|
|
66382
|
+
function isCliOnlyCommand(id2) {
|
|
66383
|
+
return CLI_ONLY_PREFIXES.some((prefix) => id2.startsWith(prefix));
|
|
66384
|
+
}
|
|
66344
66385
|
function getPayloadSchema(typeName2) {
|
|
66345
66386
|
if (!Object.hasOwn(ISSUE_PAYLOAD_SCHEMAS, typeName2)) {
|
|
66346
66387
|
throw new RangeError(`Unknown payload type: ${typeName2}`);
|
|
@@ -66405,7 +66446,7 @@ function commandRequirements(definition22) {
|
|
|
66405
66446
|
requirements.push({ name: sessionOption2.key, ownership: "caller", route: "cli" });
|
|
66406
66447
|
}
|
|
66407
66448
|
if (!overridden.has(`mcp:${sessionOption2.key}`)) {
|
|
66408
|
-
requirements.push({ name: sessionOption2.key, ownership: "caller", route: "mcp", help: "MCP: published
|
|
66449
|
+
requirements.push({ name: sessionOption2.key, ownership: "caller", route: "mcp", help: "MCP: published on a connection launched with --trust-caller-session-id \u2014 the shipped dsh and omp launcher rows pass it; there it is a bearer identity selecting the caller's own coordinator binding. A connection that did not opt in carries no caller identity: use the dsh native tool that covers the operation or run the CLI command (on dsh the CLI reads DSH_SESSION_ID)" });
|
|
66409
66450
|
}
|
|
66410
66451
|
}
|
|
66411
66452
|
return requirements;
|
|
@@ -66455,10 +66496,18 @@ function selectCommandSchema(selector, definitions2) {
|
|
|
66455
66496
|
if (definition22 === undefined) {
|
|
66456
66497
|
throw new CommandSchemaSelectionError(`unknown command id ${JSON.stringify(selector.command)}; available families: ${[...new Set(definitions2.map((entry) => entry.cli.path[0]))].join(", ")}; query a family for its command ids`, ["command"]);
|
|
66457
66498
|
}
|
|
66458
|
-
return {
|
|
66499
|
+
return {
|
|
66500
|
+
kind: "command",
|
|
66501
|
+
descriptor: commandSchemaDescriptor(definition22),
|
|
66502
|
+
...isCliOnlyCommand(definition22.id) ? { transport: "cli" } : {}
|
|
66503
|
+
};
|
|
66459
66504
|
}
|
|
66460
66505
|
if (selector.family !== undefined) {
|
|
66461
|
-
const members2 = definitions2.filter((entry) => entry.cli.path[0] === selector.family).map((entry) => ({
|
|
66506
|
+
const members2 = definitions2.filter((entry) => entry.cli.path[0] === selector.family).map((entry) => ({
|
|
66507
|
+
id: entry.id,
|
|
66508
|
+
description: entry.description,
|
|
66509
|
+
...isCliOnlyCommand(entry.id) ? { transport: "cli" } : {}
|
|
66510
|
+
}));
|
|
66462
66511
|
if (members2.length === 0) {
|
|
66463
66512
|
throw new CommandSchemaSelectionError(`unknown family ${JSON.stringify(selector.family)}; available families: ${[...new Set(definitions2.map((entry) => entry.cli.path[0]))].join(", ")}`, ["family"]);
|
|
66464
66513
|
}
|
|
@@ -89082,7 +89131,7 @@ function registerMcpCommands(server, definitions2, resolveContext, services = []
|
|
|
89082
89131
|
const unpinnedRootRequired = resolveContext.defaultHarness === undefined;
|
|
89083
89132
|
const callerIdentity = resolveContext.callerIdentity === true;
|
|
89084
89133
|
const prepared = new Map;
|
|
89085
|
-
const members2 = definitions2.map((definition3) => {
|
|
89134
|
+
const members2 = definitions2.filter((definition3) => !isCliOnlyCommand(definition3.id)).map((definition3) => {
|
|
89086
89135
|
const descriptor = getCommandSchemas([definition3])[0];
|
|
89087
89136
|
const selector = definition3.cli.options.find((option) => option.context === "sessionId");
|
|
89088
89137
|
const rootInputs = rootInputsOf(definition3, descriptor);
|