mdkg 0.3.9 → 0.4.1
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 +57 -0
- package/CLI_COMMAND_MATRIX.md +19 -9
- package/README.md +6 -2
- package/dist/cli.js +45 -8
- package/dist/command-contract.json +66 -24
- package/dist/commands/new.js +50 -1
- package/dist/commands/validate.js +84 -0
- package/dist/commands/work.js +45 -2
- package/dist/graph/agent_file_types.js +74 -2
- package/dist/graph/frontmatter.js +5 -0
- package/dist/graph/node.js +28 -0
- package/dist/init/AGENT_START.md +6 -0
- package/dist/init/CLI_COMMAND_MATRIX.md +10 -5
- package/dist/init/README.md +17 -8
- package/dist/init/init-manifest.json +12 -12
- package/dist/init/skills/default/author-mdkg-skill/SKILL.md +10 -5
- package/dist/init/templates/default/manifest.md +3 -0
- package/dist/init/templates/default/receipt.md +5 -0
- package/dist/init/templates/default/spec.md +3 -0
- package/dist/init/templates/default/work.md +1 -0
- package/dist/init/templates/default/work_order.md +3 -0
- package/dist/init/templates/specs/base.MANIFEST.md +3 -0
- package/dist/init/templates/specs/base.SPEC.md +3 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.AGENT_ATTRIBUTE_KEY_ORDER = exports.AGENT_FILE_BASENAMES = exports.AGENT_FILE_TYPES = exports.LEGACY_SPEC_BASENAME = exports.CANONICAL_MANIFEST_BASENAME = void 0;
|
|
6
|
+
exports.KNOWN_REDACTION_CLASSES = exports.KNOWN_RECEIPT_KINDS = exports.KNOWN_CONTRACT_PROFILES = exports.AGENT_ATTRIBUTE_KEY_ORDER = exports.AGENT_FILE_BASENAMES = exports.AGENT_FILE_TYPES = exports.LEGACY_SPEC_BASENAME = exports.CANONICAL_MANIFEST_BASENAME = void 0;
|
|
7
7
|
exports.isAgentFileType = isAgentFileType;
|
|
8
8
|
exports.isManifestSemanticType = isManifestSemanticType;
|
|
9
9
|
exports.collectManifestSiblingConflicts = collectManifestSiblingConflicts;
|
|
@@ -41,6 +41,9 @@ const MANIFEST_ATTRIBUTE_KEYS = [
|
|
|
41
41
|
"role",
|
|
42
42
|
"runtime_mode",
|
|
43
43
|
"work_contracts",
|
|
44
|
+
"contract_profile",
|
|
45
|
+
"validation_policy_ref",
|
|
46
|
+
"evidence_policy_ref",
|
|
44
47
|
"requested_capabilities",
|
|
45
48
|
"skill_refs",
|
|
46
49
|
"tool_refs",
|
|
@@ -58,6 +61,7 @@ exports.AGENT_ATTRIBUTE_KEY_ORDER = {
|
|
|
58
61
|
"version",
|
|
59
62
|
"agent_id",
|
|
60
63
|
"kind",
|
|
64
|
+
"contract_profile",
|
|
61
65
|
"pricing_model",
|
|
62
66
|
"required_capabilities",
|
|
63
67
|
"skill_refs",
|
|
@@ -79,6 +83,9 @@ exports.AGENT_ATTRIBUTE_KEY_ORDER = {
|
|
|
79
83
|
"request_ref",
|
|
80
84
|
"trigger_ref",
|
|
81
85
|
"payload_hash",
|
|
86
|
+
"contract_profile",
|
|
87
|
+
"validation_policy_ref",
|
|
88
|
+
"evidence_policy_ref",
|
|
82
89
|
"input_refs",
|
|
83
90
|
"queue_refs",
|
|
84
91
|
"requested_outputs",
|
|
@@ -92,6 +99,11 @@ exports.AGENT_ATTRIBUTE_KEY_ORDER = {
|
|
|
92
99
|
"outcome",
|
|
93
100
|
"cost_ref",
|
|
94
101
|
"redaction_policy",
|
|
102
|
+
"contract_profile",
|
|
103
|
+
"receipt_kind",
|
|
104
|
+
"redaction_class",
|
|
105
|
+
"validation_policy_ref",
|
|
106
|
+
"evidence_policy_ref",
|
|
95
107
|
"proof_refs",
|
|
96
108
|
"attestation_refs",
|
|
97
109
|
"evidence_hashes",
|
|
@@ -123,6 +135,9 @@ exports.AGENT_ATTRIBUTE_KEY_ORDER = {
|
|
|
123
135
|
const SEMVER_RE = /^\d+\.\d+\.\d+(?:[-+][a-z0-9.-]+)?$/;
|
|
124
136
|
const LOWER_TOKEN_RE = /^[a-z][a-z0-9_]*(?:-[a-z0-9_]+)*$/;
|
|
125
137
|
const FIELD_DESCRIPTOR_RE = /^[a-z][a-z0-9_]*:[a-z][a-z0-9_]*(?::(?:required|optional))?$/;
|
|
138
|
+
exports.KNOWN_CONTRACT_PROFILES = new Set(["generic", "omni-room"]);
|
|
139
|
+
exports.KNOWN_RECEIPT_KINDS = new Set(["worker", "final", "cleanup", "audit"]);
|
|
140
|
+
exports.KNOWN_REDACTION_CLASSES = new Set(["public", "internal", "private", "restricted"]);
|
|
126
141
|
const ROLE_VALUES = new Set([
|
|
127
142
|
"orchestrator",
|
|
128
143
|
"subagent",
|
|
@@ -233,7 +248,7 @@ function collectManifestSiblingConflicts(filePaths, formatDir) {
|
|
|
233
248
|
const conflicts = [];
|
|
234
249
|
for (const [dirPath, basenames] of Array.from(basenamesByDir.entries()).sort()) {
|
|
235
250
|
if (basenames.has(exports.CANONICAL_MANIFEST_BASENAME) && basenames.has(exports.LEGACY_SPEC_BASENAME)) {
|
|
236
|
-
conflicts.push(`${formatDir(dirPath)}: MANIFEST.md and SPEC.md cannot both exist in the same logical
|
|
251
|
+
conflicts.push(`${formatDir(dirPath)}: MANIFEST.md and SPEC.md cannot both exist in the same logical unit; keep MANIFEST.md and remove the legacy SPEC.md alias`);
|
|
237
252
|
}
|
|
238
253
|
}
|
|
239
254
|
return conflicts;
|
|
@@ -390,6 +405,48 @@ function validatePortableOrUriScalar(value, key, filePath) {
|
|
|
390
405
|
throw formatError(filePath, `${key} must be a portable id or URI ref`);
|
|
391
406
|
}
|
|
392
407
|
}
|
|
408
|
+
function requireContractMetadataToken(value, key, filePath) {
|
|
409
|
+
if (LOWER_TOKEN_RE.test(value)) {
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
const id = key === "receipt_kind"
|
|
413
|
+
? "receipt-kind.invalid"
|
|
414
|
+
: key === "redaction_class"
|
|
415
|
+
? "redaction-class.invalid"
|
|
416
|
+
: "contract-profile.invalid";
|
|
417
|
+
throw formatError(filePath, `${id}: ${key} must be lowercase snake/kebab style`);
|
|
418
|
+
}
|
|
419
|
+
function optionalContractMetadataString(frontmatter, key, filePath) {
|
|
420
|
+
const value = frontmatter[key];
|
|
421
|
+
if (value === undefined) {
|
|
422
|
+
return undefined;
|
|
423
|
+
}
|
|
424
|
+
const id = key === "receipt_kind"
|
|
425
|
+
? "receipt-kind.invalid"
|
|
426
|
+
: key === "redaction_class"
|
|
427
|
+
? "redaction-class.invalid"
|
|
428
|
+
: "contract-profile.invalid";
|
|
429
|
+
if (typeof value !== "string" || value.trim().length === 0) {
|
|
430
|
+
throw formatError(filePath, `${id}: ${key} must be a non-empty string`);
|
|
431
|
+
}
|
|
432
|
+
return value;
|
|
433
|
+
}
|
|
434
|
+
function validateOptionalContractProfile(frontmatter, filePath) {
|
|
435
|
+
const contractProfile = optionalContractMetadataString(frontmatter, "contract_profile", filePath);
|
|
436
|
+
if (contractProfile) {
|
|
437
|
+
requireContractMetadataToken(contractProfile, "contract_profile", filePath);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
function validateOptionalPolicyRefs(frontmatter, filePath) {
|
|
441
|
+
const validationPolicyRef = optionalRefString(frontmatter, "validation_policy_ref", filePath);
|
|
442
|
+
if (validationPolicyRef) {
|
|
443
|
+
validatePortableOrUriScalar(validationPolicyRef, "validation_policy_ref", filePath);
|
|
444
|
+
}
|
|
445
|
+
const evidencePolicyRef = optionalRefString(frontmatter, "evidence_policy_ref", filePath);
|
|
446
|
+
if (evidencePolicyRef) {
|
|
447
|
+
validatePortableOrUriScalar(evidencePolicyRef, "evidence_policy_ref", filePath);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
393
450
|
function validateOptionalFieldDescriptors(values, key, filePath) {
|
|
394
451
|
if (values.length === 0) {
|
|
395
452
|
return;
|
|
@@ -448,6 +505,8 @@ function validateAgentFrontmatter(type, frontmatter, filePath) {
|
|
|
448
505
|
requireEnum(runtimeMode, "runtime_mode", RUNTIME_MODE_VALUES, filePath);
|
|
449
506
|
const updatePolicy = expectString(frontmatter, "update_policy", filePath);
|
|
450
507
|
requireEnum(updatePolicy, "update_policy", UPDATE_POLICY_VALUES, filePath);
|
|
508
|
+
validateOptionalContractProfile(frontmatter, filePath);
|
|
509
|
+
validateOptionalPolicyRefs(frontmatter, filePath);
|
|
451
510
|
validateRelativeMarkdownPaths(optionalList(frontmatter, "work_contracts", filePath), "work_contracts", "WORK.md", filePath);
|
|
452
511
|
validateCapabilities(optionalList(frontmatter, "requested_capabilities", filePath), "requested_capabilities", filePath);
|
|
453
512
|
validatePortableRefs(optionalList(frontmatter, "skill_refs", filePath), "skill_refs", filePath);
|
|
@@ -467,6 +526,7 @@ function validateAgentFrontmatter(type, frontmatter, filePath) {
|
|
|
467
526
|
requirePortableIdRef(agentId, "agent_id", filePath);
|
|
468
527
|
const kind = expectString(frontmatter, "kind", filePath);
|
|
469
528
|
requireLowerToken(kind, "kind", filePath);
|
|
529
|
+
validateOptionalContractProfile(frontmatter, filePath);
|
|
470
530
|
const pricingModel = expectString(frontmatter, "pricing_model", filePath);
|
|
471
531
|
requireEnum(pricingModel, "pricing_model", PRICING_MODEL_VALUES, filePath);
|
|
472
532
|
const requiredCapabilities = expectList(frontmatter, "required_capabilities", filePath);
|
|
@@ -505,6 +565,8 @@ function validateAgentFrontmatter(type, frontmatter, filePath) {
|
|
|
505
565
|
validatePortableOrUriScalar(requester, "requester", filePath);
|
|
506
566
|
const orderStatus = expectString(frontmatter, "order_status", filePath);
|
|
507
567
|
requireEnum(orderStatus, "order_status", ORDER_STATUS_VALUES, filePath);
|
|
568
|
+
validateOptionalContractProfile(frontmatter, filePath);
|
|
569
|
+
validateOptionalPolicyRefs(frontmatter, filePath);
|
|
508
570
|
const requestRef = optionalRefString(frontmatter, "request_ref", filePath);
|
|
509
571
|
if (requestRef) {
|
|
510
572
|
validatePortableOrUriScalar(requestRef, "request_ref", filePath);
|
|
@@ -542,6 +604,16 @@ function validateAgentFrontmatter(type, frontmatter, filePath) {
|
|
|
542
604
|
if (redactionPolicy) {
|
|
543
605
|
requireEnum(redactionPolicy, "redaction_policy", REDACTION_POLICY_VALUES, filePath);
|
|
544
606
|
}
|
|
607
|
+
validateOptionalContractProfile(frontmatter, filePath);
|
|
608
|
+
const receiptKind = optionalContractMetadataString(frontmatter, "receipt_kind", filePath);
|
|
609
|
+
if (receiptKind) {
|
|
610
|
+
requireContractMetadataToken(receiptKind, "receipt_kind", filePath);
|
|
611
|
+
}
|
|
612
|
+
const redactionClass = optionalContractMetadataString(frontmatter, "redaction_class", filePath);
|
|
613
|
+
if (redactionClass) {
|
|
614
|
+
requireContractMetadataToken(redactionClass, "redaction_class", filePath);
|
|
615
|
+
}
|
|
616
|
+
validateOptionalPolicyRefs(frontmatter, filePath);
|
|
545
617
|
validatePortableOrUriRefs(optionalList(frontmatter, "proof_refs", filePath), "proof_refs", filePath);
|
|
546
618
|
validatePortableOrUriRefs(optionalList(frontmatter, "attestation_refs", filePath), "attestation_refs", filePath);
|
|
547
619
|
validateHashRefs(optionalList(frontmatter, "evidence_hashes", filePath), "evidence_hashes", filePath);
|
|
@@ -30,11 +30,16 @@ exports.DEFAULT_FRONTMATTER_KEY_ORDER = [
|
|
|
30
30
|
"role",
|
|
31
31
|
"runtime_mode",
|
|
32
32
|
"work_contracts",
|
|
33
|
+
"contract_profile",
|
|
34
|
+
"validation_policy_ref",
|
|
35
|
+
"evidence_policy_ref",
|
|
33
36
|
"requested_capabilities",
|
|
34
37
|
"resource_profile",
|
|
35
38
|
"update_policy",
|
|
36
39
|
"agent_id",
|
|
37
40
|
"kind",
|
|
41
|
+
"receipt_kind",
|
|
42
|
+
"redaction_class",
|
|
38
43
|
"pricing_model",
|
|
39
44
|
"required_capabilities",
|
|
40
45
|
"inputs",
|
package/dist/graph/node.js
CHANGED
|
@@ -236,8 +236,36 @@ function requireTemplateSchema(type, templateSchemas, filePath) {
|
|
|
236
236
|
return schema;
|
|
237
237
|
}
|
|
238
238
|
const OPTIONAL_COMPAT_TEMPLATE_KEYS = {
|
|
239
|
+
manifest: {
|
|
240
|
+
contract_profile: "scalar",
|
|
241
|
+
validation_policy_ref: "scalar",
|
|
242
|
+
evidence_policy_ref: "scalar",
|
|
243
|
+
profile: "scalar",
|
|
244
|
+
},
|
|
239
245
|
spec: {
|
|
240
246
|
spec_kind: "scalar",
|
|
247
|
+
contract_profile: "scalar",
|
|
248
|
+
validation_policy_ref: "scalar",
|
|
249
|
+
evidence_policy_ref: "scalar",
|
|
250
|
+
profile: "scalar",
|
|
251
|
+
},
|
|
252
|
+
work: {
|
|
253
|
+
contract_profile: "scalar",
|
|
254
|
+
profile: "scalar",
|
|
255
|
+
},
|
|
256
|
+
work_order: {
|
|
257
|
+
contract_profile: "scalar",
|
|
258
|
+
validation_policy_ref: "scalar",
|
|
259
|
+
evidence_policy_ref: "scalar",
|
|
260
|
+
profile: "scalar",
|
|
261
|
+
},
|
|
262
|
+
receipt: {
|
|
263
|
+
contract_profile: "scalar",
|
|
264
|
+
receipt_kind: "scalar",
|
|
265
|
+
redaction_class: "scalar",
|
|
266
|
+
validation_policy_ref: "scalar",
|
|
267
|
+
evidence_policy_ref: "scalar",
|
|
268
|
+
profile: "scalar",
|
|
241
269
|
},
|
|
242
270
|
};
|
|
243
271
|
function validateTemplateKeys(frontmatter, schema, filePath) {
|
package/dist/init/AGENT_START.md
CHANGED
|
@@ -57,6 +57,12 @@ Agent operating prompt:
|
|
|
57
57
|
- Use `mdkg archive add/list/show/verify/compress` for committed source and artifact sidecars under `.mdkg/archive`.
|
|
58
58
|
- Use `mdkg work ...` helpers for semantic mirror contracts, deterministic triggers, work order status, receipt verification, and artifact registration.
|
|
59
59
|
- Treat work contracts, orders, and receipts as committed semantic mirrors only; never store raw secrets, credentials, live payment state, ledger mutations, or canonical marketplace state in mdkg.
|
|
60
|
+
- Treat optional `contract_profile`, policy refs, receipt kind, and redaction
|
|
61
|
+
class fields as generic semantic mirror metadata. Use `mdkg validate --profile
|
|
62
|
+
omni-room` or `mdkg work validate --profile omni-room` only when a downstream
|
|
63
|
+
profile-specific check is intended; mdkg validates mirrors, while downstream
|
|
64
|
+
runtimes own execution, provider state, billing or ledger state, and final
|
|
65
|
+
receipt authority.
|
|
60
66
|
- Use `artifact://...` for external/runtime-managed artifacts and `archive://...` for committed mdkg archive sidecars.
|
|
61
67
|
- Use `mdkg bundle create/list/show/verify` for explicit full `.mdkg` graph snapshot bundles.
|
|
62
68
|
- Use `mdkg subgraph add/list/verify/sync/materialize` to register child bundle snapshots as read-only planning context, refresh root-owned child bundle snapshots, and optionally generate ignored inspection trees.
|
|
@@ -120,10 +120,11 @@ Project database commands:
|
|
|
120
120
|
- active `.mdkg/db/runtime/` files and `.mdkg/db` WAL/SHM/journal/lock/temp files are ignored by default
|
|
121
121
|
|
|
122
122
|
Validation commands:
|
|
123
|
-
- `mdkg validate [--out <path>] [--json-out <path>] [--quiet] [--changed-only] [--summary] [--limit <n>] [--json]`
|
|
123
|
+
- `mdkg validate [--out <path>] [--json-out <path>] [--quiet] [--changed-only] [--summary] [--limit <n>] [--profile <name>] [--json]`
|
|
124
124
|
- `--changed-only` filters warning presentation to changed `.mdkg` files while full graph errors still run
|
|
125
125
|
- `--summary` emits bounded warning samples for agent/CI logs; `--limit <n>` controls the sample size
|
|
126
126
|
- `--out <path>` writes the compatibility text report; `--json-out <path>` writes a clean full JSON receipt
|
|
127
|
+
- `--profile omni-room` applies explicit contract-profile validation after generic validation; it is separate from `mdkg pack --profile`
|
|
127
128
|
- JSON receipts include `warning_summary` and `warning_diagnostics` with warning ids, categories, severity, paths, refs, and remediation text
|
|
128
129
|
|
|
129
130
|
Node creation commands:
|
|
@@ -146,6 +147,9 @@ Agent workflow file type creation:
|
|
|
146
147
|
|
|
147
148
|
Agent workflow notes:
|
|
148
149
|
- `--id <portable-id>` is only for agent workflow file types.
|
|
150
|
+
- `--contract-profile <name>` is supported for MANIFEST, WORK, WORK_ORDER, and RECEIPT.
|
|
151
|
+
- `--validation-policy-ref <ref>` and `--evidence-policy-ref <ref>` are supported for MANIFEST, WORK_ORDER, and RECEIPT.
|
|
152
|
+
- `--receipt-kind <kind>` and `--redaction-class <class>` are supported for RECEIPT.
|
|
149
153
|
- `manifest` and `work` scaffold as validation-clean standalone docs.
|
|
150
154
|
- `work_order`, `receipt`, `feedback`, `dispute`, and `proposal` need real refs before strict `mdkg validate` passes.
|
|
151
155
|
- `goal` nodes capture recursive objective state and required checks, but normal `mdkg next` does not select them.
|
|
@@ -285,22 +289,23 @@ Subgraph orchestration:
|
|
|
285
289
|
- public/internal subgraphs require public bundle profiles
|
|
286
290
|
|
|
287
291
|
Work semantic mirrors:
|
|
288
|
-
- `mdkg work contract new "<title>" --id <work.id> --agent-id <agent.id> --kind <kind> --inputs <...> --outputs <...> [--required-capabilities <...>] [--pricing-model <...>] [--json]`
|
|
292
|
+
- `mdkg work contract new "<title>" --id <work.id> --agent-id <agent.id> --kind <kind> --inputs <...> --outputs <...> [--contract-profile <name>] [--required-capabilities <...>] [--pricing-model <...>] [--json]`
|
|
289
293
|
- `mdkg work trigger <work-or-capability-ref> [--id <order.id>] [--title "<title>"] [--requester <ref>] [--enqueue <queue>] [--json]`
|
|
290
|
-
- `mdkg work order new "<title>" --id <order.id> --work-id <work.id> --requester <ref> [--request-ref <ref>] [--input-refs <...>] [--requested-outputs <...>] [--json]`
|
|
294
|
+
- `mdkg work order new "<title>" --id <order.id> --work-id <work.id> --requester <ref> [--contract-profile <name>] [--validation-policy-ref <ref>] [--evidence-policy-ref <ref>] [--request-ref <ref>] [--input-refs <...>] [--requested-outputs <...>] [--json]`
|
|
291
295
|
- `mdkg work order status <id-or-qid> [--json]`
|
|
292
296
|
- `mdkg work order update <id-or-qid> [--status <status>] [--add-input-refs <...>] [--add-artifacts <...>] [--json]`
|
|
293
|
-
- `mdkg work receipt new "<title>" --id <receipt.id> --work-order-id <order.id> --outcome success|partial|failure [--receipt-status recorded|verified|rejected|superseded] [--json]`
|
|
297
|
+
- `mdkg work receipt new "<title>" --id <receipt.id> --work-order-id <order.id> --outcome success|partial|failure [--receipt-status recorded|verified|rejected|superseded] [--redaction-policy refs_and_hashes_only|redacted_summary|external_private] [--contract-profile <name>] [--receipt-kind <kind>] [--redaction-class <class>] [--validation-policy-ref <ref>] [--evidence-policy-ref <ref>] [--json]`
|
|
294
298
|
- `mdkg work receipt verify <id-or-qid> [--json]`
|
|
295
299
|
- `mdkg work receipt update <id-or-qid> [--receipt-status <status>] [--add-artifacts <...>] [--add-proof-refs <...>] [--add-attestation-refs <...>] [--json]`
|
|
296
300
|
- `mdkg work artifact add <order-or-receipt-id-or-qid> <file> [--id <archive.id>] [--kind source|artifact] [--json]`
|
|
297
|
-
- `mdkg work validate [<id-or-qid>] [--type manifest|spec|work|work_order|receipt|feedback|dispute|proposal] [--json]`
|
|
301
|
+
- `mdkg work validate [<id-or-qid>] [--type manifest|spec|work|work_order|receipt|feedback|dispute|proposal] [--profile <name>] [--json]`
|
|
298
302
|
- `work trigger` accepts a `WORK.md` ref directly or a `MANIFEST.md` / legacy `SPEC.md` capability ref with exactly one resolvable work contract; it creates a submitted order mirror and never executes work
|
|
299
303
|
- example: `mdkg work trigger work.example --id order.example-1 --requester user://example --json`
|
|
300
304
|
- `work trigger --enqueue <queue>` requires a valid project DB plus an explicitly created active queue, creates a submitted order mirror, and enqueues a local delivery message without executing work
|
|
301
305
|
- `work order status` is read-only and reports deterministic order state plus linked receipts
|
|
302
306
|
- `work receipt verify` is read-only and reports linkage, evidence, archive ref, hash, outcome, and redaction-policy checks
|
|
303
307
|
- `work validate` is read-only and reports typed diagnostics for agent workflow mirrors; obvious raw secret, prompt, token, or payload markers are warnings, not hard failures
|
|
308
|
+
- `work validate --profile omni-room` applies explicit contract-profile validation after generic mirror validation; it is separate from `mdkg pack --profile`
|
|
304
309
|
- work commands mutate mdkg semantic mirror files only; production order, receipt, feedback, dispute, payment, ledger, marketplace inventory, fulfillment, and execution state remains canonical outside mdkg
|
|
305
310
|
- do not store raw secrets, credentials, live payment state, ledger mutations, or canonical marketplace state in work mirrors
|
|
306
311
|
- `artifact://...` refs identify external/runtime-managed artifacts; `archive://...` refs identify committed mdkg archive sidecars
|
package/dist/init/README.md
CHANGED
|
@@ -80,8 +80,9 @@ intentionally with `mdkg new task ...` or `mdkg new test ...`.
|
|
|
80
80
|
Agent workflow docs can use semantic ids:
|
|
81
81
|
|
|
82
82
|
```bash
|
|
83
|
-
mdkg new manifest "image worker" --id agent.image-worker
|
|
84
|
-
mdkg new work "generate image" --id work.generate-image
|
|
83
|
+
mdkg new manifest "image worker" --id agent.image-worker --contract-profile generic
|
|
84
|
+
mdkg new work "generate image" --id work.generate-image --contract-profile generic
|
|
85
|
+
mdkg work validate --profile omni-room --json
|
|
85
86
|
```
|
|
86
87
|
|
|
87
88
|
`MANIFEST.md` is optional. Repos without manifest files still validate. When
|
|
@@ -92,13 +93,21 @@ release, and `mdkg spec list/show/validate` remains a deprecated alias for
|
|
|
92
93
|
read-only discovery surface for skills, manifests, WORK contracts, core docs,
|
|
93
94
|
and design docs.
|
|
94
95
|
|
|
96
|
+
Agent workflow files may include optional generic mirror fields such as
|
|
97
|
+
`contract_profile`, `validation_policy_ref`, `evidence_policy_ref`,
|
|
98
|
+
`receipt_kind`, and `redaction_class`. mdkg validates those mirrors and can run
|
|
99
|
+
profile checks such as `mdkg validate --profile omni-room` and
|
|
100
|
+
`mdkg work validate --profile omni-room`; downstream runtimes still own queue
|
|
101
|
+
execution, room ids, provider state, billing or ledger state, and final receipt
|
|
102
|
+
authority.
|
|
103
|
+
|
|
95
104
|
Read `AGENT_START.md` first when this repo includes it.
|
|
96
105
|
|
|
97
106
|
## Pack Profiles
|
|
98
107
|
|
|
99
|
-
- `--
|
|
100
|
-
- `--
|
|
101
|
-
- `--
|
|
108
|
+
- `--profile standard`: full body (current default behavior)
|
|
109
|
+
- `--profile concise`: summary body with code stripped by default
|
|
110
|
+
- `--profile headers`: metadata-only body (`none`)
|
|
102
111
|
|
|
103
112
|
`--max-tokens` is a heuristic limit based on `chars / 4`.
|
|
104
113
|
|
|
@@ -229,10 +238,10 @@ mdkg archive verify archive://archive.example
|
|
|
229
238
|
Use work lifecycle helpers for semantic mirrors only:
|
|
230
239
|
|
|
231
240
|
```bash
|
|
232
|
-
mdkg work contract new "example capability" --id work.example --agent-id agent.example --kind example --inputs prompt:text:required --outputs result:text:required
|
|
241
|
+
mdkg work contract new "example capability" --id work.example --agent-id agent.example --kind example --contract-profile generic --inputs prompt:text:required --outputs result:text:required
|
|
233
242
|
mdkg work trigger work.example --id order.example-1 --requester user://example
|
|
234
243
|
mdkg work order status order.example-1 --json
|
|
235
|
-
mdkg work receipt new "example receipt" --id receipt.example-1 --work-order-id order.example-1 --outcome success
|
|
244
|
+
mdkg work receipt new "example receipt" --id receipt.example-1 --work-order-id order.example-1 --outcome success --contract-profile generic --receipt-kind worker --redaction-class internal
|
|
236
245
|
mdkg work receipt verify receipt.example-1 --json
|
|
237
246
|
```
|
|
238
247
|
|
|
@@ -249,7 +258,7 @@ Update and artifact commands accept local ids or local qids; subgraph qids are r
|
|
|
249
258
|
`mdkg work trigger` creates a deterministic submitted `WORK_ORDER.md` from a
|
|
250
259
|
WORK contract or a SPEC with exactly one resolvable work contract. `mdkg work
|
|
251
260
|
order status` and `mdkg work receipt verify` are read-only review helpers.
|
|
252
|
-
`mdkg work validate [<id-or-qid>] [--type spec|work|work_order|receipt|feedback|dispute|proposal] --json`
|
|
261
|
+
`mdkg work validate [<id-or-qid>] [--type manifest|spec|work|work_order|receipt|feedback|dispute|proposal] [--profile omni-room] --json`
|
|
253
262
|
is a read-only focused validator for agent workflow mirrors with typed diagnostics
|
|
254
263
|
and raw secret, prompt, token, or payload marker warnings.
|
|
255
264
|
`mdkg work trigger --enqueue <queue>` optionally writes a local project DB queue
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": 1,
|
|
3
3
|
"tool": "mdkg",
|
|
4
|
-
"mdkg_version": "0.
|
|
4
|
+
"mdkg_version": "0.4.1",
|
|
5
5
|
"files": [
|
|
6
6
|
{
|
|
7
7
|
"path": ".mdkg/config.json",
|
|
@@ -66,12 +66,12 @@
|
|
|
66
66
|
{
|
|
67
67
|
"path": ".mdkg/README.md",
|
|
68
68
|
"category": "mdkg_doc",
|
|
69
|
-
"sha256": "
|
|
69
|
+
"sha256": "44e8030ee0642fe9c95589c2f4ece6ab7336d0c6691107bfdf59cebdba5de2ae"
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
"path": ".mdkg/skills/author-mdkg-skill/SKILL.md",
|
|
73
73
|
"category": "default_skill",
|
|
74
|
-
"sha256": "
|
|
74
|
+
"sha256": "ffacd8b8412ab5453b53d91a192f27e0458da4591f80d82d4933805a6fb5a05d"
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
"path": ".mdkg/skills/build-pack-and-execute-task/SKILL.md",
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
{
|
|
147
147
|
"path": ".mdkg/templates/default/manifest.md",
|
|
148
148
|
"category": "template",
|
|
149
|
-
"sha256": "
|
|
149
|
+
"sha256": "a7d758cbe2a51c4889fef39bf91d67f67895f55bcd851d1e02e52f8b2a5a6f2c"
|
|
150
150
|
},
|
|
151
151
|
{
|
|
152
152
|
"path": ".mdkg/templates/default/prd.md",
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
{
|
|
167
167
|
"path": ".mdkg/templates/default/receipt.md",
|
|
168
168
|
"category": "template",
|
|
169
|
-
"sha256": "
|
|
169
|
+
"sha256": "5ffbba7d9ad11193bf65830e4be5b3c04c0fe3aa81a4e473a849cd321644a383"
|
|
170
170
|
},
|
|
171
171
|
{
|
|
172
172
|
"path": ".mdkg/templates/default/rule.md",
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
{
|
|
177
177
|
"path": ".mdkg/templates/default/spec.md",
|
|
178
178
|
"category": "template",
|
|
179
|
-
"sha256": "
|
|
179
|
+
"sha256": "2f00af67cf357f6a15a97bf175e6422d8c84d1fcf0e21977b1134e898378677e"
|
|
180
180
|
},
|
|
181
181
|
{
|
|
182
182
|
"path": ".mdkg/templates/default/spike.md",
|
|
@@ -196,12 +196,12 @@
|
|
|
196
196
|
{
|
|
197
197
|
"path": ".mdkg/templates/default/work_order.md",
|
|
198
198
|
"category": "template",
|
|
199
|
-
"sha256": "
|
|
199
|
+
"sha256": "d42460ae996f5f309d8666019c24d7b236947bc8a64cff6d4eff61b1d6e46216"
|
|
200
200
|
},
|
|
201
201
|
{
|
|
202
202
|
"path": ".mdkg/templates/default/work.md",
|
|
203
203
|
"category": "template",
|
|
204
|
-
"sha256": "
|
|
204
|
+
"sha256": "1ab3c4c79ecdaff2b76007bfbb9844bf581da592f70ac2a2475594b9c279d7cd"
|
|
205
205
|
},
|
|
206
206
|
{
|
|
207
207
|
"path": ".mdkg/templates/skills/base.SKILL.md",
|
|
@@ -231,12 +231,12 @@
|
|
|
231
231
|
{
|
|
232
232
|
"path": ".mdkg/templates/specs/base.MANIFEST.md",
|
|
233
233
|
"category": "template",
|
|
234
|
-
"sha256": "
|
|
234
|
+
"sha256": "4d5fe98b388e9183c9577438e49c375e86d58314130c668be4695f124ea8c37c"
|
|
235
235
|
},
|
|
236
236
|
{
|
|
237
237
|
"path": ".mdkg/templates/specs/base.SPEC.md",
|
|
238
238
|
"category": "template",
|
|
239
|
-
"sha256": "
|
|
239
|
+
"sha256": "43d8b7726560c6245b2927ed5242dc872c394f16fb3dc9c3e58076766270ff5d"
|
|
240
240
|
},
|
|
241
241
|
{
|
|
242
242
|
"path": ".mdkg/templates/specs/capability.MANIFEST.md",
|
|
@@ -311,7 +311,7 @@
|
|
|
311
311
|
{
|
|
312
312
|
"path": "AGENT_START.md",
|
|
313
313
|
"category": "startup_doc",
|
|
314
|
-
"sha256": "
|
|
314
|
+
"sha256": "c387ce4fee55eafca09bcd30f32e4d7dc8ee7f9cc9811c1adffa0756c9423a35"
|
|
315
315
|
},
|
|
316
316
|
{
|
|
317
317
|
"path": "AGENTS.md",
|
|
@@ -326,7 +326,7 @@
|
|
|
326
326
|
{
|
|
327
327
|
"path": "CLI_COMMAND_MATRIX.md",
|
|
328
328
|
"category": "startup_doc",
|
|
329
|
-
"sha256": "
|
|
329
|
+
"sha256": "7a71fa553e38395caae5f18ecb9650911c56a019b25e793addc20701e5df5a9e"
|
|
330
330
|
},
|
|
331
331
|
{
|
|
332
332
|
"path": "llms.txt",
|
|
@@ -62,6 +62,8 @@ For MANIFEST.md output, include:
|
|
|
62
62
|
- Source mdkg nodes
|
|
63
63
|
- Resource URIs
|
|
64
64
|
- Capabilities
|
|
65
|
+
- Contract profile, validation policy refs, and evidence policy refs when a
|
|
66
|
+
downstream runtime or workflow profile needs generic semantic mirrors
|
|
65
67
|
- Inputs
|
|
66
68
|
- Outputs
|
|
67
69
|
- Dependencies
|
|
@@ -94,14 +96,17 @@ For MANIFEST.md output, include:
|
|
|
94
96
|
10. Distinguish durable source from projection:
|
|
95
97
|
mdkg/MANIFEST/SKILL is source; `.codex/agents`, future runtime manifests, and
|
|
96
98
|
protocol resources are projections.
|
|
97
|
-
11.
|
|
99
|
+
11. Treat contract-profile fields as generic mdkg validation mirrors only.
|
|
100
|
+
Downstream runtimes own execution semantics, queue state, provider state, and
|
|
101
|
+
final receipt authority.
|
|
102
|
+
12. Add validation checks and closeout evidence to every authored or revised
|
|
98
103
|
SKILL/MANIFEST.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
104
|
+
13. If input is incomplete, create repair tasks instead of guessing.
|
|
105
|
+
14. Validate the new or updated skill with `mdkg skill validate <slug>`.
|
|
106
|
+
15. If the skill changes the public workflow, update `AGENT_START.md`,
|
|
102
107
|
`CLI_COMMAND_MATRIX.md`, root onboarding docs, and the skill registry in the
|
|
103
108
|
same pass.
|
|
104
|
-
|
|
109
|
+
16. When mirrored skill folders are enabled, run `mdkg skill sync` after broad
|
|
105
110
|
manual changes so every configured `.mdkg/config.json`
|
|
106
111
|
`customization.skill_mirrors.targets` path stays current. The default
|
|
107
112
|
targets are `.agents/skills/` and `.claude/skills/`; other agent-local
|
|
@@ -7,6 +7,9 @@ spec_kind: capability
|
|
|
7
7
|
role: tool_service
|
|
8
8
|
runtime_mode: tool_service
|
|
9
9
|
work_contracts: []
|
|
10
|
+
contract_profile: generic
|
|
11
|
+
validation_policy_ref: policy.validation.default
|
|
12
|
+
evidence_policy_ref: policy.evidence.default
|
|
10
13
|
requested_capabilities: []
|
|
11
14
|
skill_refs: []
|
|
12
15
|
tool_refs: []
|
|
@@ -8,6 +8,11 @@ receipt_status: recorded
|
|
|
8
8
|
outcome: success
|
|
9
9
|
cost_ref: cost.redacted
|
|
10
10
|
redaction_policy: refs_and_hashes_only
|
|
11
|
+
contract_profile: generic
|
|
12
|
+
receipt_kind: worker
|
|
13
|
+
redaction_class: internal
|
|
14
|
+
validation_policy_ref: policy.validation.default
|
|
15
|
+
evidence_policy_ref: policy.evidence.default
|
|
11
16
|
proof_refs: []
|
|
12
17
|
attestation_refs: []
|
|
13
18
|
evidence_hashes: []
|
|
@@ -7,6 +7,9 @@ spec_kind: capability
|
|
|
7
7
|
role: tool_service
|
|
8
8
|
runtime_mode: tool_service
|
|
9
9
|
work_contracts: []
|
|
10
|
+
contract_profile: generic
|
|
11
|
+
validation_policy_ref: policy.validation.default
|
|
12
|
+
evidence_policy_ref: policy.evidence.default
|
|
10
13
|
requested_capabilities: []
|
|
11
14
|
skill_refs: []
|
|
12
15
|
tool_refs: []
|
|
@@ -10,6 +10,9 @@ order_status: submitted
|
|
|
10
10
|
request_ref: request.example
|
|
11
11
|
trigger_ref: trigger.manual
|
|
12
12
|
payload_hash: sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
|
|
13
|
+
contract_profile: generic
|
|
14
|
+
validation_policy_ref: policy.validation.default
|
|
15
|
+
evidence_policy_ref: policy.evidence.default
|
|
13
16
|
input_refs: []
|
|
14
17
|
queue_refs: []
|
|
15
18
|
requested_outputs: [result:text:required]
|
|
@@ -7,6 +7,9 @@ spec_kind: capability
|
|
|
7
7
|
role: {{role}}
|
|
8
8
|
runtime_mode: {{runtime_mode}}
|
|
9
9
|
work_contracts: []
|
|
10
|
+
contract_profile: generic
|
|
11
|
+
validation_policy_ref: policy.validation.default
|
|
12
|
+
evidence_policy_ref: policy.evidence.default
|
|
10
13
|
requested_capabilities: []
|
|
11
14
|
skill_refs: []
|
|
12
15
|
tool_refs: []
|
|
@@ -7,6 +7,9 @@ spec_kind: capability
|
|
|
7
7
|
role: {{role}}
|
|
8
8
|
runtime_mode: {{runtime_mode}}
|
|
9
9
|
work_contracts: []
|
|
10
|
+
contract_profile: generic
|
|
11
|
+
validation_policy_ref: policy.validation.default
|
|
12
|
+
evidence_policy_ref: policy.evidence.default
|
|
10
13
|
requested_capabilities: []
|
|
11
14
|
skill_refs: []
|
|
12
15
|
tool_refs: []
|