arkgate 4.2.0 → 4.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 +86 -4
- package/README.md +20 -6
- package/bin/ark-mcp-runtime.mjs +64 -0
- package/bin/ark-shared.mjs +16 -4
- package/bin/ark.mjs +55 -1
- package/bin/lib/adapter-contract.mjs +88 -5
- package/bin/lib/agent-projection-command.mjs +396 -0
- package/bin/lib/agent-projection.mjs +319 -0
- package/bin/lib/agent-skills-package.mjs +266 -0
- package/bin/lib/baseline-key.mjs +32 -0
- package/bin/lib/ci-and-commands.mjs +44 -0
- package/bin/lib/diagnostic-catalog.mjs +155 -0
- package/bin/lib/physical-cohesion.mjs +2 -1
- package/bin/lib/status-command.mjs +369 -0
- package/bin/lib/status-manifest.mjs +394 -0
- package/dist/eslint/index.cjs +3 -3
- package/dist/eslint/index.js +3 -3
- package/dist/index.cjs +46 -11
- package/dist/index.d.ts +729 -6
- package/dist/index.js +46 -11
- package/docs/README.md +6 -6
- package/docs/agent-guide.md +112 -14
- package/docs/configuration.md +7 -0
- package/docs/develop.md +8 -0
- package/docs/diagnostics.md +606 -0
- package/docs/package-surface.md +19 -8
- package/docs/product-voice.md +45 -0
- package/docs/use.md +23 -0
- package/package.json +11 -1
- package/schemas/ark.analysis-result.schema.json +14 -1
- package/schemas/ark.status-manifest.schema.json +244 -0
- package/server.json +2 -2
- package/templates/agent-skills/README.md +59 -0
- package/templates/agent-skills/ark-adopt/SKILL.md +171 -0
- package/templates/agent-skills/ark-architect/SKILL.md +175 -0
- package/templates/agent-skills/ark-autopilot/SKILL.md +242 -0
- package/templates/agent-skills/ark-contract/SKILL.md +136 -0
- package/templates/agent-skills/ark-coverage/SKILL.md +167 -0
- package/templates/agent-skills/ark-explain/SKILL.md +210 -0
- package/templates/agent-skills/ark-explore/SKILL.md +377 -0
- package/templates/agent-skills/ark-fix/SKILL.md +185 -0
- package/templates/agent-skills/ark-loop/SKILL.md +180 -0
- package/templates/agent-skills/ark-place/SKILL.md +162 -0
- package/templates/agent-skills/ark-runtime/SKILL.md +120 -0
- package/templates/agent-skills/ark-think/SKILL.md +133 -0
- package/templates/agent-skills/ark-upgrade/SKILL.md +218 -0
package/dist/index.d.ts
CHANGED
|
@@ -244,11 +244,17 @@ declare function loadArkConfigContract(input: unknown, source?: string): ArkConf
|
|
|
244
244
|
declare function parseArkConfigJson(json: string, source?: string): ArkConfigLoadResult;
|
|
245
245
|
|
|
246
246
|
/** ArkGate library version — single source of truth. */
|
|
247
|
-
declare const version = "4.
|
|
247
|
+
declare const version = "4.3.0";
|
|
248
248
|
|
|
249
249
|
/** Versioned public result contract shared by every ArkGate enforcement adapter. */
|
|
250
|
-
/**
|
|
251
|
-
|
|
250
|
+
/**
|
|
251
|
+
* 1.5 adds stable finding refs on every factory-emitted diagnostic (ACS06):
|
|
252
|
+
* `findingRef`, `targetKey` (baseline-compatible), `docsCodePath`.
|
|
253
|
+
* 1.4 added optional evidence.arkruleId + evidence.arkruleSource (ADR 0012 / AR03).
|
|
254
|
+
*/
|
|
255
|
+
declare const ARK_ANALYSIS_RESULT_SCHEMA_VERSION: "1.5";
|
|
256
|
+
/** Repo-relative diagnostics docs path (parity with ACS02 diagnostic catalog). */
|
|
257
|
+
declare const ADAPTER_DIAGNOSTIC_DOCS_RELATIVE_PATH: "docs/diagnostics.md";
|
|
252
258
|
type AdapterSeverity = 'error' | 'warning';
|
|
253
259
|
type AnalysisCompleteness = 'complete' | 'partial' | 'unavailable';
|
|
254
260
|
type AnalysisMode = 'lexical-compatibility' | 'resolved-candidate-facts';
|
|
@@ -313,6 +319,23 @@ type AdapterDiagnostic = {
|
|
|
313
319
|
};
|
|
314
320
|
/** Added in schema 1.1; optional in TypeScript so 1.0 consumer-owned values remain valid. */
|
|
315
321
|
nextAction?: string;
|
|
322
|
+
/**
|
|
323
|
+
* ACS06 / schema 1.5 — compact stable id for multi-turn re-address
|
|
324
|
+
* (`fnv1a-` + hex). Always derived from `targetKey`. Optional so 1.0–1.4
|
|
325
|
+
* consumer-owned diagnostics remain assignable.
|
|
326
|
+
*/
|
|
327
|
+
findingRef?: string;
|
|
328
|
+
/**
|
|
329
|
+
* ACS06 / schema 1.5 — baseline-compatible freeze identity
|
|
330
|
+
* (`ruleId|file|fromLayer|toLayer|target`, with occurrence `#N` suffixes in lists).
|
|
331
|
+
* Must match `baselineKey` / `baselineOccurrenceKeys` so refs never orphan baselines.
|
|
332
|
+
*/
|
|
333
|
+
targetKey?: string;
|
|
334
|
+
/**
|
|
335
|
+
* ACS06 / schema 1.5 — package-relative docs path with rule anchor
|
|
336
|
+
* (`docs/diagnostics.md#RULE_ID`). Optional for legacy consumer-owned values.
|
|
337
|
+
*/
|
|
338
|
+
docsCodePath?: string;
|
|
316
339
|
};
|
|
317
340
|
type LegacyAdapterResult = {
|
|
318
341
|
schemaVersion: '1.0' | '1.1';
|
|
@@ -366,7 +389,30 @@ type CurrentAdapterResult = (CurrentAdapterResultBase & Partial<ResolvedAdapterE
|
|
|
366
389
|
completeness: 'unavailable';
|
|
367
390
|
});
|
|
368
391
|
type AdapterResult = LegacyAdapterResult | Version12AdapterResult | CurrentAdapterResult;
|
|
369
|
-
|
|
392
|
+
/**
|
|
393
|
+
* Baseline-compatible target key for a violation input.
|
|
394
|
+
* Field order and empty-string fallbacks **must** match `baselineKey` in
|
|
395
|
+
* `baselineKey.ts` — parity tests guard this so finding refs never orphan freezes.
|
|
396
|
+
*
|
|
397
|
+
* Note: uses raw ruleId/file strings (including empty) the same way baseline does;
|
|
398
|
+
* display `ruleId` / `location.file` may still normalize to ARK_UNKNOWN / `<unknown>`.
|
|
399
|
+
*/
|
|
400
|
+
declare function adapterFindingTargetKey(violation: AdapterViolationInput): string;
|
|
401
|
+
/**
|
|
402
|
+
* Occurrence-aware target keys for a violation list (parity with baselineOccurrenceKeys).
|
|
403
|
+
* First occurrence keeps the historical base key; duplicates get `#N`.
|
|
404
|
+
*/
|
|
405
|
+
declare function adapterFindingOccurrenceTargetKeys(violations: readonly AdapterViolationInput[]): string[];
|
|
406
|
+
/** FNV-1a finding ref from a baseline-compatible targetKey (not a security hash). */
|
|
407
|
+
declare function adapterFindingRefFromTargetKey(targetKey: string): string;
|
|
408
|
+
/** Package-relative docs path with fragment for a public ruleId. */
|
|
409
|
+
declare function adapterDocsCodePath(ruleId: string): string;
|
|
410
|
+
declare function toAdapterDiagnostic(violation: AdapterViolationInput, fallbackSeverity?: AdapterSeverity,
|
|
411
|
+
/**
|
|
412
|
+
* Optional precomputed baseline-compatible targetKey (e.g. occurrence-aware from
|
|
413
|
+
* `adapterFindingOccurrenceTargetKeys`). When omitted, uses the first-occurrence key.
|
|
414
|
+
*/
|
|
415
|
+
targetKeyOverride?: string): AdapterDiagnostic;
|
|
370
416
|
declare function createAdapterResult(input: {
|
|
371
417
|
valid: boolean;
|
|
372
418
|
completeness?: AnalysisCompleteness;
|
|
@@ -443,7 +489,7 @@ declare const ARK_ANALYSIS_RESULT_SCHEMA: {
|
|
|
443
489
|
}];
|
|
444
490
|
readonly properties: {
|
|
445
491
|
readonly schemaVersion: {
|
|
446
|
-
readonly const: "1.
|
|
492
|
+
readonly const: "1.5";
|
|
447
493
|
};
|
|
448
494
|
readonly mode: {
|
|
449
495
|
readonly enum: readonly ["lexical-compatibility", "resolved-candidate-facts"];
|
|
@@ -582,6 +628,25 @@ declare const ARK_ANALYSIS_RESULT_SCHEMA: {
|
|
|
582
628
|
readonly type: "string";
|
|
583
629
|
readonly minLength: 1;
|
|
584
630
|
};
|
|
631
|
+
/** ACS06 — compact multi-turn id; always derived from targetKey when emitted. */
|
|
632
|
+
readonly findingRef: {
|
|
633
|
+
readonly type: "string";
|
|
634
|
+
readonly minLength: 1;
|
|
635
|
+
readonly pattern: "^fnv1a-[0-9a-f]{8}$";
|
|
636
|
+
};
|
|
637
|
+
/**
|
|
638
|
+
* ACS06 — baseline-compatible freeze identity
|
|
639
|
+
* (`ruleId|file|from|to|target` with optional `#N` occurrence suffix).
|
|
640
|
+
*/
|
|
641
|
+
readonly targetKey: {
|
|
642
|
+
readonly type: "string";
|
|
643
|
+
readonly minLength: 1;
|
|
644
|
+
};
|
|
645
|
+
/** ACS06 — package-relative diagnostics anchor path. */
|
|
646
|
+
readonly docsCodePath: {
|
|
647
|
+
readonly type: "string";
|
|
648
|
+
readonly minLength: 1;
|
|
649
|
+
};
|
|
585
650
|
};
|
|
586
651
|
};
|
|
587
652
|
};
|
|
@@ -2732,4 +2797,662 @@ type ArkDesignDeltaResult = {
|
|
|
2732
2797
|
error?: string;
|
|
2733
2798
|
};
|
|
2734
2799
|
|
|
2735
|
-
|
|
2800
|
+
/**
|
|
2801
|
+
* Public diagnostic code catalog (ACS02).
|
|
2802
|
+
*
|
|
2803
|
+
* Closed vocabulary of stable `ruleId` values emitted by ArkGate adapters with
|
|
2804
|
+
* human/agent `why` / `fix` anchors and docs fragment ids. Cataloguing only —
|
|
2805
|
+
* no new rule semantics, no LLM verdict, no enforcement from prose.
|
|
2806
|
+
*
|
|
2807
|
+
* **Canonical** for docs, agent projection (ACS04), and finding refs (ACS06).
|
|
2808
|
+
* Runtime remediation remains in `remediation.ts`; parity tests bind the two.
|
|
2809
|
+
*
|
|
2810
|
+
* Zero Node I/O. Optional CLI surface: generated `bin/lib/diagnostic-catalog.mjs`.
|
|
2811
|
+
*
|
|
2812
|
+
* @see docs/diagnostics.md
|
|
2813
|
+
* @see docs/plans/agent-contract-surface-4.3/README.md
|
|
2814
|
+
*/
|
|
2815
|
+
/** Product-relative docs path (shipped in the npm tarball when listed in package files). */
|
|
2816
|
+
declare const DIAGNOSTIC_DOCS_RELATIVE_PATH: "docs/diagnostics.md";
|
|
2817
|
+
/** Schema id for serializing the catalog snapshot (agents / install projection). */
|
|
2818
|
+
declare const DIAGNOSTIC_CATALOG_SCHEMA_VERSION: "1.0";
|
|
2819
|
+
type DiagnosticCategory = 'layer' | 'capability' | 'publish' | 'safety' | 'arkrules' | 'preflight' | 'analysis' | 'snippet-policy' | 'config' | 'adapter' | 'meta';
|
|
2820
|
+
type DiagnosticCatalogEntry = {
|
|
2821
|
+
/** Stable public violation / diagnostic id. */
|
|
2822
|
+
ruleId: string;
|
|
2823
|
+
/** Short title for indexes and agent projection. */
|
|
2824
|
+
title: string;
|
|
2825
|
+
/** Why this finding exists (contract intent). */
|
|
2826
|
+
why: string;
|
|
2827
|
+
/**
|
|
2828
|
+
* Canonical fix guidance (agent + human). Contextual nextAction on live
|
|
2829
|
+
* findings may specialize this (e.g. type-only vs value layer import).
|
|
2830
|
+
*/
|
|
2831
|
+
fix: string;
|
|
2832
|
+
/** Markdown fragment id for docs/diagnostics.md (without leading #). */
|
|
2833
|
+
docsAnchor: string;
|
|
2834
|
+
category: DiagnosticCategory;
|
|
2835
|
+
/**
|
|
2836
|
+
* When true, finding is commonly advisory / non-blocking in default profiles
|
|
2837
|
+
* (doctor/config warnings, type-only placement debt, empty ArkRule scope).
|
|
2838
|
+
* Not a severity bit for the engine — documentation only.
|
|
2839
|
+
*/
|
|
2840
|
+
oftenAdvisory?: boolean;
|
|
2841
|
+
};
|
|
2842
|
+
/**
|
|
2843
|
+
* Closed public catalog. Order is stable (category groups, then ruleId) for
|
|
2844
|
+
* deterministic serialization and docs generation.
|
|
2845
|
+
*
|
|
2846
|
+
* Every production-emitted `ruleId` must appear here. Remediation switch cases
|
|
2847
|
+
* and adapter nextAction branches are parity-tested against this list.
|
|
2848
|
+
*/
|
|
2849
|
+
declare const DIAGNOSTIC_CATALOG: readonly DiagnosticCatalogEntry[];
|
|
2850
|
+
/** All public ruleIds in catalog order. */
|
|
2851
|
+
declare const DIAGNOSTIC_RULE_IDS: readonly string[];
|
|
2852
|
+
declare function isKnownDiagnosticCode(ruleId: string | null | undefined): boolean;
|
|
2853
|
+
/**
|
|
2854
|
+
* True when the code is catalogued or is an ArkRule-family id handled by the
|
|
2855
|
+
* ARKRULE_* prefix fallback in remediation (structure sensors may add members later
|
|
2856
|
+
* only via catalog + ROADMAP — prefix alone is not a license for free-form ids).
|
|
2857
|
+
*/
|
|
2858
|
+
declare function isCataloguedOrArkRuleFamily(ruleId: string | null | undefined): boolean;
|
|
2859
|
+
declare function getDiagnosticCatalogEntry(ruleId: string | null | undefined): DiagnosticCatalogEntry | undefined;
|
|
2860
|
+
/** Fragment for docs links, e.g. `#LAYER_IMPORT_VIOLATION`. */
|
|
2861
|
+
declare function diagnosticDocsFragment(ruleId: string): string;
|
|
2862
|
+
/**
|
|
2863
|
+
* Repo-relative docs path with fragment (for agents and JSON).
|
|
2864
|
+
* Package consumers resolve against the installed package root or GitHub tree.
|
|
2865
|
+
*/
|
|
2866
|
+
declare function diagnosticDocsPath(ruleId: string): string;
|
|
2867
|
+
/** Catalog snapshot for JSON export / agent projection (stable field order). */
|
|
2868
|
+
declare function serializeDiagnosticCatalog(): {
|
|
2869
|
+
schemaVersion: typeof DIAGNOSTIC_CATALOG_SCHEMA_VERSION;
|
|
2870
|
+
docsPath: typeof DIAGNOSTIC_DOCS_RELATIVE_PATH;
|
|
2871
|
+
codes: readonly DiagnosticCatalogEntry[];
|
|
2872
|
+
};
|
|
2873
|
+
/**
|
|
2874
|
+
* Static catalog fix for a ruleId when no live violation context is available.
|
|
2875
|
+
* Live adapters should still use deterministicNextAction for specialized edges.
|
|
2876
|
+
*/
|
|
2877
|
+
declare function catalogFixForRuleId(ruleId: string | null | undefined): string | undefined;
|
|
2878
|
+
/**
|
|
2879
|
+
* Static catalog why for a ruleId (agent “why” surface).
|
|
2880
|
+
*/
|
|
2881
|
+
declare function catalogWhyForRuleId(ruleId: string | null | undefined): string | undefined;
|
|
2882
|
+
|
|
2883
|
+
/**
|
|
2884
|
+
* Public status manifest (ACS03).
|
|
2885
|
+
*
|
|
2886
|
+
* One machine-readable session/project snapshot for agents: project identity
|
|
2887
|
+
* binding, honest write-path activation, last-check summary, ArkRules residual
|
|
2888
|
+
* counts, and a primary next action. Binary facts only — never a numeric score,
|
|
2889
|
+
* never an LLM verdict, never a prompt.
|
|
2890
|
+
*
|
|
2891
|
+
* **Canonical** for `ark status --json`, MCP `ark_status`, and schema export.
|
|
2892
|
+
* Tooling gathers filesystem evidence; this module only assembles pure facts.
|
|
2893
|
+
*
|
|
2894
|
+
* @see docs/plans/agent-contract-surface-4.3/README.md
|
|
2895
|
+
*/
|
|
2896
|
+
|
|
2897
|
+
declare const ARK_STATUS_MANIFEST_SCHEMA_VERSION: "1.0";
|
|
2898
|
+
declare const ARK_STATUS_MANIFEST_SCHEMA_URL = "https://unpkg.com/arkgate@4/schemas/ark.status-manifest.schema.json";
|
|
2899
|
+
/** Write-path honesty class for agents (not a host capability claim by itself). */
|
|
2900
|
+
type StatusWritePathClass = 'hard' | 'advisory' | 'unavailable';
|
|
2901
|
+
/** Last architecture check verdict when evidence exists. */
|
|
2902
|
+
type StatusCheckVerdict = 'pass' | 'fail' | 'incomplete' | null;
|
|
2903
|
+
type StatusProjectIdentitySlice = {
|
|
2904
|
+
projectId: string | null;
|
|
2905
|
+
resolvedRoot: string;
|
|
2906
|
+
resolvedConfigPath: string | null;
|
|
2907
|
+
/** Binding status: matched | unverified | mismatch (same vocabulary as MCP). */
|
|
2908
|
+
binding: ProjectBinding['status'];
|
|
2909
|
+
authoritative: boolean;
|
|
2910
|
+
code?: ProjectBinding['code'];
|
|
2911
|
+
message?: string;
|
|
2912
|
+
};
|
|
2913
|
+
type StatusActivationSlice = {
|
|
2914
|
+
writePath: StatusWritePathClass;
|
|
2915
|
+
host: string | null;
|
|
2916
|
+
honestLabel: string;
|
|
2917
|
+
};
|
|
2918
|
+
type StatusLastCheckSlice = {
|
|
2919
|
+
at: string | null;
|
|
2920
|
+
verdict: StatusCheckVerdict;
|
|
2921
|
+
activeViolations: number | null;
|
|
2922
|
+
frozenResidual: number | null;
|
|
2923
|
+
};
|
|
2924
|
+
type StatusRulesSlice = {
|
|
2925
|
+
arkRulesLoaded: boolean;
|
|
2926
|
+
inventoried: number | null;
|
|
2927
|
+
underContract: number | null;
|
|
2928
|
+
frozenResidual: number | null;
|
|
2929
|
+
};
|
|
2930
|
+
type StatusNextAction = {
|
|
2931
|
+
id: string;
|
|
2932
|
+
summary: string;
|
|
2933
|
+
};
|
|
2934
|
+
type StatusManifest = {
|
|
2935
|
+
schemaVersion: typeof ARK_STATUS_MANIFEST_SCHEMA_VERSION;
|
|
2936
|
+
arkgateVersion: string;
|
|
2937
|
+
projectIdentity: StatusProjectIdentitySlice;
|
|
2938
|
+
activation: StatusActivationSlice;
|
|
2939
|
+
lastCheck: StatusLastCheckSlice;
|
|
2940
|
+
rules: StatusRulesSlice;
|
|
2941
|
+
nextAction: StatusNextAction;
|
|
2942
|
+
};
|
|
2943
|
+
/**
|
|
2944
|
+
* Pure facts supplied by Tooling after path canonicalization and I/O.
|
|
2945
|
+
* Domain never opens files or prompts.
|
|
2946
|
+
*/
|
|
2947
|
+
type StatusManifestFacts = {
|
|
2948
|
+
arkgateVersion: string;
|
|
2949
|
+
resolvedRoot: string;
|
|
2950
|
+
resolvedConfigPath?: string | null;
|
|
2951
|
+
projectId?: string | null;
|
|
2952
|
+
/**
|
|
2953
|
+
* Optional agent expectation (same shape as MCP `project`).
|
|
2954
|
+
* Omitted → binding reflects local CLI session (matched when a project root resolved).
|
|
2955
|
+
*/
|
|
2956
|
+
expectation?: ProjectExpectation | null;
|
|
2957
|
+
/**
|
|
2958
|
+
* Precomputed root relation when expectation.expectedRoot is set.
|
|
2959
|
+
* Tooling must canonicalize before comparing.
|
|
2960
|
+
* - exact: expectedRoot === resolvedRoot
|
|
2961
|
+
* - descendant: expected is inside project but not the root
|
|
2962
|
+
* - outside: not within this project
|
|
2963
|
+
* - unknown: could not evaluate (fail closed → unverified)
|
|
2964
|
+
*/
|
|
2965
|
+
expectedRootRelation?: 'exact' | 'descendant' | 'outside' | 'unknown' | null;
|
|
2966
|
+
/** Active agent host id (claude, cursor, codex, …) or null/unknown. */
|
|
2967
|
+
activeHost?: string | null;
|
|
2968
|
+
/** Evidence-backed hard local write for this invocation. */
|
|
2969
|
+
hardWriteActive?: boolean;
|
|
2970
|
+
/** Host is soft-write only (Cursor/Codex/OpenCode class). */
|
|
2971
|
+
softWriteHost?: boolean;
|
|
2972
|
+
/** Package/host write boundary could not be analyzed. */
|
|
2973
|
+
writePathUnavailable?: boolean;
|
|
2974
|
+
honestLabel?: string | null;
|
|
2975
|
+
lastCheckAt?: string | null;
|
|
2976
|
+
lastCheckVerdict?: StatusCheckVerdict;
|
|
2977
|
+
activeViolations?: number | null;
|
|
2978
|
+
frozenResidual?: number | null;
|
|
2979
|
+
arkRulesLoaded?: boolean;
|
|
2980
|
+
rulesInventoried?: number | null;
|
|
2981
|
+
rulesUnderContract?: number | null;
|
|
2982
|
+
rulesFrozenResidual?: number | null;
|
|
2983
|
+
/** Optional override when Tooling already computed productHonesty next action. */
|
|
2984
|
+
nextActionOverride?: StatusNextAction | null;
|
|
2985
|
+
};
|
|
2986
|
+
/**
|
|
2987
|
+
* Evaluate project binding for status without filesystem.
|
|
2988
|
+
* Paths must already be canonical absolute strings when compared.
|
|
2989
|
+
*/
|
|
2990
|
+
declare function evaluateStatusBinding(input: {
|
|
2991
|
+
resolvedRoot: string;
|
|
2992
|
+
projectId: string | null | undefined;
|
|
2993
|
+
expectation?: ProjectExpectation | null;
|
|
2994
|
+
expectedRootRelation?: StatusManifestFacts['expectedRootRelation'];
|
|
2995
|
+
}): ProjectBinding;
|
|
2996
|
+
/**
|
|
2997
|
+
* Map write-path evidence to the closed activation writePath vocabulary.
|
|
2998
|
+
* Soft hosts never become hard; missing analysis → unavailable.
|
|
2999
|
+
*/
|
|
3000
|
+
declare function classifyStatusWritePath(input: {
|
|
3001
|
+
hardWriteActive?: boolean;
|
|
3002
|
+
softWriteHost?: boolean;
|
|
3003
|
+
writePathUnavailable?: boolean;
|
|
3004
|
+
activeHost?: string | null;
|
|
3005
|
+
}): StatusWritePathClass;
|
|
3006
|
+
declare function defaultHonestLabel(writePath: StatusWritePathClass, host: string | null): string;
|
|
3007
|
+
/**
|
|
3008
|
+
* Deterministic next action from residual facts (no LLM).
|
|
3009
|
+
* Prefer explicit override from productHonesty when provided.
|
|
3010
|
+
*/
|
|
3011
|
+
declare function resolveStatusNextAction(facts: StatusManifestFacts, binding: ProjectBinding, activation: StatusActivationSlice, lastCheck: StatusLastCheckSlice, rules: StatusRulesSlice): StatusNextAction;
|
|
3012
|
+
declare function buildStatusManifest(facts: StatusManifestFacts): StatusManifest;
|
|
3013
|
+
/** JSON Schema for the public status manifest (package export + agents). */
|
|
3014
|
+
declare const ARK_STATUS_MANIFEST_SCHEMA: {
|
|
3015
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
3016
|
+
readonly $id: "https://unpkg.com/arkgate@4/schemas/ark.status-manifest.schema.json";
|
|
3017
|
+
readonly title: "ArkGate status manifest";
|
|
3018
|
+
readonly description: "Unified session/project status snapshot for agents (identity, activation honesty, last check, rules counts, next action). Not a score.";
|
|
3019
|
+
readonly type: "object";
|
|
3020
|
+
readonly additionalProperties: false;
|
|
3021
|
+
readonly required: readonly ["schemaVersion", "arkgateVersion", "projectIdentity", "activation", "lastCheck", "rules", "nextAction"];
|
|
3022
|
+
readonly properties: {
|
|
3023
|
+
readonly schemaVersion: {
|
|
3024
|
+
readonly const: "1.0";
|
|
3025
|
+
};
|
|
3026
|
+
readonly arkgateVersion: {
|
|
3027
|
+
readonly type: "string";
|
|
3028
|
+
readonly minLength: 1;
|
|
3029
|
+
};
|
|
3030
|
+
readonly projectIdentity: {
|
|
3031
|
+
readonly type: "object";
|
|
3032
|
+
readonly additionalProperties: false;
|
|
3033
|
+
readonly required: readonly ["projectId", "resolvedRoot", "resolvedConfigPath", "binding", "authoritative"];
|
|
3034
|
+
readonly properties: {
|
|
3035
|
+
readonly projectId: {
|
|
3036
|
+
readonly anyOf: readonly [{
|
|
3037
|
+
readonly type: "string";
|
|
3038
|
+
readonly pattern: "^sha256:[a-f0-9]{64}$";
|
|
3039
|
+
}, {
|
|
3040
|
+
readonly type: "null";
|
|
3041
|
+
}];
|
|
3042
|
+
};
|
|
3043
|
+
readonly resolvedRoot: {
|
|
3044
|
+
readonly type: "string";
|
|
3045
|
+
readonly minLength: 1;
|
|
3046
|
+
};
|
|
3047
|
+
readonly resolvedConfigPath: {
|
|
3048
|
+
readonly anyOf: readonly [{
|
|
3049
|
+
readonly type: "string";
|
|
3050
|
+
readonly minLength: 1;
|
|
3051
|
+
}, {
|
|
3052
|
+
readonly type: "null";
|
|
3053
|
+
}];
|
|
3054
|
+
};
|
|
3055
|
+
readonly binding: {
|
|
3056
|
+
readonly enum: readonly ["matched", "unverified", "mismatch"];
|
|
3057
|
+
};
|
|
3058
|
+
readonly authoritative: {
|
|
3059
|
+
readonly type: "boolean";
|
|
3060
|
+
};
|
|
3061
|
+
readonly code: {
|
|
3062
|
+
readonly enum: readonly ["PROJECT_ROOT_MISMATCH", "PROJECT_ID_MISMATCH", "INVALID_PROJECT_EXPECTATION"];
|
|
3063
|
+
};
|
|
3064
|
+
readonly message: {
|
|
3065
|
+
readonly type: "string";
|
|
3066
|
+
readonly minLength: 1;
|
|
3067
|
+
};
|
|
3068
|
+
};
|
|
3069
|
+
};
|
|
3070
|
+
readonly activation: {
|
|
3071
|
+
readonly type: "object";
|
|
3072
|
+
readonly additionalProperties: false;
|
|
3073
|
+
readonly required: readonly ["writePath", "host", "honestLabel"];
|
|
3074
|
+
readonly properties: {
|
|
3075
|
+
readonly writePath: {
|
|
3076
|
+
readonly enum: readonly ["hard", "advisory", "unavailable"];
|
|
3077
|
+
};
|
|
3078
|
+
readonly host: {
|
|
3079
|
+
readonly anyOf: readonly [{
|
|
3080
|
+
readonly type: "string";
|
|
3081
|
+
readonly minLength: 1;
|
|
3082
|
+
}, {
|
|
3083
|
+
readonly type: "null";
|
|
3084
|
+
}];
|
|
3085
|
+
};
|
|
3086
|
+
readonly honestLabel: {
|
|
3087
|
+
readonly type: "string";
|
|
3088
|
+
readonly minLength: 1;
|
|
3089
|
+
};
|
|
3090
|
+
};
|
|
3091
|
+
};
|
|
3092
|
+
readonly lastCheck: {
|
|
3093
|
+
readonly type: "object";
|
|
3094
|
+
readonly additionalProperties: false;
|
|
3095
|
+
readonly required: readonly ["at", "verdict", "activeViolations", "frozenResidual"];
|
|
3096
|
+
readonly properties: {
|
|
3097
|
+
readonly at: {
|
|
3098
|
+
readonly anyOf: readonly [{
|
|
3099
|
+
readonly type: "string";
|
|
3100
|
+
readonly minLength: 1;
|
|
3101
|
+
}, {
|
|
3102
|
+
readonly type: "null";
|
|
3103
|
+
}];
|
|
3104
|
+
};
|
|
3105
|
+
readonly verdict: {
|
|
3106
|
+
readonly anyOf: readonly [{
|
|
3107
|
+
readonly enum: readonly ["pass", "fail", "incomplete"];
|
|
3108
|
+
}, {
|
|
3109
|
+
readonly type: "null";
|
|
3110
|
+
}];
|
|
3111
|
+
};
|
|
3112
|
+
readonly activeViolations: {
|
|
3113
|
+
readonly anyOf: readonly [{
|
|
3114
|
+
readonly type: "integer";
|
|
3115
|
+
readonly minimum: 0;
|
|
3116
|
+
}, {
|
|
3117
|
+
readonly type: "null";
|
|
3118
|
+
}];
|
|
3119
|
+
};
|
|
3120
|
+
readonly frozenResidual: {
|
|
3121
|
+
readonly anyOf: readonly [{
|
|
3122
|
+
readonly type: "integer";
|
|
3123
|
+
readonly minimum: 0;
|
|
3124
|
+
}, {
|
|
3125
|
+
readonly type: "null";
|
|
3126
|
+
}];
|
|
3127
|
+
};
|
|
3128
|
+
};
|
|
3129
|
+
};
|
|
3130
|
+
readonly rules: {
|
|
3131
|
+
readonly type: "object";
|
|
3132
|
+
readonly additionalProperties: false;
|
|
3133
|
+
readonly required: readonly ["arkRulesLoaded", "inventoried", "underContract", "frozenResidual"];
|
|
3134
|
+
readonly properties: {
|
|
3135
|
+
readonly arkRulesLoaded: {
|
|
3136
|
+
readonly type: "boolean";
|
|
3137
|
+
};
|
|
3138
|
+
readonly inventoried: {
|
|
3139
|
+
readonly anyOf: readonly [{
|
|
3140
|
+
readonly type: "integer";
|
|
3141
|
+
readonly minimum: 0;
|
|
3142
|
+
}, {
|
|
3143
|
+
readonly type: "null";
|
|
3144
|
+
}];
|
|
3145
|
+
};
|
|
3146
|
+
readonly underContract: {
|
|
3147
|
+
readonly anyOf: readonly [{
|
|
3148
|
+
readonly type: "integer";
|
|
3149
|
+
readonly minimum: 0;
|
|
3150
|
+
}, {
|
|
3151
|
+
readonly type: "null";
|
|
3152
|
+
}];
|
|
3153
|
+
};
|
|
3154
|
+
readonly frozenResidual: {
|
|
3155
|
+
readonly anyOf: readonly [{
|
|
3156
|
+
readonly type: "integer";
|
|
3157
|
+
readonly minimum: 0;
|
|
3158
|
+
}, {
|
|
3159
|
+
readonly type: "null";
|
|
3160
|
+
}];
|
|
3161
|
+
};
|
|
3162
|
+
};
|
|
3163
|
+
};
|
|
3164
|
+
readonly nextAction: {
|
|
3165
|
+
readonly type: "object";
|
|
3166
|
+
readonly additionalProperties: false;
|
|
3167
|
+
readonly required: readonly ["id", "summary"];
|
|
3168
|
+
readonly properties: {
|
|
3169
|
+
readonly id: {
|
|
3170
|
+
readonly type: "string";
|
|
3171
|
+
readonly minLength: 1;
|
|
3172
|
+
};
|
|
3173
|
+
readonly summary: {
|
|
3174
|
+
readonly type: "string";
|
|
3175
|
+
readonly minLength: 1;
|
|
3176
|
+
};
|
|
3177
|
+
};
|
|
3178
|
+
};
|
|
3179
|
+
};
|
|
3180
|
+
};
|
|
3181
|
+
|
|
3182
|
+
/**
|
|
3183
|
+
* Version-matched agent contract projection (ACS04).
|
|
3184
|
+
*
|
|
3185
|
+
* Compact agent-facing markdown (plus meta) derived from the installed package
|
|
3186
|
+
* version and an effective project contract summary. Explicitly **non-authoritative**:
|
|
3187
|
+
* enforcement is ark-check / hooks / CI — never this projection, AGENTS.md, or skills.
|
|
3188
|
+
*
|
|
3189
|
+
* **Canonical** for `ark agents-md`, install/upgrade AGENTS embedding, and drift tests.
|
|
3190
|
+
* Tooling gathers filesystem facts; this module only formats pure inputs.
|
|
3191
|
+
*
|
|
3192
|
+
* Zero Node I/O. Optional CLI surface: generated `bin/lib/agent-projection.mjs`.
|
|
3193
|
+
*
|
|
3194
|
+
* @see docs/plans/agent-contract-surface-4.3/README.md
|
|
3195
|
+
*/
|
|
3196
|
+
declare const ARK_AGENT_PROJECTION_SCHEMA_VERSION: "1.0";
|
|
3197
|
+
/** Begin marker for the managed projection region inside AGENTS.md (or equivalent). */
|
|
3198
|
+
declare const AGENT_PROJECTION_BEGIN_MARKER: "<!-- arkgate:agent-projection:begin";
|
|
3199
|
+
/** End marker for the managed projection region. */
|
|
3200
|
+
declare const AGENT_PROJECTION_END_MARKER: "<!-- arkgate:agent-projection:end -->";
|
|
3201
|
+
/**
|
|
3202
|
+
* Non-enforcement label — must appear in every generated projection body.
|
|
3203
|
+
* Agents and humans must not treat the projection as a pass/fail authority.
|
|
3204
|
+
*/
|
|
3205
|
+
declare const AGENT_PROJECTION_NON_ENFORCEMENT_LABEL: "This projection is **non-authoritative**. Enforcement is `ark-check` / host write hooks / required CI (`--strict-merge`), not AGENTS.md, skills, or this block.";
|
|
3206
|
+
/** Surfaces that actually enforce (closed vocabulary for meta + docs). */
|
|
3207
|
+
declare const AGENT_PROJECTION_ENFORCEMENT_SURFACES: readonly ["ark-check", "host-write-hooks", "ci-strict-merge"];
|
|
3208
|
+
/**
|
|
3209
|
+
* High-signal public ruleIds for the compact catalog short list in the projection.
|
|
3210
|
+
* Full catalog remains `docs/diagnostics.md` / `DIAGNOSTIC_CATALOG` (ACS02).
|
|
3211
|
+
* Titles are supplied by Tooling from the catalog when available.
|
|
3212
|
+
*/
|
|
3213
|
+
declare const DEFAULT_AGENT_PROJECTION_RULE_IDS: readonly string[];
|
|
3214
|
+
type AgentProjectionLayerSummary = {
|
|
3215
|
+
name: string;
|
|
3216
|
+
patterns?: readonly string[];
|
|
3217
|
+
intentPrefixes?: readonly string[];
|
|
3218
|
+
};
|
|
3219
|
+
type AgentProjectionCatalogEntry = {
|
|
3220
|
+
ruleId: string;
|
|
3221
|
+
title: string;
|
|
3222
|
+
};
|
|
3223
|
+
type AgentProjectionProfile = 'compact' | 'full';
|
|
3224
|
+
/**
|
|
3225
|
+
* Pure facts supplied by Tooling after reading package version + ark.config.
|
|
3226
|
+
* Domain never opens files or prompts.
|
|
3227
|
+
*/
|
|
3228
|
+
type AgentProjectionFacts = {
|
|
3229
|
+
/** Installed / shipping arkgate package version (stamped into the projection). */
|
|
3230
|
+
arkgateVersion: string;
|
|
3231
|
+
/** Project check command hint (e.g. `npm run check:architecture`). */
|
|
3232
|
+
checkCommand?: string | null;
|
|
3233
|
+
/** Effective layers from ark.config.json (null/empty → stock note). */
|
|
3234
|
+
layers?: readonly AgentProjectionLayerSummary[] | null;
|
|
3235
|
+
/** Short diagnostic catalog lines (ruleId + title). */
|
|
3236
|
+
catalogShortList?: readonly AgentProjectionCatalogEntry[] | null;
|
|
3237
|
+
/** Active host id when known (compact router context). */
|
|
3238
|
+
host?: string | null;
|
|
3239
|
+
/** full = placement + catalog short list; compact = thinner primary path. */
|
|
3240
|
+
profile?: AgentProjectionProfile | null;
|
|
3241
|
+
/** Docs path for the full diagnostic catalog (relative). */
|
|
3242
|
+
diagnosticsDocsPath?: string | null;
|
|
3243
|
+
};
|
|
3244
|
+
type AgentProjectionMeta = {
|
|
3245
|
+
schemaVersion: typeof ARK_AGENT_PROJECTION_SCHEMA_VERSION;
|
|
3246
|
+
arkgateVersion: string;
|
|
3247
|
+
/** Always true — projection is never a gate input. */
|
|
3248
|
+
nonAuthoritative: true;
|
|
3249
|
+
enforcementSurfaces: readonly string[];
|
|
3250
|
+
/** Content identity of the projection body (markers excluded). */
|
|
3251
|
+
contentIdentity: string;
|
|
3252
|
+
layerCount: number;
|
|
3253
|
+
catalogCodeCount: number;
|
|
3254
|
+
profile: AgentProjectionProfile;
|
|
3255
|
+
};
|
|
3256
|
+
type AgentProjectionMergeAction = 'created' | 'block-replaced' | 'block-inserted' | 'unchanged';
|
|
3257
|
+
type AgentProjectionMergeResult = {
|
|
3258
|
+
content: string;
|
|
3259
|
+
action: AgentProjectionMergeAction;
|
|
3260
|
+
previousBlock: string | null;
|
|
3261
|
+
contentIdentity: string;
|
|
3262
|
+
/** True when customized text outside the managed block was preserved. */
|
|
3263
|
+
preservedOutsideBlock: boolean;
|
|
3264
|
+
};
|
|
3265
|
+
/** FNV-1a identity — portable, no Node crypto (same family as stableHash). */
|
|
3266
|
+
declare function agentProjectionContentIdentity(body: string): string;
|
|
3267
|
+
/**
|
|
3268
|
+
* Build the managed begin marker line (includes version + nonAuthoritative stamp).
|
|
3269
|
+
*/
|
|
3270
|
+
declare function buildAgentProjectionBeginMarker(facts: {
|
|
3271
|
+
arkgateVersion: string;
|
|
3272
|
+
schemaVersion?: string;
|
|
3273
|
+
}): string;
|
|
3274
|
+
/**
|
|
3275
|
+
* Layer placement rows for the projection (compact markdown table).
|
|
3276
|
+
*/
|
|
3277
|
+
declare function formatAgentProjectionLayers(layers: readonly AgentProjectionLayerSummary[] | null | undefined): string;
|
|
3278
|
+
/**
|
|
3279
|
+
* Catalog short-list bullets (ruleId + title). Empty list → pointer only.
|
|
3280
|
+
*/
|
|
3281
|
+
declare function formatAgentProjectionCatalogShortList(entries: readonly AgentProjectionCatalogEntry[] | null | undefined, docsPath: string): string;
|
|
3282
|
+
/**
|
|
3283
|
+
* Projection **body** only (no begin/end markers). Used for content-identity.
|
|
3284
|
+
*/
|
|
3285
|
+
declare function buildAgentProjectionBody(facts: AgentProjectionFacts): string;
|
|
3286
|
+
/**
|
|
3287
|
+
* Full managed block: begin marker + body + end marker.
|
|
3288
|
+
*/
|
|
3289
|
+
declare function buildAgentProjectionBlock(facts: AgentProjectionFacts): string;
|
|
3290
|
+
/**
|
|
3291
|
+
* Machine meta for CLI `--json` / tests (never a gate input).
|
|
3292
|
+
*/
|
|
3293
|
+
declare function buildAgentProjectionMeta(facts: AgentProjectionFacts): AgentProjectionMeta;
|
|
3294
|
+
/**
|
|
3295
|
+
* Extract the managed projection block from a document (AGENTS.md or equivalent).
|
|
3296
|
+
*/
|
|
3297
|
+
declare function extractAgentProjectionBlock(document: string): {
|
|
3298
|
+
block: string | null;
|
|
3299
|
+
body: string | null;
|
|
3300
|
+
before: string;
|
|
3301
|
+
after: string;
|
|
3302
|
+
beginAttrs: string | null;
|
|
3303
|
+
};
|
|
3304
|
+
/**
|
|
3305
|
+
* Parse stamps from a projection begin marker or full block/document.
|
|
3306
|
+
*/
|
|
3307
|
+
declare function parseAgentProjectionStamp(source: string): {
|
|
3308
|
+
arkgateVersion: string | null;
|
|
3309
|
+
schemaVersion: string | null;
|
|
3310
|
+
nonAuthoritative: boolean;
|
|
3311
|
+
};
|
|
3312
|
+
/**
|
|
3313
|
+
* True when the document/block stamps the given package version.
|
|
3314
|
+
*/
|
|
3315
|
+
declare function projectionMatchesPackageVersion(source: string, packageVersion: string): boolean;
|
|
3316
|
+
/**
|
|
3317
|
+
* True when body text carries the non-enforcement label (substring match).
|
|
3318
|
+
*/
|
|
3319
|
+
declare function projectionHasNonEnforcementLabel(bodyOrBlock: string): boolean;
|
|
3320
|
+
/**
|
|
3321
|
+
* Merge a desired projection block into an existing document without rewriting
|
|
3322
|
+
* customized content **outside** the managed markers.
|
|
3323
|
+
*
|
|
3324
|
+
* - Missing document → create `# Ark Enforcement` + block
|
|
3325
|
+
* - Existing markers → replace block when content-identity differs; else unchanged
|
|
3326
|
+
* - No markers → insert block after the first markdown H1 (or at top)
|
|
3327
|
+
*/
|
|
3328
|
+
declare function mergeAgentProjectionDocument(existing: string | null | undefined, desiredBlock: string): AgentProjectionMergeResult;
|
|
3329
|
+
|
|
3330
|
+
/**
|
|
3331
|
+
* Agent Skills packaging contract (ACS05).
|
|
3332
|
+
*
|
|
3333
|
+
* Closed catalog of the **existing 13** `/ark-*` skill names and pure validation
|
|
3334
|
+
* for Agent Skills–compatible layout (`<name>/SKILL.md` with YAML frontmatter).
|
|
3335
|
+
*
|
|
3336
|
+
* **No new skill names** — the freeze list is the product contract. Packaging is
|
|
3337
|
+
* distribution only; enforcement remains ark-check / hooks / CI, never skills alone.
|
|
3338
|
+
*
|
|
3339
|
+
* Canonical authoring source remains flat `templates/skills/<name>.md`. The
|
|
3340
|
+
* Agent Skills layout is the generated twin at `templates/agent-skills/<name>/SKILL.md`.
|
|
3341
|
+
*
|
|
3342
|
+
* Zero Node I/O. Optional CLI surface: generated `bin/lib/agent-skills-package.mjs`.
|
|
3343
|
+
*
|
|
3344
|
+
* @see docs/plans/agent-contract-surface-4.3/README.md
|
|
3345
|
+
* @see https://agentskills.io/specification
|
|
3346
|
+
*/
|
|
3347
|
+
declare const ARK_AGENT_SKILLS_PACKAGE_SCHEMA_VERSION: "1.0";
|
|
3348
|
+
/**
|
|
3349
|
+
* Relative package-root path of the Agent Skills–compatible skill package.
|
|
3350
|
+
* Install via skills ecosystem: `npx skills add <path-to-this-dir>`.
|
|
3351
|
+
*/
|
|
3352
|
+
declare const AGENT_SKILLS_PACKAGE_RELATIVE_ROOT: "templates/agent-skills";
|
|
3353
|
+
/** Relative package-root path of flat skill templates (Ark install source). */
|
|
3354
|
+
declare const FLAT_SKILL_TEMPLATES_RELATIVE_ROOT: "templates/skills";
|
|
3355
|
+
/** Required entry filename inside each skill directory (Agent Skills standard). */
|
|
3356
|
+
declare const AGENT_SKILL_ENTRY_FILENAME: "SKILL.md";
|
|
3357
|
+
/**
|
|
3358
|
+
* Closed skill-name freeze (ACS / ADR skill freeze). Exactly these 13 names ship.
|
|
3359
|
+
* Sorted alphabetically for deterministic inventory diffs.
|
|
3360
|
+
*/
|
|
3361
|
+
declare const ARK_SKILL_NAMES: readonly ["ark-adopt", "ark-architect", "ark-autopilot", "ark-contract", "ark-coverage", "ark-explain", "ark-explore", "ark-fix", "ark-loop", "ark-place", "ark-runtime", "ark-think", "ark-upgrade"];
|
|
3362
|
+
type ArkSkillName = (typeof ARK_SKILL_NAMES)[number];
|
|
3363
|
+
/** Count of frozen skill names (must stay 13 until a ROADMAP item lifts the freeze). */
|
|
3364
|
+
declare const ARK_SKILL_NAME_COUNT: 13;
|
|
3365
|
+
/**
|
|
3366
|
+
* Agent Skills `name` field rules (agentskills.io):
|
|
3367
|
+
* - 1–64 characters
|
|
3368
|
+
* - lowercase a–z, digits, hyphens only
|
|
3369
|
+
* - no leading/trailing hyphen; no consecutive hyphens
|
|
3370
|
+
*/
|
|
3371
|
+
declare function isValidAgentSkillName(name: string): boolean;
|
|
3372
|
+
/** True when `name` is one of the frozen 13 Ark skill names. */
|
|
3373
|
+
declare function isArkSkillName(name: string): name is ArkSkillName;
|
|
3374
|
+
type ParsedSkillFrontmatter = {
|
|
3375
|
+
/** Raw frontmatter keys (string values; nested YAML not supported). */
|
|
3376
|
+
fields: Readonly<Record<string, string>>;
|
|
3377
|
+
name: string | null;
|
|
3378
|
+
description: string | null;
|
|
3379
|
+
license: string | null;
|
|
3380
|
+
};
|
|
3381
|
+
type ParseSkillDocumentResult = {
|
|
3382
|
+
/** True when opening `---` / closing `---` frontmatter fences were found. */
|
|
3383
|
+
hasFrontmatter: boolean;
|
|
3384
|
+
frontmatter: ParsedSkillFrontmatter | null;
|
|
3385
|
+
/** Markdown body after the frontmatter block (may be empty). */
|
|
3386
|
+
body: string;
|
|
3387
|
+
};
|
|
3388
|
+
/**
|
|
3389
|
+
* Parse a skill markdown document with optional YAML frontmatter.
|
|
3390
|
+
* Supports the simple `key: value` / `key: "quoted"` form used by Ark templates
|
|
3391
|
+
* (no nested maps, no multi-line YAML).
|
|
3392
|
+
*/
|
|
3393
|
+
declare function parseSkillDocument(content: string): ParseSkillDocumentResult;
|
|
3394
|
+
type AgentSkillValidationIssue = {
|
|
3395
|
+
code: 'MISSING_FRONTMATTER' | 'INVALID_NAME' | 'NAME_DIRECTORY_MISMATCH' | 'MISSING_DESCRIPTION' | 'DESCRIPTION_TOO_LONG' | 'EMPTY_BODY' | 'UNKNOWN_SKILL_NAME' | 'DUPLICATE_SKILL' | 'MISSING_SKILL' | 'EXTRA_SKILL' | 'CONTENT_MISMATCH';
|
|
3396
|
+
message: string;
|
|
3397
|
+
skillName?: string;
|
|
3398
|
+
};
|
|
3399
|
+
type ValidateAgentSkillDocumentInput = {
|
|
3400
|
+
/** Parent directory name (must match frontmatter `name`). */
|
|
3401
|
+
directoryName: string;
|
|
3402
|
+
/** Full SKILL.md / template content. */
|
|
3403
|
+
content: string;
|
|
3404
|
+
/**
|
|
3405
|
+
* When true (default), require `directoryName` / frontmatter name to be in
|
|
3406
|
+
* {@link ARK_SKILL_NAMES}. Set false only for generic Agent Skills checks.
|
|
3407
|
+
*/
|
|
3408
|
+
requireArkSkillName?: boolean;
|
|
3409
|
+
/** When true (default), require a non-empty markdown body after frontmatter. */
|
|
3410
|
+
requireBody?: boolean;
|
|
3411
|
+
};
|
|
3412
|
+
/**
|
|
3413
|
+
* Validate one skill document against the Agent Skills spec (+ optional Ark freeze).
|
|
3414
|
+
*/
|
|
3415
|
+
declare function validateAgentSkillDocument(input: ValidateAgentSkillDocumentInput): AgentSkillValidationIssue[];
|
|
3416
|
+
type AgentSkillPackageEntry = {
|
|
3417
|
+
/** Skill directory / frozen name. */
|
|
3418
|
+
name: string;
|
|
3419
|
+
/** Full SKILL.md content for the Agent Skills layout. */
|
|
3420
|
+
content: string;
|
|
3421
|
+
/** Optional flat-template content for byte-identity parity checks. */
|
|
3422
|
+
flatTemplateContent?: string | null;
|
|
3423
|
+
};
|
|
3424
|
+
type ValidateAgentSkillsPackageResult = {
|
|
3425
|
+
ok: boolean;
|
|
3426
|
+
issues: AgentSkillValidationIssue[];
|
|
3427
|
+
/** Sorted names present in the package input. */
|
|
3428
|
+
names: string[];
|
|
3429
|
+
expectedCount: number;
|
|
3430
|
+
presentCount: number;
|
|
3431
|
+
};
|
|
3432
|
+
/**
|
|
3433
|
+
* Validate a full Agent Skills package inventory against the frozen 13-name catalog.
|
|
3434
|
+
* Detects missing, extra, duplicate, invalid, and (when supplied) flat-template drift.
|
|
3435
|
+
*/
|
|
3436
|
+
declare function validateAgentSkillsPackage(entries: readonly AgentSkillPackageEntry[]): ValidateAgentSkillsPackageResult;
|
|
3437
|
+
/**
|
|
3438
|
+
* Normalize skill file content for identity compare (LF newlines, strip BOM).
|
|
3439
|
+
* Does not strip or rewrite frontmatter — Agent Skills export is 1:1 with flat templates.
|
|
3440
|
+
*/
|
|
3441
|
+
declare function normalizeSkillContent(content: string): string;
|
|
3442
|
+
/**
|
|
3443
|
+
* Relative path of one skill entry inside the Agent Skills package root.
|
|
3444
|
+
* Example: `ark-place/SKILL.md`
|
|
3445
|
+
*/
|
|
3446
|
+
declare function agentSkillEntryRelativePath(skillName: string): string;
|
|
3447
|
+
/**
|
|
3448
|
+
* Relative path from package root for one Agent Skills entry.
|
|
3449
|
+
* Example: `templates/agent-skills/ark-place/SKILL.md`
|
|
3450
|
+
*/
|
|
3451
|
+
declare function agentSkillPackageFileRelativePath(skillName: string): string;
|
|
3452
|
+
/**
|
|
3453
|
+
* Relative path from package root for one flat template.
|
|
3454
|
+
* Example: `templates/skills/ark-place.md`
|
|
3455
|
+
*/
|
|
3456
|
+
declare function flatSkillTemplateFileRelativePath(skillName: string): string;
|
|
3457
|
+
|
|
3458
|
+
export { ADAPTER_DIAGNOSTIC_DOCS_RELATIVE_PATH, AGENT_PROJECTION_BEGIN_MARKER, AGENT_PROJECTION_END_MARKER, AGENT_PROJECTION_ENFORCEMENT_SURFACES, AGENT_PROJECTION_NON_ENFORCEMENT_LABEL, AGENT_SKILLS_PACKAGE_RELATIVE_ROOT, AGENT_SKILL_ENTRY_FILENAME, type AICodeGate, type AICodeGateContext, type AICodeGateOptions, type AICodeGateResult, type AICodeGateViolation, type AIGateExtension, ANALYSIS_IR_SCHEMA_VERSION, ARK_AGENT_PROJECTION_SCHEMA_VERSION, ARK_AGENT_SKILLS_PACKAGE_SCHEMA_VERSION, ARK_ANALYSIS_RESULT_SCHEMA, ARK_ANALYSIS_RESULT_SCHEMA_VERSION, ARK_CONFIG_SCHEMA, ARK_CONFIG_SCHEMA_VERSION, ARK_DESIGN_DELTA_SCHEMA_VERSION, ARK_ENFORCEMENT_STATE_SCHEMA_VERSION, ARK_PROJECT_IDENTITY_SCHEMA, ARK_PROJECT_IDENTITY_SCHEMA_URL, ARK_PROJECT_IDENTITY_SCHEMA_VERSION, ARK_RULES_SCHEMA, ARK_RULES_SCHEMA_VERSION, ARK_RULE_SENSORS, ARK_SKILL_NAMES, ARK_SKILL_NAME_COUNT, ARK_STATUS_MANIFEST_SCHEMA, ARK_STATUS_MANIFEST_SCHEMA_URL, ARK_STATUS_MANIFEST_SCHEMA_VERSION, type AdapterCompletenessReason, type AdapterDiagnostic, type AdapterResult, type AdapterSeverity, type AdapterViolationInput, type AgentProjectionCatalogEntry, type AgentProjectionFacts, type AgentProjectionLayerSummary, type AgentProjectionMergeAction, type AgentProjectionMergeResult, type AgentProjectionMeta, type AgentProjectionProfile, type AgentSkillPackageEntry, type AgentSkillValidationIssue, type AnalysisCapabilityUse, type AnalysisCompilerOptions, type AnalysisCompleteness, type AnalysisContract, type AnalysisEvidence, type AnalysisFile, type AnalysisFileChange, type AnalysisFileInput, type AnalysisImportEdge, type AnalysisIr, type AnalysisMode, type AnalysisResult, type AnalysisViolation, type AnalyzeArchitectureConvergenceInput, type AnalyzeChangeInput, type AnalyzePolicyDeltaInput, type AnalyzeProjectInput, type AnalyzeResolvedProjectInput, type ArchitectureActualChange, type ArchitectureChangeMap, type ArchitectureChangeMapContract, type ArchitectureChangeMapDependency, type ArchitectureChangeMapFile, type ArchitectureChangeOperation, type ArchitectureConvergenceClassification, type ArchitectureConvergenceFinding, type ArchitectureConvergenceResult, type ArchitectureDependency, type ArchitectureEngineEdge, type ArchitectureEngineResult, type ArchitectureEngineViolation, type ArchitectureLayer, type ArchitectureLayerConfig, type ArchitectureProfile, type ArchitectureRule, type ArkCheckConfig, ArkConfig, ArkConfigLoadResult, type ArkDesignDeltaResult, type ArkEnforcementHost, type ArkEnforcementState, type ArkRuleSensorViolation, type ArkRulesFile, type ArkSkillName, type ChangePreflightResult, type ClassShapeFact, type CollectAnalysisConfigWarningsInput, type CreateArchitectureProfileFromArkConfigOptions, type CreateArchitectureProfileOptions, type CreateElevenLayerArkConfigOptions, DEFAULT_AGENT_PROJECTION_RULE_IDS, DIAGNOSTIC_CATALOG, DIAGNOSTIC_CATALOG_SCHEMA_VERSION, DIAGNOSTIC_DOCS_RELATIVE_PATH, DIAGNOSTIC_RULE_IDS, type DesignDeltaChange, type DesignDeltaIdentity, type DesignSmellEvidence, type DesignSmellFinding, type DesignSmellId, type DiagnosticCatalogEntry, type DiagnosticCategory, type EffectiveArkRules, type EffectiveContract, EffectiveContractError, type EffectiveContractWarning, type EnforcementBoundaryState, type EnforcementEvidence, type EnforcementEvidenceField, type EnforcementVerification, type EvaluateArchitectureGraphInput, FLAT_SKILL_TEMPLATES_RELATIVE_ROOT, type ForbiddenCapabilityUse, type InvariantCoverageEvidence, POLICY_DELTA_SCHEMA_VERSION, PROJECT_BINDING_SCHEMA, PROJECT_EXPECTATION_SCHEMA, type ParseSkillDocumentResult, type ParsedSkillFrontmatter, type PolicyDelta, type PolicyDeltaAcknowledgement, type PolicyDeltaAnalysis, type PolicyDeltaClassification, type PolicyDeltaFinding, type PreflightResolvedChangeInput, type PreparedChangeFile, type ProjectBinding, type ProjectExpectation, type ProjectIdentity, RESOLVED_CANDIDATE_FACTS_SCHEMA, RESOLVED_CANDIDATE_FACTS_SCHEMA_VERSION, type ResolvedAmbientFact, type ResolvedAnalysisFile, type ResolvedAnalysisIr, type ResolvedAnalysisResult, type ResolvedCandidateFacts, type ResolvedCandidateFactsInput, type ResolvedCapability, type ResolvedCapabilityFact, type ResolvedChangePreflightResult, type ResolvedDependencyFact, type ResolvedDependencyKind, type ResolvedDependencyState, type ResolvedFactsCompleteness, type ResolvedFactsReason, type ResolvedFileFact, type ResolvedIntentReferenceFact, type ResolvedPublishFact, type ResolvedSafetyFact, type ResolvedSafetyKind, type ResolvedSafetyReport, type RulesInventoryCandidate, type RulesInventoryResult, type SemanticDependency, type SemanticDependencyKind, type StatusActivationSlice, type StatusCheckVerdict, type StatusLastCheckSlice, type StatusManifest, type StatusManifestFacts, type StatusNextAction, type StatusProjectIdentitySlice, type StatusRulesSlice, type StatusWritePathClass, type ValidateAgentSkillDocumentInput, type ValidateAgentSkillsPackageResult, adapterDocsCodePath, adapterFindingOccurrenceTargetKeys, adapterFindingRefFromTargetKey, adapterFindingTargetKey, agentProjectionContentIdentity, agentSkillEntryRelativePath, agentSkillPackageFileRelativePath, analyzeArchitectureConvergence, analyzeChange, analyzePolicyDelta, analyzeProject, analyzeResolvedProject, buildAgentProjectionBeginMarker, buildAgentProjectionBlock, buildAgentProjectionBody, buildAgentProjectionMeta, buildArkRuleFileHints, buildEffectiveArkRules, buildRulesInventory, buildStatusManifest, canPromoteInvariant, catalogFixForRuleId, catalogWhyForRuleId, classifyArkPolicyDelta, classifyStatusWritePath, collectAnalysisConfigWarnings, collectEmptyAppliesToFindings, collectForbiddenCapabilityUses, createAICodeGate, createAdapterResult, createArchitectureProfile, createArchitectureProfileFromArkConfig, createElevenLayerArkConfig, createProjectId, createProjectIdentity, createResolvedCandidateFacts, defaultHonestLabel, deriveArkRuleFileHints, detectArchitectureCycles, deterministicHash, diagnosticDocsFragment, diagnosticDocsPath, effectiveContractPolicyPayload, elevenLayerProfile, emptyEffectiveArkRules, evaluateArchitectureGraph, evaluateArkRuleSensors, evaluateInvariantCoverage, evaluateStatusBinding, explainViolation, extractAgentProjectionBlock, extractClassShapesFromSource, extractSemanticDependencies, flatSkillTemplateFileRelativePath, formatAgentProjectionCatalogShortList, formatAgentProjectionLayers, getDiagnosticCatalogEntry, inventoryToExtractionCard, isArkSkillName, isCataloguedOrArkRuleFamily, isKnownDiagnosticCode, isValidAgentSkillName, loadArkConfigContract, loadArkRulesContract, loadContract, loadResolvedCandidateFacts, mergeAgentProjectionDocument, normalizeSkillContent, parseAgentProjectionStamp, parseArkConfigJson, parseArkRulesJson, parseSkillDocument, policyDeltaAcknowledgementMatches, preflightChange, preflightResolvedChange, projectionHasNonEnforcementLabel, projectionMatchesPackageVersion, resolveEffectiveContract, resolveStatusNextAction, resolvedFactsEvidenceRequirementsHash, serializeDiagnosticCatalog, stableSerialize, toAdapterDiagnostic, validateAgentSkillDocument, validateAgentSkillsPackage, version };
|