arkgate 2.2.0 → 2.3.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 +15 -0
- package/bin/ark-check.mjs +6 -0
- package/bin/ark-shared.mjs +17 -3
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/nestjs/index.cjs +1 -1
- package/dist/nestjs/index.cjs.map +1 -1
- package/dist/nestjs/index.js +1 -1
- package/dist/nestjs/index.js.map +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to ArkGate (`arkgate`; formerly `ark-runtime-kernel`) are documented here.
|
|
4
4
|
|
|
5
|
+
## 2.3.0 — 2026-07-08
|
|
6
|
+
|
|
7
|
+
### Added — P0 complete (mechanical-safe depth + release-trust)
|
|
8
|
+
|
|
9
|
+
- **Third `mechanical-safe` remediation:** pure-type **file** relocate when the whole source
|
|
10
|
+
file is type-surface only (`sourcePureTypeModule` + type-only edge) —
|
|
11
|
+
`remediationKind: pure-type-file-relocate`.
|
|
12
|
+
- Keeps 2.2.0 classes: type-only import move; static import of pure-type target modules.
|
|
13
|
+
- **Deferred:** verbatim infra relocation of value modules (cannot prove behavior-preserving).
|
|
14
|
+
- **Release-trust:** `verify-release-tag` defaults to **fail-closed** on unsigned tags;
|
|
15
|
+
override only via `ARK_ALLOW_UNSIGNED_RELEASE_TAG=true` (publish workflow sets this
|
|
16
|
+
explicitly until GPG signing is wired). Unit tests cover policy + real script path.
|
|
17
|
+
- Corpus: pure-type file, pure-type target, side-effect type file, require/dynamic, value
|
|
18
|
+
import, forbidden global, cycles.
|
|
19
|
+
|
|
5
20
|
## 2.2.0 — 2026-07-08
|
|
6
21
|
|
|
7
22
|
### Added — co-pilot P0 depth (mechanical-safe expansion)
|
package/bin/ark-check.mjs
CHANGED
|
@@ -4327,6 +4327,8 @@ function buildRemediationPlan(root, activeViolations, governedPercent = null, to
|
|
|
4327
4327
|
...(v.target ? { target: v.target } : {}),
|
|
4328
4328
|
...(v.typeOnly ? { typeOnly: true } : {}),
|
|
4329
4329
|
...(v.targetTypeOnlyExports ? { targetTypeOnlyExports: true } : {}),
|
|
4330
|
+
...(v.sourcePureTypeModule ? { sourcePureTypeModule: true } : {}),
|
|
4331
|
+
...(verdict.remediationKind ? { remediationKind: verdict.remediationKind } : {}),
|
|
4330
4332
|
};
|
|
4331
4333
|
});
|
|
4332
4334
|
// Order: auto-applicable first (quick, safe wins), then human decisions, then deferred.
|
|
@@ -4935,6 +4937,9 @@ async function main() {
|
|
|
4935
4937
|
const staticEdge = edge.kind === 'import' || edge.kind === 'export';
|
|
4936
4938
|
const targetTypeOnlyExports =
|
|
4937
4939
|
staticEdge && Boolean(targetCached?.exportsOnlyTypes) && !edge.typeOnly;
|
|
4940
|
+
// Importer is itself a pure type-surface file (no runtime body) — enables
|
|
4941
|
+
// pure-type-file-relocate classification when the edge is type-only.
|
|
4942
|
+
const sourcePureTypeModule = Boolean(entry.exportsOnlyTypes);
|
|
4938
4943
|
violations.push({
|
|
4939
4944
|
ruleId: 'LAYER_IMPORT_VIOLATION',
|
|
4940
4945
|
file: relFile,
|
|
@@ -4944,6 +4949,7 @@ async function main() {
|
|
|
4944
4949
|
target: relTarget,
|
|
4945
4950
|
...(edge.typeOnly ? { typeOnly: true } : {}),
|
|
4946
4951
|
...(targetTypeOnlyExports ? { targetTypeOnlyExports: true } : {}),
|
|
4952
|
+
...(sourcePureTypeModule ? { sourcePureTypeModule: true } : {}),
|
|
4947
4953
|
...(edge.kind ? { edgeKind: edge.kind } : {}),
|
|
4948
4954
|
message: rule.message ?? `${sourceLayer} must not ${edge.kind} ${targetLayer}.`,
|
|
4949
4955
|
});
|
package/bin/ark-shared.mjs
CHANGED
|
@@ -542,20 +542,33 @@ export function looksLikeIntent(value) {
|
|
|
542
542
|
*
|
|
543
543
|
* Deliberately biased toward 'judgment': a false 'mechanical-safe' that auto-lands a bad edit
|
|
544
544
|
* is the failure mode that sinks trust. Only statically-provable type-surface fixes earn 'auto':
|
|
545
|
-
* (1)
|
|
546
|
-
* (2)
|
|
545
|
+
* (1) whole source file is pure type-surface + type-only edge → relocate the file
|
|
546
|
+
* (2) import/export already marked type-only → move/re-export the type
|
|
547
|
+
* (3) static value-syntax import of a pure type-only *target* module → import type
|
|
547
548
|
* Pure function of one violation object so CLI, MCP, and apply-loop classify identically.
|
|
548
|
-
* Returns { class, confidence, rationale }.
|
|
549
|
+
* Returns { class, confidence, rationale, remediationKind? }.
|
|
549
550
|
*/
|
|
550
551
|
export const REMEDIATION_CLASSES = ['mechanical-safe', 'judgment', 'deferred'];
|
|
551
552
|
|
|
552
553
|
export function classifyRemediation(violation) {
|
|
553
554
|
const ruleId = violation?.ruleId;
|
|
554
555
|
if (ruleId === 'LAYER_IMPORT_VIOLATION') {
|
|
556
|
+
// Pure type-only *source file* with a type-only edge: relocating the whole file is
|
|
557
|
+
// behavior-preserving (no runtime body). Distinct from a single import-type move.
|
|
558
|
+
if (violation.typeOnly && violation.sourcePureTypeModule) {
|
|
559
|
+
return {
|
|
560
|
+
class: 'mechanical-safe',
|
|
561
|
+
confidence: 0.88,
|
|
562
|
+
remediationKind: 'pure-type-file-relocate',
|
|
563
|
+
rationale:
|
|
564
|
+
'Whole source file is type-only surface (no runtime statements) with a type-only cross-layer edge: relocate the file to the owning layer (or extract the type there). Behavior-preserving; gate verifies.',
|
|
565
|
+
};
|
|
566
|
+
}
|
|
555
567
|
if (violation.typeOnly) {
|
|
556
568
|
return {
|
|
557
569
|
class: 'mechanical-safe',
|
|
558
570
|
confidence: 0.9,
|
|
571
|
+
remediationKind: 'type-only-import-move',
|
|
559
572
|
rationale:
|
|
560
573
|
'Type-only import (erased at runtime): move the type to the layer that owns it and re-export for back-compat. Behavior-preserving, and the gate verifies it.',
|
|
561
574
|
};
|
|
@@ -576,6 +589,7 @@ export function classifyRemediation(violation) {
|
|
|
576
589
|
return {
|
|
577
590
|
class: 'mechanical-safe',
|
|
578
591
|
confidence: 0.85,
|
|
592
|
+
remediationKind: 'import-type-from-pure-type-module',
|
|
579
593
|
rationale:
|
|
580
594
|
'Static import targets a pure type-only module: convert to `import type` (erased at runtime) and place the type in a shared/owning layer. No runtime coupling; gate verifies.',
|
|
581
595
|
};
|