arkgate 4.6.7 → 4.7.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 +109 -0
- package/README.md +20 -9
- package/SECURITY.md +1 -1
- package/bin/ark-check-runtime.mjs +13 -1
- package/bin/ark-mcp-runtime.mjs +65 -3
- package/bin/lib/adapter-contract.mjs +17 -36
- package/bin/lib/analysis-engine.mjs +6 -6
- package/bin/lib/ark-run-doctor.mjs +144 -0
- package/bin/lib/ark-run-facts.mjs +472 -0
- package/bin/lib/ark-run-report.mjs +57 -0
- package/bin/lib/ark-run-sensors.mjs +309 -0
- package/bin/lib/config-contract.mjs +86 -11
- package/bin/lib/diagnostic-catalog.mjs +8 -0
- package/bin/lib/doctor-advisories.mjs +45 -8
- package/bin/lib/doctor-human.mjs +10 -0
- package/bin/lib/doctor-plan.mjs +20 -16
- package/bin/lib/extra-merge-teeth.mjs +187 -0
- package/bin/lib/html-report-advisories.mjs +2 -0
- package/bin/lib/html-report-depth.mjs +22 -2
- package/bin/lib/html-report.mjs +16 -0
- package/bin/lib/remediation.mjs +132 -0
- package/bin/lib/resolved-candidate-facts.mjs +67 -2
- package/bin/lib/rules-under-contract.mjs +37 -89
- package/bin/lib/snippet-analysis.mjs +43 -2
- package/bin/lib/status-command.mjs +28 -0
- package/bin/lib/status-manifest.mjs +23 -0
- package/dist/{configTypes-l6XiwiC1.d.ts → configTypes-CgJimx9o.d.ts} +17 -3
- package/dist/eslint/index.cjs +6 -2
- package/dist/eslint/index.d.ts +70 -2
- package/dist/eslint/index.js +6 -2
- package/dist/index.cjs +35 -35
- package/dist/index.d.ts +787 -272
- package/dist/index.js +35 -35
- package/docs/README.md +2 -1
- package/docs/agent-guide.md +21 -15
- package/docs/ai-gates.md +13 -0
- package/docs/configuration.md +24 -11
- package/docs/develop.md +12 -3
- package/docs/diagnostics.md +75 -0
- package/docs/enthusiast/README.md +4 -3
- package/docs/package-surface.md +16 -13
- package/docs/product-voice.md +6 -3
- package/docs/threat-model.md +1 -1
- package/docs/use.md +5 -4
- package/package.json +1 -1
- package/schemas/ark.config.schema.json +41 -2
- package/schemas/ark.resolved-candidate-facts.schema.json +1 -1
- package/schemas/ark.status-manifest.schema.json +47 -0
- package/server.json +2 -2
- package/templates/agent-skills/README.md +1 -1
- package/templates/agent-skills/ark-adopt/SKILL.md +23 -2
- package/templates/agent-skills/ark-place/SKILL.md +26 -2
- package/templates/agent-skills/ark-runtime/SKILL.md +66 -24
- package/templates/skills/ark-adopt.md +23 -2
- package/templates/skills/ark-place.md +26 -2
- package/templates/skills/ark-runtime.md +66 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://unpkg.com/arkgate@3/schemas/ark.resolved-candidate-facts.schema.json","title":"ArkGate resolved candidate facts","type":"object","additionalProperties":false,"required":["schemaVersion","completeness","completenessReasons","resolverIdentity","compilerIdentity","compilerOptionsHash","tsconfigHash","candidateTreeHash","evidenceRequirementsHash","files","dependencies","capabilityUses","ambientUses","publishCalls","intentReferences","safetyUses","factsHash"],"properties":{"schemaVersion":{"enum":["1.0","1.1"]},"completeness":{"enum":["complete","partial","unavailable"]},"completenessReasons":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string","minLength":1},"message":{"type":"string","minLength":1},"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"}}}},"resolverIdentity":{"type":"string","minLength":1},"compilerIdentity":{"type":"string","minLength":1},"compilerOptionsHash":{"type":"string","minLength":1},"tsconfigHash":{"type":"string","minLength":1},"candidateTreeHash":{"type":"string","minLength":1},"evidenceRequirementsHash":{"type":"string","minLength":1},"projectPackageName":{"type":"string","minLength":1},"files":{"type":"array","uniqueItems":true,"items":{"type":"object","additionalProperties":false,"required":["path","contentHash","parseStatus","parseDiagnosticCount","exportsOnlyTypes","typeOnlyExportNames","hasTopLevelSideEffects"],"properties":{"path":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"contentHash":{"type":"string","minLength":1},"parseStatus":{"enum":["parsed","invalid"]},"parseDiagnosticCount":{"type":"integer","minimum":0},"exportsOnlyTypes":{"type":"boolean"},"typeOnlyExportNames":{"type":"array","items":{"type":"string","minLength":1}},"hasTopLevelSideEffects":{"type":"boolean"}},"allOf":[{"if":{"properties":{"parseStatus":{"const":"parsed"}}},"then":{"properties":{"parseDiagnosticCount":{"const":0}}}},{"if":{"properties":{"parseStatus":{"const":"invalid"}}},"then":{"properties":{"parseDiagnosticCount":{"minimum":1}}}}]}},"dependencies":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","kind","typeOnly","line","resolution"],"properties":{"from":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"specifier":{"type":"string","minLength":1},"kind":{"enum":["import","export","dynamic-import","require"]},"typeOnly":{"type":"boolean"},"line":{"type":"integer","minimum":1},"resolution":{"enum":["resolved-project","resolved-external","unresolved","dynamic"]},"target":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"namedBindings":{"type":"array","items":{"type":"string","minLength":1}},"targetTypeOnlyExports":{"type":"boolean"},"sourcePureTypeModule":{"type":"boolean"},"namedBindingsTypeOnly":{"type":"boolean"},"portProofEligible":{"type":"boolean"}},"allOf":[{"if":{"properties":{"resolution":{"const":"resolved-project"}}},"then":{"required":["target"]},"else":{"not":{"required":["target"]}}},{"if":{"properties":{"resolution":{"const":"dynamic"}}},"else":{"required":["specifier"]}}]}},"capabilityUses":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","symbol","capability","source"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"symbol":{"type":"string","minLength":1},"capability":{"enum":["network","filesystem","clock","randomness","environment","process","persistence"]},"source":{"enum":["ambient-global","import-based"]}}}},"ambientUses":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","symbol"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"symbol":{"type":"string","minLength":1}}}},"publishCalls":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","objectHasIntent","arkPublishCandidate","hasSource"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"rawIntentName":{"type":"string","minLength":1},"objectHasIntent":{"type":"boolean"},"arkPublishCandidate":{"type":"boolean"},"hasSource":{"type":"boolean"},"sourceIntent":{"type":"string","minLength":1}}}},"intentReferences":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","intent"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"intent":{"type":"string","minLength":1}}}},"safetyUses":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","kind"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"kind":{"enum":["ts-suppression","any-cast","dynamic-import","dynamic-require","in-memory-store"]},"symbol":{"type":"string","minLength":1}},"allOf":[{"if":{"properties":{"kind":{"const":"in-memory-store"}}},"then":{"required":["symbol"]},"else":{"not":{"required":["symbol"]}}}]}},"classShapes":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","className","exported","hasPublicMutableFields","hasPublicSetters","hasPublicConstructor","hasStaticFactory","mutatingMethods"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"className":{"type":"string","minLength":1},"exported":{"type":"boolean"},"hasPublicMutableFields":{"type":"boolean"},"hasPublicSetters":{"type":"boolean"},"hasPublicConstructor":{"type":"boolean"},"hasStaticFactory":{"type":"boolean"},"dataOnly":{"type":"boolean"},"mutatingMethods":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["name","referencesGuardOrPublish"],"properties":{"name":{"type":"string","minLength":1},"referencesGuardOrPublish":{"type":"boolean"}}}}}}},"factsHash":{"type":"string","minLength":1}},"allOf":[{"if":{"properties":{"completeness":{"const":"complete"}}},"then":{"properties":{"completenessReasons":{"maxItems":0},"files":{"items":{"properties":{"parseStatus":{"const":"parsed"}}}}}}},{"if":{"properties":{"completeness":{"enum":["partial","unavailable"]}}},"then":{"properties":{"completenessReasons":{"minItems":1}}}}]}
|
|
1
|
+
{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://unpkg.com/arkgate@3/schemas/ark.resolved-candidate-facts.schema.json","title":"ArkGate resolved candidate facts","type":"object","additionalProperties":false,"required":["schemaVersion","completeness","completenessReasons","resolverIdentity","compilerIdentity","compilerOptionsHash","tsconfigHash","candidateTreeHash","evidenceRequirementsHash","files","dependencies","capabilityUses","ambientUses","publishCalls","intentReferences","safetyUses","factsHash"],"properties":{"schemaVersion":{"enum":["1.0","1.1","1.2"]},"completeness":{"enum":["complete","partial","unavailable"]},"completenessReasons":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string","minLength":1},"message":{"type":"string","minLength":1},"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"}}}},"resolverIdentity":{"type":"string","minLength":1},"compilerIdentity":{"type":"string","minLength":1},"compilerOptionsHash":{"type":"string","minLength":1},"tsconfigHash":{"type":"string","minLength":1},"candidateTreeHash":{"type":"string","minLength":1},"evidenceRequirementsHash":{"type":"string","minLength":1},"projectPackageName":{"type":"string","minLength":1},"files":{"type":"array","uniqueItems":true,"items":{"type":"object","additionalProperties":false,"required":["path","contentHash","parseStatus","parseDiagnosticCount","exportsOnlyTypes","typeOnlyExportNames","hasTopLevelSideEffects"],"properties":{"path":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"contentHash":{"type":"string","minLength":1},"parseStatus":{"enum":["parsed","invalid"]},"parseDiagnosticCount":{"type":"integer","minimum":0},"exportsOnlyTypes":{"type":"boolean"},"typeOnlyExportNames":{"type":"array","items":{"type":"string","minLength":1}},"hasTopLevelSideEffects":{"type":"boolean"}},"allOf":[{"if":{"properties":{"parseStatus":{"const":"parsed"}}},"then":{"properties":{"parseDiagnosticCount":{"const":0}}}},{"if":{"properties":{"parseStatus":{"const":"invalid"}}},"then":{"properties":{"parseDiagnosticCount":{"minimum":1}}}}]}},"dependencies":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["from","kind","typeOnly","line","resolution"],"properties":{"from":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"specifier":{"type":"string","minLength":1},"kind":{"enum":["import","export","dynamic-import","require"]},"typeOnly":{"type":"boolean"},"line":{"type":"integer","minimum":1},"resolution":{"enum":["resolved-project","resolved-external","unresolved","dynamic"]},"target":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"namedBindings":{"type":"array","items":{"type":"string","minLength":1}},"targetTypeOnlyExports":{"type":"boolean"},"sourcePureTypeModule":{"type":"boolean"},"namedBindingsTypeOnly":{"type":"boolean"},"portProofEligible":{"type":"boolean"}},"allOf":[{"if":{"properties":{"resolution":{"const":"resolved-project"}}},"then":{"required":["target"]},"else":{"not":{"required":["target"]}}},{"if":{"properties":{"resolution":{"const":"dynamic"}}},"else":{"required":["specifier"]}}]}},"capabilityUses":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","symbol","capability","source"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"symbol":{"type":"string","minLength":1},"capability":{"enum":["network","filesystem","clock","randomness","environment","process","persistence"]},"source":{"enum":["ambient-global","import-based"]}}}},"ambientUses":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","symbol"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"symbol":{"type":"string","minLength":1}}}},"publishCalls":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","objectHasIntent","arkPublishCandidate","hasSource"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"rawIntentName":{"type":"string","minLength":1},"objectHasIntent":{"type":"boolean"},"arkPublishCandidate":{"type":"boolean"},"hasSource":{"type":"boolean"},"sourceIntent":{"type":"string","minLength":1}}}},"intentReferences":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","intent"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"intent":{"type":"string","minLength":1}}}},"safetyUses":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","kind"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"kind":{"enum":["ts-suppression","any-cast","dynamic-import","dynamic-require","in-memory-store"]},"symbol":{"type":"string","minLength":1}},"allOf":[{"if":{"properties":{"kind":{"const":"in-memory-store"}}},"then":{"required":["symbol"]},"else":{"not":{"required":["symbol"]}}}]}},"classShapes":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","className","exported","hasPublicMutableFields","hasPublicSetters","hasPublicConstructor","hasStaticFactory","mutatingMethods"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"className":{"type":"string","minLength":1},"exported":{"type":"boolean"},"hasPublicMutableFields":{"type":"boolean"},"hasPublicSetters":{"type":"boolean"},"hasPublicConstructor":{"type":"boolean"},"hasStaticFactory":{"type":"boolean"},"dataOnly":{"type":"boolean"},"mutatingMethods":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["name","referencesGuardOrPublish"],"properties":{"name":{"type":"string","minLength":1},"referencesGuardOrPublish":{"type":"boolean"}}}}}}},"arkRunKernelCalls":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","kind","callee","viaImport"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"kind":{"enum":["factory","publisher","publish","raise","send","subscribe","register-handler","resolve","resolve-singleton"]},"callee":{"type":"string","minLength":1},"viaImport":{"type":"boolean"},"receiver":{"type":"string","minLength":1},"nameLiteral":{"type":"string","minLength":1}}}},"arkRunManagedNews":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","typeName"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"typeName":{"type":"string","minLength":1},"importedFrom":{"type":"string","minLength":1}}}},"arkRunCompositionRootHits":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","matchedRoot","hasKernelFactory"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"matchedRoot":{"type":"string","minLength":1},"hasKernelFactory":{"type":"boolean"}}}},"arkRunDeclarations":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["file","line","uses","reactsTo","raises","sends"],"properties":{"file":{"type":"string","minLength":1,"pattern":"^(?!/)(?![A-Za-z]:/)(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*[\\u0000-\\u001f\\u007f])(?!.*\\/$).+$"},"line":{"type":"integer","minimum":1},"uses":{"type":"array","items":{"type":"string","minLength":1}},"reactsTo":{"type":"array","items":{"type":"string","minLength":1}},"raises":{"type":"array","items":{"type":"string","minLength":1}},"sends":{"type":"array","items":{"type":"string","minLength":1}}}}},"factsHash":{"type":"string","minLength":1}},"allOf":[{"if":{"properties":{"completeness":{"const":"complete"}}},"then":{"properties":{"completenessReasons":{"maxItems":0},"files":{"items":{"properties":{"parseStatus":{"const":"parsed"}}}}}}},{"if":{"properties":{"completeness":{"enum":["partial","unavailable"]}}},"then":{"properties":{"completenessReasons":{"minItems":1}}}}]}
|
|
@@ -343,6 +343,53 @@
|
|
|
343
343
|
"type": "boolean"
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
+
},
|
|
347
|
+
"arkRun": {
|
|
348
|
+
"type": "object",
|
|
349
|
+
"description": "ArkRun extra residual (notAScore). present/mode from config; residual is a finding-id count (null = unknown, not green). extraMergeTeeth is honesty, never a score.",
|
|
350
|
+
"additionalProperties": false,
|
|
351
|
+
"required": [
|
|
352
|
+
"notAScore",
|
|
353
|
+
"present",
|
|
354
|
+
"mode",
|
|
355
|
+
"extraMergeTeeth",
|
|
356
|
+
"residual"
|
|
357
|
+
],
|
|
358
|
+
"properties": {
|
|
359
|
+
"notAScore": {
|
|
360
|
+
"const": true
|
|
361
|
+
},
|
|
362
|
+
"present": {
|
|
363
|
+
"type": "boolean"
|
|
364
|
+
},
|
|
365
|
+
"mode": {
|
|
366
|
+
"anyOf": [
|
|
367
|
+
{
|
|
368
|
+
"enum": [
|
|
369
|
+
"advisory",
|
|
370
|
+
"enforced"
|
|
371
|
+
]
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"type": "null"
|
|
375
|
+
}
|
|
376
|
+
]
|
|
377
|
+
},
|
|
378
|
+
"extraMergeTeeth": {
|
|
379
|
+
"type": "boolean"
|
|
380
|
+
},
|
|
381
|
+
"residual": {
|
|
382
|
+
"anyOf": [
|
|
383
|
+
{
|
|
384
|
+
"type": "integer",
|
|
385
|
+
"minimum": 0
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"type": "null"
|
|
389
|
+
}
|
|
390
|
+
]
|
|
391
|
+
}
|
|
392
|
+
}
|
|
346
393
|
}
|
|
347
394
|
}
|
|
348
395
|
}
|
package/server.json
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"url": "https://github.com/pedroknigge/arkgate",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "4.
|
|
9
|
+
"version": "4.7.0",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "arkgate",
|
|
14
|
-
"version": "4.
|
|
14
|
+
"version": "4.7.0",
|
|
15
15
|
"runtimeHint": "npx",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
This directory is the **Agent Skills–compatible** packaging of the same **13**
|
|
8
8
|
`/ark-*` skills shipped as flat templates for Ark install. **No new skill names.**
|
|
9
9
|
|
|
10
|
-
Package version when last generated context: **arkgate@4.
|
|
10
|
+
Package version when last generated context: **arkgate@4.7.0**
|
|
11
11
|
Schema: agent-skills package contract `1.0`
|
|
12
12
|
|
|
13
13
|
## Skills (frozen catalog)
|
|
@@ -20,6 +20,8 @@ description: Session 0 — mark the Ark path. Greenfield scaffold or brownfield
|
|
|
20
20
|
- Generate `.ark/golden-pattern.json` (load-bearing for `/ark-place`).
|
|
21
21
|
- Future houses: mark unused layer globs `reserved` / `allowEmpty` so `--strict-config` does not fail.
|
|
22
22
|
- CLI-first: if `arkgate-check` already resolved the root, do not wait on MCP.
|
|
23
|
+
- Do not add `arkRun` unless the user wants the extra. When they do, write **advisory** `arkRun`
|
|
24
|
+
(schema `1.2+`) in this turn. Absence is silent and valid. Skills never enforce.
|
|
23
25
|
|
|
24
26
|
Invoking this skill **is** the approval. Write the architecture config in this turn.
|
|
25
27
|
Greenfield: scaffold like `--recommend`. Brownfield: match **product
|
|
@@ -94,6 +96,7 @@ When present, prefer the consumer **domain glossary** for layer names, slice fol
|
|
|
94
96
|
| False-green / concentrated edge needs config truth | Feature file only → `/ark-place` |
|
|
95
97
|
| Mine loose business rules into Domain / advisory ArkRules | Apply leftover design after the path is honest → `/ark-autopilot` |
|
|
96
98
|
| Freeze **real** debt after the config is honest | User said map only |
|
|
99
|
+
| Turn **advisory** ArkRun on (`arkRun` extra, schema `1.2+`) | Evaluate / wire a hand-rolled bus → `/ark-runtime`; new kernel-managed file → `/ark-place` |
|
|
97
100
|
|
|
98
101
|
## Dual engine (mandatory)
|
|
99
102
|
|
|
@@ -121,13 +124,15 @@ ArkGate has **two opt-in planes**. The user chooses which to use; you **always l
|
|
|
121
124
|
|-------|------------------|----------------|-----------------|
|
|
122
125
|
| **Layers** (inter-layer) | Who may import whom, capabilities, pure/forbiddenGlobals, peerIsolation | `ark.config.json` → `layers[]`, `rules[]` | graph check, baseline edges, doctor coverage % |
|
|
123
126
|
| **ArkRules** (intra-layer) | Structure inside a layer + domain invariants as data | `arkRules` map + `arkrules/<ExactLayerName>.json` | structure sensors, invariant coverage, `--rules-inventory`, doctor `rulesUnderContract` |
|
|
127
|
+
| **ArkRun** (extra) | Kernel usage + complete declarations | `arkRun` on `ark.config.json` (schema `1.2+`) + companion `@arkgate/runtime` | `ARKRUN_*`, doctor `arkRun` (`notAScore`) |
|
|
124
128
|
|
|
125
129
|
**Rules for every report / answer:**
|
|
126
|
-
1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** (or a two-column table with those headers).
|
|
130
|
+
1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** or **`[ArkRun]`** (or a two-column table with those headers).
|
|
127
131
|
2. Never call an import-edge violation an “invariant” or an aggregate sensor a “layer deny.”
|
|
128
132
|
3. Absence of `arkRules` is **valid** — do not force ArkRules unless the user wants them or residual inventory clearly wants a pilot.
|
|
129
133
|
4. Editing `arkrules/*` or promoting modes is **this skill** (session 0) or **`/ark-autopilot`** later; never invent `mechanical-safe`.
|
|
130
134
|
5. CLI helpers: `ark-check --rules-inventory --json`, doctor JSON `rulesUnderContract`, sensors emit `ARKRULE_*` / `INVARIANT_UNCOVERED` with `evidence.arkruleId`.
|
|
135
|
+
6. Absence of `arkRun` is **valid**. Write it only when the user wants the extra. Skills never enforce.
|
|
131
136
|
|
|
132
137
|
|
|
133
138
|
### Adopt + ArkRules
|
|
@@ -135,6 +140,16 @@ ArkGate has **two opt-in planes**. The user chooses which to use; you **always l
|
|
|
135
140
|
- Mine rules → inventory + write advisory invariants/structure into `arkrules/<Layer>.json` **in this turn**.
|
|
136
141
|
- Freeze baseline is **[Layer]** debt; inventory residual is **[ArkRules]** — report both.
|
|
137
142
|
|
|
143
|
+
### Adopt + ArkRun
|
|
144
|
+
- User asked to turn the extra on: write **advisory** `arkRun` on `ark.config.json` (`schemaVersion` `1.2+`) **in this turn**. Default `"mode": "advisory"`.
|
|
145
|
+
- Required shape: `compositionRoots` (real files; empty + enforced fails closed), `managedLayers` (existing `layers[].name` only), `requireDeclarations` (default true).
|
|
146
|
+
- Do **not** put `arkRun` on the compact starter / `ark start` scaffold. Brownfield stays advisory until the team promotes.
|
|
147
|
+
- Absence is valid and **silent** — never force the extra. Never force the kernel over existing Nest/DI. Do not invent `/ark-run`.
|
|
148
|
+
- Import the companion from `@arkgate/runtime` (factory `createStrictArkKernel`, per instance, no process-wide singleton). Never a removed `arkgate/runtime` shim. No shipped cloud broker SDKs.
|
|
149
|
+
- In-memory stores are **not** production durability. Branding ArkRun is not a durability claim. Doctor / status `arkRun` is `notAScore`.
|
|
150
|
+
- Demoting enforced → advisory or deleting the extra is policy-delta **weakening**.
|
|
151
|
+
- After the extra is honest: handoff `/ark-runtime` to wire one candidate, `/ark-place` for new kernel-managed files. Skills never enforce.
|
|
152
|
+
|
|
138
153
|
## Subagent fan-out (optional, host-dependent)
|
|
139
154
|
|
|
140
155
|
When the user asks to go faster **or** the work naturally splits (multiple packages,
|
|
@@ -184,6 +199,9 @@ Ark protects the **boundary around** a framework, not its internals. Nest/DI pub
|
|
|
184
199
|
If `src/contexts` or `src/bounded-contexts` exists, prefer `ddd-bounded-contexts`.
|
|
185
200
|
**Next.js:** `app/api/**` / `pages/api/**` (and route-group `app/(…)/api/**`) default to
|
|
186
201
|
**ApplicationOrchestration**, not Presentation — do not reclassify API shells as UI.
|
|
202
|
+
User wants the ArkRun extra → write **advisory** `arkRun` (schema `1.2+`, real
|
|
203
|
+
`compositionRoots`, existing `managedLayers`) **in this turn**. Do not add it to a compact
|
|
204
|
+
starter. Do not promote to enforced as the session-0 default.
|
|
187
205
|
2. **Check + diagnose** — `summary.concentrated` / dominant edge → fix contract first, don’t freeze.
|
|
188
206
|
Cross-slice / cross-context `peerIsolation` hits are judgment: extract shared or events.
|
|
189
207
|
If one edge dominates residual debt: **STOP — do not continue this skill as complete.** **STOP — concentrated edge:** rewrite `ark.config.json` **in this turn** with source evidence (do not freeze a wrong config or grind N freezes).
|
|
@@ -226,6 +244,9 @@ proposals applied or deferred, **phase**, **top Shape / design-weak opportunitie
|
|
|
226
244
|
|
|
227
245
|
- Freeze false positives to get green.
|
|
228
246
|
- Force runtime kernel over existing Nest/DI.
|
|
247
|
+
- Put `arkRun` on the compact starter / `ark start` scaffold.
|
|
248
|
+
- Claim in-memory kernel stores are production durability.
|
|
249
|
+
- Invent `/ark-run`.
|
|
229
250
|
- Claim Enforce while governed% is low, cores empty with I/O in Application, or core bags ungoverned.
|
|
230
251
|
- End adopt with only “baseline written” when design-weak residual is visible in files you opened.
|
|
231
252
|
|
|
@@ -237,7 +258,7 @@ End with **exactly** these headings (markdown `###`):
|
|
|
237
258
|
- **Sensor:** commands/tools run
|
|
238
259
|
- **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
|
|
239
260
|
- **Result:** one-line outcome
|
|
240
|
-
- **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
|
|
261
|
+
- **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** vs **[ArkRun]** (or `n/a` if unused)
|
|
241
262
|
- **Compass:** top residual lenses | `n/a`
|
|
242
263
|
- **Done axes:** architecture residual (status/doctor/compass) | feature/ticket residual (outside package). Enforce green ≠ feature done
|
|
243
264
|
- **Handoff:** `/ark-…` / CLI / `none`
|
|
@@ -19,6 +19,9 @@ description: "Where does new code go? Names the layer, directory, and naming for
|
|
|
19
19
|
- `filePath` is known before the call. Description alone is not a path.
|
|
20
20
|
- Golden pattern is load-bearing when present. Adopt generates it.
|
|
21
21
|
- Do not default a repository to Presentation.
|
|
22
|
+
- When `arkRun` is on: scaffold through the kernel (no `new` of managed types; declare
|
|
23
|
+
`uses` / `reactsTo` / `raises` / `sends`). Extra off → do not introduce the kernel. Enable it
|
|
24
|
+
via `/ark-adopt`. Skills never enforce.
|
|
22
25
|
|
|
23
26
|
## Autonomy contract
|
|
24
27
|
|
|
@@ -62,6 +65,7 @@ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement f
|
|
|
62
65
|
|------------------------|-------------------------|
|
|
63
66
|
| New artifact: where + **write** under the config | Existing violation cluster → `/ark-autopilot` |
|
|
64
67
|
| Naming / directory for a known kind | Session 0 / config missing or lying → `/ark-adopt` (then come back) |
|
|
68
|
+
| Kernel-managed artifact when `arkRun` is already on | Extra not chosen yet → `/ark-adopt` (advisory `arkRun`); evaluate / migrate a hand-rolled bus → `/ark-runtime` |
|
|
65
69
|
|
|
66
70
|
The user describes something they need to build (a saga, a background job, an
|
|
67
71
|
event handler, a repository, an HTTP client, a use case, a projection, …).
|
|
@@ -104,19 +108,32 @@ ArkGate has **two opt-in planes**. The user chooses which to use; you **always l
|
|
|
104
108
|
|-------|------------------|----------------|-----------------|
|
|
105
109
|
| **Layers** (inter-layer) | Who may import whom, capabilities, pure/forbiddenGlobals, peerIsolation | `ark.config.json` → `layers[]`, `rules[]` | graph check, baseline edges, doctor coverage % |
|
|
106
110
|
| **ArkRules** (intra-layer) | Structure inside a layer + domain invariants as data | `arkRules` map + `arkrules/<ExactLayerName>.json` | structure sensors, invariant coverage, `--rules-inventory`, doctor `rulesUnderContract` |
|
|
111
|
+
| **ArkRun** (extra) | Kernel usage + complete declarations | `arkRun` on `ark.config.json` (schema `1.2+`) + companion `@arkgate/runtime` | `ARKRUN_*`, doctor `arkRun` (`notAScore`) |
|
|
107
112
|
|
|
108
113
|
**Rules for every report / answer:**
|
|
109
|
-
1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** (or a two-column table with those headers).
|
|
114
|
+
1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** or **`[ArkRun]`** (or a two-column table with those headers).
|
|
110
115
|
2. Never call an import-edge violation an “invariant” or an aggregate sensor a “layer deny.”
|
|
111
116
|
3. Absence of `arkRules` is **valid** — do not force ArkRules unless the user wants them or residual inventory clearly wants a pilot.
|
|
112
117
|
4. Missing layer home: add it via **`/ark-adopt`** in this session if needed, then write the file; never invent `mechanical-safe`.
|
|
113
118
|
5. CLI helpers: `ark-check --rules-inventory --json`, doctor JSON `rulesUnderContract`, sensors emit `ARKRULE_*` / `INVARIANT_UNCOVERED` with `evidence.arkruleId`.
|
|
119
|
+
6. Absence of `arkRun` is **valid**. Do not introduce the kernel speculatively. Skills never enforce this extra.
|
|
114
120
|
|
|
115
121
|
|
|
116
122
|
### Place + ArkRules
|
|
117
123
|
- Choose layer from contract **and** check structure sensors for that layer (private state, factory, thin adapter).
|
|
118
124
|
- Scaffold to satisfy **[ArkRules]** when present; state which sensors apply.
|
|
119
125
|
|
|
126
|
+
### Place + ArkRun
|
|
127
|
+
When `arkRun` is present on the architecture config:
|
|
128
|
+
- Scaffold kernel-managed artifacts **through the kernel**, not `new` of an admitted type (`ARKRUN_DIRECT_NEW`).
|
|
129
|
+
- Call `createStrictArkKernel` (or an admission sibling) only inside `arkRun.compositionRoots`. Each call is a new instance — no process-wide `getKernel()`.
|
|
130
|
+
- Domain-role files stay kernel-free (`ARKRUN_KERNEL_IN_DOMAIN`). Import from `@arkgate/runtime` (or `/nestjs`), never a removed `arkgate/runtime` shim.
|
|
131
|
+
- List `uses` / `reactsTo` / `raises` / `sends` when `requireDeclarations` is on. Adding an existing call-site literal to the declaration list is the only mechanical-safe ArkRun edit; inventing a new emit / handle / depend is judgment.
|
|
132
|
+
- Do not import a homemade bus (`EventEmitter`, queue clients) in `managedLayers` — send on the kernel transport (`local` / `localBlocking` / `broker`; `ephemeral` defaults true). No shipped cloud SDKs.
|
|
133
|
+
- In-memory stores are **not** production durability. Doctor `arkRun` is `notAScore`.
|
|
134
|
+
- Absence of the extra: place with **[Layer]** + **[ArkRules]** only. Enable advisory extra via `/ark-adopt`; evaluate a hand-rolled bus via `/ark-runtime`. Do not invent `/ark-run`.
|
|
135
|
+
- Skills never enforce.
|
|
136
|
+
|
|
120
137
|
## Subagent fan-out (optional, host-dependent)
|
|
121
138
|
|
|
122
139
|
If the host supports **parallel subagents** and the task splits cleanly (e.g. multiple
|
|
@@ -148,6 +165,10 @@ the same files or weaken the gate.
|
|
|
148
165
|
that matches the direction (driven/persistence vs driving/http).
|
|
149
166
|
- Reacts to events, long-running coordination (saga/workflow), scheduled
|
|
150
167
|
jobs, projections → the event/workflow layers if the config declares them.
|
|
168
|
+
When `arkRun` is on, wire those through the kernel (register + declarations),
|
|
169
|
+
not a homemade emitter.
|
|
170
|
+
- Kernel-managed application service when `arkRun` is on → composition-root factory
|
|
171
|
+
+ `register({ uses, reactsTo, raises, sends })`; never `new` of the admitted type.
|
|
151
172
|
- **`vertical-slice` contract:** put co-located feature code under
|
|
152
173
|
`src/features/<slice>/…` (never import a sibling slice); shared primitives
|
|
153
174
|
under `src/shared/`; infra under `src/lib/`; shell under `src/app/`.
|
|
@@ -175,6 +196,9 @@ the same files or weaken the gate.
|
|
|
175
196
|
(not place one new artifact): place only the new file under the golden/contract home, then
|
|
176
197
|
hand off **one** pilot via `pilotLoop.nextPilot` / `/ark-explore` shape-focus — never multi-pilot
|
|
177
198
|
batch reshape from this skill.
|
|
199
|
+
- If `arkRun` is on and the user is grinding skip violations (`new` of managed types, homemade
|
|
200
|
+
bus) across many files: place this artifact through the kernel, then leftover `/ark-fix` /
|
|
201
|
+
`/ark-autopilot`. Extra not on → `/ark-adopt` (advisory) or `/ark-runtime` (evaluate).
|
|
178
202
|
|
|
179
203
|
## Operating rules
|
|
180
204
|
|
|
@@ -207,7 +231,7 @@ End with **exactly** these headings (markdown `###`):
|
|
|
207
231
|
- **Sensor:** commands/tools run
|
|
208
232
|
- **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
|
|
209
233
|
- **Result:** one-line outcome
|
|
210
|
-
- **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
|
|
234
|
+
- **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** vs **[ArkRun]** (or `n/a` if unused)
|
|
211
235
|
- **Compass:** top residual lenses | `n/a`
|
|
212
236
|
- **Done axes:** architecture residual (status/doctor/compass) | feature/ticket residual (outside package). Enforce green ≠ feature done
|
|
213
237
|
- **Handoff:** `/ark-…` / CLI / `none`
|
|
@@ -1,25 +1,36 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ark-runtime
|
|
3
|
-
description: Evaluate the experimental
|
|
3
|
+
description: Evaluate and wire the experimental ArkRun companion (@arkgate/runtime) against hand-rolled event bus, outbox, saga, projection, policy, or NestJS code. One candidate. Extra on via /ark-adopt; new files via /ark-place. Skills never enforce.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# /ark-runtime — Evaluate
|
|
6
|
+
# /ark-runtime — Evaluate and wire ArkRun (experimental opt-in)
|
|
7
7
|
|
|
8
|
-
The runtime
|
|
9
|
-
|
|
8
|
+
The ArkRun companion (`@arkgate/runtime`) is currently **experimental**. It is **not** required
|
|
9
|
+
for ArkGate enforcement and is **not** production durability. Use this skill when the user wants
|
|
10
|
+
to evaluate or wire the kernel. **This skill never enforces** — the write / CI / ESLint plane
|
|
11
|
+
does when the `arkRun` extra is on. Do **not** invent `/ark-run`.
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
**When:** evaluate a hand-rolled bus / outbox / saga / projection / policy / Nest adapter against
|
|
14
|
+
the companion, or wire an extra that is already on (composition root, declarations, transport).
|
|
15
|
+
**Not when:** session 0 / extra not chosen (`/ark-adopt`); one new file (`/ark-place`); skip-violation
|
|
16
|
+
grind (`/ark-autopilot` / leftover `/ark-fix`).
|
|
17
|
+
|
|
18
|
+
## Extra vs companion (mandatory)
|
|
19
|
+
|
|
20
|
+
| Piece | What it is | What it is not |
|
|
21
|
+
|-------|------------|----------------|
|
|
22
|
+
| **ArkRun extra** (`arkRun` on `ark.config.json`, schema `1.2+`) | Gate contract: kernel usage + complete declarations | A score; Layers / ArkRules replacement; merge teeth while `advisory` |
|
|
23
|
+
| **Companion** `@arkgate/runtime` | Kernel you construct with `createStrictArkKernel` (one instance per call) | Bundled in the `arkgate` tarball; a process-wide `getKernel()`; shipped cloud broker SDKs |
|
|
24
|
+
|
|
25
|
+
Absence of the extra is **silent** — Layers and ArkRules verdicts stay identical. Doctor / status
|
|
26
|
+
`arkRun` is always `notAScore`. Never invent 0–10 scores or pass/fail from this skill.
|
|
17
27
|
|
|
18
28
|
## Improvement compass note
|
|
19
29
|
|
|
20
30
|
This skill is **experimental runtime** only. Do **not** treat runtime adoption as residual on the
|
|
21
31
|
resilience lens unless the user explicitly opts into the experimental kernel. Prefer doctor compass
|
|
22
32
|
for static architecture residual; hand static residual to `/ark-explore` / `/ark-autopilot`.
|
|
33
|
+
Doctor `arkRun` residual is a finding-id count (`ARKRUN_*`), never a compass score.
|
|
23
34
|
|
|
24
35
|
## Dual engine (mandatory)
|
|
25
36
|
|
|
@@ -41,7 +52,7 @@ restart/retargeting is required. `ark://manifest` never satisfies this preflight
|
|
|
41
52
|
|
|
42
53
|
## Out of scope for ArkRules
|
|
43
54
|
|
|
44
|
-
This skill is **runtime-kernel only**. Do not mix ArkRules structure/invariants here; hand off to `/ark-contract` / `/ark-adopt` / `/ark-explore` for static contract planes.
|
|
55
|
+
This skill is **runtime-kernel only**. Do not mix ArkRules structure/invariants here; hand off to `/ark-contract` / `/ark-adopt` / `/ark-explore` for static contract planes. Label kernel-usage residual **`[ArkRun]`** so it never blurs with **`[Layer]`** or **`[ArkRules]`**.
|
|
45
56
|
|
|
46
57
|
## Subagent fan-out (optional, host-dependent)
|
|
47
58
|
|
|
@@ -62,23 +73,45 @@ the same files or weaken the gate.
|
|
|
62
73
|
- policy/authorization checks scattered across use cases
|
|
63
74
|
Also check whether `@nestjs/common` is present → the `@arkgate/runtime/nestjs`
|
|
64
75
|
adapters apply.
|
|
65
|
-
2. **
|
|
76
|
+
2. **Read the extra** — open `ark.config.json`. If `arkRun` is absent and the user wants the extra,
|
|
77
|
+
**STOP — do not continue this skill as complete.** Handoff **`/ark-adopt`** to write **advisory**
|
|
78
|
+
`arkRun` (schema `1.2+`; `compositionRoots`, `managedLayers`, `requireDeclarations`). Do not
|
|
79
|
+
invent the extra here. If the extra is present, note `mode`, roots, managed layers, and
|
|
80
|
+
`requireDeclarations`; doctor `arkRun` is `notAScore`.
|
|
81
|
+
3. **Pick ONE target** — the smallest, most self-contained candidate (fewest
|
|
66
82
|
call sites). Migrating everything at once is how adoptions die. List the
|
|
67
|
-
rest as follow-ups in the report.
|
|
68
|
-
|
|
83
|
+
rest as follow-ups in the report. New files after the extra is on go through **`/ark-place`**.
|
|
84
|
+
4. **Resolve availability** — run `npm view @arkgate/runtime dist-tags --json`. If an
|
|
69
85
|
`experimental` tag exists, install that exact companion. Otherwise continue only from an
|
|
70
86
|
ArkGate source checkout: run `npm run build:runtime` at its root and install its local
|
|
71
87
|
`packages/runtime` folder into the target. Outside a source checkout, stop and report that the
|
|
72
88
|
runtime is unavailable; never fall back to the deprecated root shims as if they contained it.
|
|
73
|
-
|
|
89
|
+
Import from `@arkgate/runtime` (or `@arkgate/runtime/nestjs`) — never a removed `arkgate/runtime`
|
|
90
|
+
shim.
|
|
91
|
+
5. **Wire through the kernel** — read the
|
|
74
92
|
[runtime package guide](https://github.com/pedroknigge/arkgate/blob/main/packages/runtime/README.md)
|
|
75
93
|
plus the [experimental surface policy](https://github.com/pedroknigge/arkgate/blob/main/docs/package-surface.md#experimental-opt-in-surfaces) before
|
|
76
|
-
writing code.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
94
|
+
writing code.
|
|
95
|
+
- Call `createStrictArkKernel` (or an admission sibling: `createArkKernel`, `*FromConfig`) **only**
|
|
96
|
+
inside `arkRun.compositionRoots`. Each call is a new instance — no process-wide singleton.
|
|
97
|
+
- Keep Domain-role layers kernel-free (`ARKRUN_KERNEL_IN_DOMAIN`).
|
|
98
|
+
- Resolve managed types from the kernel; do not construct admitted types with `new`
|
|
99
|
+
(`ARKRUN_DIRECT_NEW`).
|
|
100
|
+
- On `register()`, declare `uses` / `reactsTo` / `raises` / `sends`. `extendedInfo` is
|
|
101
|
+
tooling-only and is **not** a gate verdict. Adding an existing call-site literal to the
|
|
102
|
+
declaration list is the only mechanical-safe ArkRun edit; inventing a new emit / handle /
|
|
103
|
+
depend is judgment.
|
|
104
|
+
- Send on kernel transport: `local` / `localBlocking` / `broker`. `ephemeral` defaults **true**.
|
|
105
|
+
Broker adapters are ports you inject — this package does not ship cloud SDKs. Unbound
|
|
106
|
+
`broker` falls back in-process local. Do not import `EventEmitter` or a homemade bus in
|
|
107
|
+
`managedLayers` (`ARKRUN_TRANSPORT_BYPASS`).
|
|
108
|
+
- Optional inspector: `startInspector()` on `127.0.0.1`, refuses `NODE_ENV=production`, no
|
|
109
|
+
public bind. Snapshots / `requestGraph` (process or technical + Mermaid) are tooling, not a
|
|
110
|
+
score. `getDependencyInformationPackage()` never includes factories, live instances, or
|
|
111
|
+
input DTOs.
|
|
112
|
+
- In-memory stores lose state on restart — **not** production durability. Note bounded history
|
|
113
|
+
(`maxHistorySize` 1000) if the hand-rolled version retained everything.
|
|
114
|
+
6. **Delete the hand-rolled version** once call sites are moved — the point is
|
|
82
115
|
less code, not a second parallel system. Deleting code is a destructive move:
|
|
83
116
|
confirm with the user before removing the old implementation, and never delete
|
|
84
117
|
something the inventory only *suspects* is dead (a misclassified load-bearing
|
|
@@ -87,6 +120,8 @@ the same files or weaken the gate.
|
|
|
87
120
|
## Critical handoffs
|
|
88
121
|
|
|
89
122
|
- No static gates yet: **STOP — do not continue this skill as complete.** Run `/ark-adopt` first (`ark-check --recommend` / leftover `/ark-architect`).
|
|
123
|
+
- Extra absent and the user wants it: **STOP — do not continue this skill as complete.** **`/ark-adopt`** writes advisory `arkRun`.
|
|
124
|
+
- Skip cluster (`new` of managed types, homemade bus, kernel in Domain) after the extra is on: leftover **`/ark-fix`** / **`/ark-loop`** or **`/ark-autopilot`** — this skill still wires one candidate.
|
|
90
125
|
- Runtime companion unavailable from npm and no ArkGate source checkout: **STOP** and report the distribution boundary.
|
|
91
126
|
- Inventory finds nothing: stop; do not introduce kernel speculatively.
|
|
92
127
|
|
|
@@ -96,20 +131,26 @@ the same files or weaken the gate.
|
|
|
96
131
|
introduce the runtime kernel speculatively. Static enforcement alone is a
|
|
97
132
|
complete, valid use of Ark.
|
|
98
133
|
- Keep the migration diff reviewable: one feature per invocation.
|
|
134
|
+
- Skills never enforce; never weaken `ark.config.json` to skip `ARKRUN_*`.
|
|
135
|
+
- Never a process-wide kernel singleton. Never shipped cloud broker SDKs.
|
|
136
|
+
- Never claim in-memory stores are production-durable.
|
|
99
137
|
- Plain-language reporting: one sentence per concept ("outbox = events are
|
|
100
138
|
saved in the same transaction as your data, then published — so you never
|
|
101
139
|
publish something that didn't commit").
|
|
102
140
|
|
|
103
141
|
## Related onboarding
|
|
104
142
|
|
|
105
|
-
- Adopt static gates and application shape **first** (`/ark-adopt`).
|
|
106
|
-
|
|
143
|
+
- Adopt static gates and application shape **first** (`/ark-adopt`). Brownfield: same door —
|
|
144
|
+
advisory extra only until the team promotes; absence is valid.
|
|
145
|
+
- Runtime kernel is optional and separate from enthusiast onboarding. Do not put `arkRun` on the
|
|
146
|
+
compact starter.
|
|
107
147
|
|
|
108
148
|
## Verify and report
|
|
109
149
|
|
|
110
150
|
Run the project's tests plus `ark-check --root . --config ark.config.json
|
|
111
151
|
--strict-config`. Report: what was migrated, lines deleted vs added, remaining
|
|
112
|
-
candidates ranked,
|
|
152
|
+
candidates ranked, behavior differences (e.g. bounded history), and **`[ArkRun]`** residual
|
|
153
|
+
(`ARKRUN_*` / doctor `arkRun`, `notAScore`) separately from Layers / ArkRules.
|
|
113
154
|
|
|
114
155
|
## Completion contract (skill incomplete if missing)
|
|
115
156
|
|
|
@@ -119,6 +160,7 @@ End with **exactly** these headings (markdown `###`):
|
|
|
119
160
|
- **Sensor:** commands/tools run
|
|
120
161
|
- **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
|
|
121
162
|
- **Result:** one-line outcome
|
|
163
|
+
- **Planes:** **`[ArkRun]`** residual (or `n/a` if extra absent) — do not mix with `[Layer]` / `[ArkRules]`
|
|
122
164
|
- **Compass:** `n/a` (runtime skill; static residual → explore/fix) | top residual if doctor was run
|
|
123
165
|
- **Handoff:** `/ark-…` / CLI / `none`
|
|
124
166
|
- **Incomplete?** `no` | `yes — <what is missing>`
|
|
@@ -20,6 +20,8 @@ description: Session 0 — mark the Ark path. Greenfield scaffold or brownfield
|
|
|
20
20
|
- Generate `.ark/golden-pattern.json` (load-bearing for `/ark-place`).
|
|
21
21
|
- Future houses: mark unused layer globs `reserved` / `allowEmpty` so `--strict-config` does not fail.
|
|
22
22
|
- CLI-first: if `arkgate-check` already resolved the root, do not wait on MCP.
|
|
23
|
+
- Do not add `arkRun` unless the user wants the extra. When they do, write **advisory** `arkRun`
|
|
24
|
+
(schema `1.2+`) in this turn. Absence is silent and valid. Skills never enforce.
|
|
23
25
|
|
|
24
26
|
Invoking this skill **is** the approval. Write the architecture config in this turn.
|
|
25
27
|
Greenfield: scaffold like `--recommend`. Brownfield: match **product
|
|
@@ -94,6 +96,7 @@ When present, prefer the consumer **domain glossary** for layer names, slice fol
|
|
|
94
96
|
| False-green / concentrated edge needs config truth | Feature file only → `/ark-place` |
|
|
95
97
|
| Mine loose business rules into Domain / advisory ArkRules | Apply leftover design after the path is honest → `/ark-autopilot` |
|
|
96
98
|
| Freeze **real** debt after the config is honest | User said map only |
|
|
99
|
+
| Turn **advisory** ArkRun on (`arkRun` extra, schema `1.2+`) | Evaluate / wire a hand-rolled bus → `/ark-runtime`; new kernel-managed file → `/ark-place` |
|
|
97
100
|
|
|
98
101
|
## Dual engine (mandatory)
|
|
99
102
|
|
|
@@ -121,13 +124,15 @@ ArkGate has **two opt-in planes**. The user chooses which to use; you **always l
|
|
|
121
124
|
|-------|------------------|----------------|-----------------|
|
|
122
125
|
| **Layers** (inter-layer) | Who may import whom, capabilities, pure/forbiddenGlobals, peerIsolation | `ark.config.json` → `layers[]`, `rules[]` | graph check, baseline edges, doctor coverage % |
|
|
123
126
|
| **ArkRules** (intra-layer) | Structure inside a layer + domain invariants as data | `arkRules` map + `arkrules/<ExactLayerName>.json` | structure sensors, invariant coverage, `--rules-inventory`, doctor `rulesUnderContract` |
|
|
127
|
+
| **ArkRun** (extra) | Kernel usage + complete declarations | `arkRun` on `ark.config.json` (schema `1.2+`) + companion `@arkgate/runtime` | `ARKRUN_*`, doctor `arkRun` (`notAScore`) |
|
|
124
128
|
|
|
125
129
|
**Rules for every report / answer:**
|
|
126
|
-
1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** (or a two-column table with those headers).
|
|
130
|
+
1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** or **`[ArkRun]`** (or a two-column table with those headers).
|
|
127
131
|
2. Never call an import-edge violation an “invariant” or an aggregate sensor a “layer deny.”
|
|
128
132
|
3. Absence of `arkRules` is **valid** — do not force ArkRules unless the user wants them or residual inventory clearly wants a pilot.
|
|
129
133
|
4. Editing `arkrules/*` or promoting modes is **this skill** (session 0) or **`/ark-autopilot`** later; never invent `mechanical-safe`.
|
|
130
134
|
5. CLI helpers: `ark-check --rules-inventory --json`, doctor JSON `rulesUnderContract`, sensors emit `ARKRULE_*` / `INVARIANT_UNCOVERED` with `evidence.arkruleId`.
|
|
135
|
+
6. Absence of `arkRun` is **valid**. Write it only when the user wants the extra. Skills never enforce.
|
|
131
136
|
|
|
132
137
|
|
|
133
138
|
### Adopt + ArkRules
|
|
@@ -135,6 +140,16 @@ ArkGate has **two opt-in planes**. The user chooses which to use; you **always l
|
|
|
135
140
|
- Mine rules → inventory + write advisory invariants/structure into `arkrules/<Layer>.json` **in this turn**.
|
|
136
141
|
- Freeze baseline is **[Layer]** debt; inventory residual is **[ArkRules]** — report both.
|
|
137
142
|
|
|
143
|
+
### Adopt + ArkRun
|
|
144
|
+
- User asked to turn the extra on: write **advisory** `arkRun` on `ark.config.json` (`schemaVersion` `1.2+`) **in this turn**. Default `"mode": "advisory"`.
|
|
145
|
+
- Required shape: `compositionRoots` (real files; empty + enforced fails closed), `managedLayers` (existing `layers[].name` only), `requireDeclarations` (default true).
|
|
146
|
+
- Do **not** put `arkRun` on the compact starter / `ark start` scaffold. Brownfield stays advisory until the team promotes.
|
|
147
|
+
- Absence is valid and **silent** — never force the extra. Never force the kernel over existing Nest/DI. Do not invent `/ark-run`.
|
|
148
|
+
- Import the companion from `@arkgate/runtime` (factory `createStrictArkKernel`, per instance, no process-wide singleton). Never a removed `arkgate/runtime` shim. No shipped cloud broker SDKs.
|
|
149
|
+
- In-memory stores are **not** production durability. Branding ArkRun is not a durability claim. Doctor / status `arkRun` is `notAScore`.
|
|
150
|
+
- Demoting enforced → advisory or deleting the extra is policy-delta **weakening**.
|
|
151
|
+
- After the extra is honest: handoff `/ark-runtime` to wire one candidate, `/ark-place` for new kernel-managed files. Skills never enforce.
|
|
152
|
+
|
|
138
153
|
## Subagent fan-out (optional, host-dependent)
|
|
139
154
|
|
|
140
155
|
When the user asks to go faster **or** the work naturally splits (multiple packages,
|
|
@@ -184,6 +199,9 @@ Ark protects the **boundary around** a framework, not its internals. Nest/DI pub
|
|
|
184
199
|
If `src/contexts` or `src/bounded-contexts` exists, prefer `ddd-bounded-contexts`.
|
|
185
200
|
**Next.js:** `app/api/**` / `pages/api/**` (and route-group `app/(…)/api/**`) default to
|
|
186
201
|
**ApplicationOrchestration**, not Presentation — do not reclassify API shells as UI.
|
|
202
|
+
User wants the ArkRun extra → write **advisory** `arkRun` (schema `1.2+`, real
|
|
203
|
+
`compositionRoots`, existing `managedLayers`) **in this turn**. Do not add it to a compact
|
|
204
|
+
starter. Do not promote to enforced as the session-0 default.
|
|
187
205
|
2. **Check + diagnose** — `summary.concentrated` / dominant edge → fix contract first, don’t freeze.
|
|
188
206
|
Cross-slice / cross-context `peerIsolation` hits are judgment: extract shared or events.
|
|
189
207
|
If one edge dominates residual debt: **STOP — do not continue this skill as complete.** **STOP — concentrated edge:** rewrite `ark.config.json` **in this turn** with source evidence (do not freeze a wrong config or grind N freezes).
|
|
@@ -226,6 +244,9 @@ proposals applied or deferred, **phase**, **top Shape / design-weak opportunitie
|
|
|
226
244
|
|
|
227
245
|
- Freeze false positives to get green.
|
|
228
246
|
- Force runtime kernel over existing Nest/DI.
|
|
247
|
+
- Put `arkRun` on the compact starter / `ark start` scaffold.
|
|
248
|
+
- Claim in-memory kernel stores are production durability.
|
|
249
|
+
- Invent `/ark-run`.
|
|
229
250
|
- Claim Enforce while governed% is low, cores empty with I/O in Application, or core bags ungoverned.
|
|
230
251
|
- End adopt with only “baseline written” when design-weak residual is visible in files you opened.
|
|
231
252
|
|
|
@@ -237,7 +258,7 @@ End with **exactly** these headings (markdown `###`):
|
|
|
237
258
|
- **Sensor:** commands/tools run
|
|
238
259
|
- **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
|
|
239
260
|
- **Result:** one-line outcome
|
|
240
|
-
- **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
|
|
261
|
+
- **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** vs **[ArkRun]** (or `n/a` if unused)
|
|
241
262
|
- **Compass:** top residual lenses | `n/a`
|
|
242
263
|
- **Done axes:** architecture residual (status/doctor/compass) | feature/ticket residual (outside package). Enforce green ≠ feature done
|
|
243
264
|
- **Handoff:** `/ark-…` / CLI / `none`
|