@neurcode-ai/contracts 0.2.3 → 0.2.5

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.
Files changed (34) hide show
  1. package/LICENSE +201 -0
  2. package/dist/index.d.ts +6 -0
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +6 -0
  5. package/dist/index.js.map +1 -1
  6. package/dist/integrations-compatibility-v1.d.ts +106 -0
  7. package/dist/integrations-compatibility-v1.d.ts.map +1 -0
  8. package/dist/integrations-compatibility-v1.js +24 -0
  9. package/dist/integrations-compatibility-v1.js.map +1 -0
  10. package/dist/manager-evidence/index.d.ts +131 -0
  11. package/dist/manager-evidence/index.d.ts.map +1 -0
  12. package/dist/manager-evidence/index.js +97 -0
  13. package/dist/manager-evidence/index.js.map +1 -0
  14. package/dist/pilot-funnel/index.d.ts +96 -0
  15. package/dist/pilot-funnel/index.d.ts.map +1 -0
  16. package/dist/pilot-funnel/index.js +227 -0
  17. package/dist/pilot-funnel/index.js.map +1 -0
  18. package/dist/pilot-setup/index.d.ts +56 -0
  19. package/dist/pilot-setup/index.d.ts.map +1 -0
  20. package/dist/pilot-setup/index.js +19 -0
  21. package/dist/pilot-setup/index.js.map +1 -0
  22. package/dist/repo-intelligence-v2.d.ts +57 -0
  23. package/dist/repo-intelligence-v2.d.ts.map +1 -1
  24. package/dist/repo-intelligence-v2.js +2 -1
  25. package/dist/repo-intelligence-v2.js.map +1 -1
  26. package/dist/runtime-policy-config.d.ts +99 -0
  27. package/dist/runtime-policy-config.d.ts.map +1 -0
  28. package/dist/runtime-policy-config.js +264 -0
  29. package/dist/runtime-policy-config.js.map +1 -0
  30. package/dist/runtime-risk-pack-v1.d.ts +138 -0
  31. package/dist/runtime-risk-pack-v1.d.ts.map +1 -0
  32. package/dist/runtime-risk-pack-v1.js +46 -0
  33. package/dist/runtime-risk-pack-v1.js.map +1 -0
  34. package/package.json +7 -8
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Runtime Risk Pack Report (Iteration 11 — AppSec-Adjacent Runtime Risk Pack).
3
+ *
4
+ * Neurcode is a runtime control plane for AI coding agents — a seatbelt and
5
+ * flight recorder. It is NOT an AppSec scanner, SAST engine, CVE/vulnerability
6
+ * database, or code-review bot. This report states, in one honest source-free
7
+ * surface, which AppSec-adjacent *runtime* boundaries the agent must obey
8
+ * BEFORE a write lands — and exactly what enforcement each one carries.
9
+ *
10
+ * The enforcement is NOT authored here. The CLI builder
11
+ * (`packages/cli/src/utils/runtime-risk-pack.ts`) derives every category's
12
+ * `family`, `enforcementAction`, `truthTier`, and `reasonIds` by running the
13
+ * canonical Runtime Safety Kernel classifiers (`evaluateRuntimeSafetyCheck`
14
+ * over representative fixture paths) — it never re-implements classify logic and
15
+ * never introduces a second taxonomy. The `family` type is the same
16
+ * {@link ManagerEvidenceRiskFamily} the kernel and manager-evidence dashboard
17
+ * use, so no new RuntimeSafetyFamily can drift in.
18
+ *
19
+ * Source-free by construction: category ids, buyer-facing labels, kernel reason
20
+ * codes, families, enforcement-action strings, truth tiers, counts, and
21
+ * representative *fixture* paths (synthetic, not repository source paths) —
22
+ * never source bodies, diffs, prompts, secrets, or CVE text.
23
+ */
24
+ import type { ManagerEvidenceRiskFamily } from './manager-evidence';
25
+ export declare const RUNTIME_RISK_PACK_SCHEMA_VERSION: "neurcode.runtime-risk-pack.v1";
26
+ /** The eight AppSec-adjacent runtime-risk categories on the Iteration 11 roadmap. */
27
+ export declare const RUNTIME_RISK_CATEGORY_IDS: readonly ["dependency_manifest_change", "script_lifecycle_risk", "secret_like_content", "auth_rbac_edit", "crypto_session_edit", "migration_edit", "network_boundary_edit", "ci_cd_edit"];
28
+ export type RuntimeRiskCategoryId = (typeof RUNTIME_RISK_CATEGORY_IDS)[number];
29
+ export declare function isRuntimeRiskCategoryId(value: unknown): value is RuntimeRiskCategoryId;
30
+ /** Enforcement vocabulary — mirrors the kernel `RuntimeSafetyEnforcementAction`. */
31
+ export type RuntimeRiskEnforcementAction = 'allow' | 'warn' | 'approval_required' | 'block';
32
+ /** Truth tier — mirrors the kernel `RuntimeSafetyTruthTier` (RSK truth tiers). */
33
+ export type RuntimeRiskTruthTier = 'deterministic_fact' | 'bounded_inference' | 'advisory';
34
+ /**
35
+ * How completely the kernel covers a category today.
36
+ * - `enforced` — a deterministic kernel rule governs this surface.
37
+ * - `enforced_partial`— governed, but with an honest, named coverage gap
38
+ * (e.g. CI/CD is GitHub-Actions-only; other CI systems are not yet matched).
39
+ */
40
+ export type RuntimeRiskCoverage = 'enforced' | 'enforced_partial';
41
+ export interface RuntimeRiskCategory {
42
+ id: RuntimeRiskCategoryId;
43
+ /** Buyer-facing label. */
44
+ label: string;
45
+ /** Verbatim roadmap bullet this category answers. */
46
+ roadmapBullet: string;
47
+ /**
48
+ * The existing kernel family this category maps to. No Iteration 11 category
49
+ * introduces a new family — network folds into `infra_deploy_boundary`,
50
+ * crypto/session into `auth_rbac_boundary` / `credential_or_secret`.
51
+ */
52
+ family: ManagerEvidenceRiskFamily;
53
+ /**
54
+ * Optional doctor-only sub-label that gives buyers precision without a new
55
+ * top-level family (e.g. `network_boundary`, `crypto_session`).
56
+ */
57
+ subLabel: string | null;
58
+ /**
59
+ * Default enforcement action under ENTERPRISE_RUNTIME_SAFETY_V1 for a
60
+ * representative surface — copied from the kernel decision, never re-authored.
61
+ */
62
+ enforcementAction: RuntimeRiskEnforcementAction;
63
+ truthTier: RuntimeRiskTruthTier;
64
+ coverage: RuntimeRiskCoverage;
65
+ /** Kernel reason codes that backed the representative classification. */
66
+ reasonIds: string[];
67
+ /** Representative source-free fixture paths showing the classifier fires. */
68
+ sampleSurfaces: string[];
69
+ /** Honest scope notes / known coverage gaps. */
70
+ limitations: string[];
71
+ }
72
+ /** External AppSec finding sources we may ingest as advisory context later. */
73
+ export declare const RUNTIME_RISK_ADVISORY_SOURCES: readonly ["endor", "snyk", "github_advanced_security"];
74
+ export type RuntimeRiskAdvisorySource = (typeof RUNTIME_RISK_ADVISORY_SOURCES)[number];
75
+ /**
76
+ * Shape a future advisory finding would take once import is wired. Findings are
77
+ * advisory context only — never enforcement, never a CVE claim Neurcode makes.
78
+ */
79
+ export interface RuntimeRiskAdvisoryFinding {
80
+ source: RuntimeRiskAdvisorySource;
81
+ /** Repo-relative path the external tool flagged (no source body). */
82
+ path: string;
83
+ /** External tool's own severity label, passed through verbatim. */
84
+ externalSeverity: string;
85
+ /** Mapped kernel family for cross-referencing — advisory only. */
86
+ family: ManagerEvidenceRiskFamily | null;
87
+ truthTier: 'advisory';
88
+ }
89
+ export type RuntimeRiskAdvisoryStatus = 'not_wired';
90
+ export interface RuntimeRiskAdvisoryImport {
91
+ source: RuntimeRiskAdvisorySource;
92
+ status: RuntimeRiskAdvisoryStatus;
93
+ /** Always empty in V1 — ingest is deferred to a later iteration. */
94
+ findings: RuntimeRiskAdvisoryFinding[];
95
+ note: string;
96
+ }
97
+ /**
98
+ * The pilot evidence pack (`pilot export`) buckets surfaces with its own coarse
99
+ * keyword classifier. That taxonomy is intentionally left unchanged (it has a
100
+ * stable content hash). This map documents how a kernel family is reported there
101
+ * so the two surfaces are legible together — it does NOT re-author either side.
102
+ */
103
+ export interface RuntimeRiskTaxonomyMapping {
104
+ kernelFamily: ManagerEvidenceRiskFamily;
105
+ pilotEvidenceFamilies: string[];
106
+ note: string;
107
+ }
108
+ export interface RuntimeRiskAppSecPositioning {
109
+ /** The Iteration 11 exit-criterion sentence. */
110
+ statement: string;
111
+ /** What the runtime risk pack does. */
112
+ weDo: string[];
113
+ /** What it explicitly does NOT do (no scanner / SAST / CVE / review-bot). */
114
+ weDoNot: string[];
115
+ }
116
+ export interface RuntimeRiskPackReport {
117
+ schemaVersion: typeof RUNTIME_RISK_PACK_SCHEMA_VERSION;
118
+ generatedAt: string;
119
+ cliVersion: string | null;
120
+ /** The policy profile id whose default actions were resolved. */
121
+ policyId: string;
122
+ /** Plan-control mode the actions were resolved under. */
123
+ planMode: string;
124
+ categories: RuntimeRiskCategory[];
125
+ summary: {
126
+ totalCategories: number;
127
+ enforced: number;
128
+ enforcedPartial: number;
129
+ byAction: Record<RuntimeRiskEnforcementAction, number>;
130
+ /** Distinct kernel families touched (subset of MANAGER_EVIDENCE_RISK_FAMILIES). */
131
+ families: ManagerEvidenceRiskFamily[];
132
+ };
133
+ taxonomyMapping: RuntimeRiskTaxonomyMapping[];
134
+ advisoryImports: RuntimeRiskAdvisoryImport[];
135
+ appSec: RuntimeRiskAppSecPositioning;
136
+ notes: string[];
137
+ }
138
+ //# sourceMappingURL=runtime-risk-pack-v1.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-risk-pack-v1.d.ts","sourceRoot":"","sources":["../src/runtime-risk-pack-v1.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAEpE,eAAO,MAAM,gCAAgC,EAAG,+BAAwC,CAAC;AAEzF,qFAAqF;AACrF,eAAO,MAAM,yBAAyB,2LAS5B,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/E,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,qBAAqB,CAEtF;AAED,oFAAoF;AACpF,MAAM,MAAM,4BAA4B,GAAG,OAAO,GAAG,MAAM,GAAG,mBAAmB,GAAG,OAAO,CAAC;AAE5F,kFAAkF;AAClF,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,GAAG,mBAAmB,GAAG,UAAU,CAAC;AAE3F;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,kBAAkB,CAAC;AAElE,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,qBAAqB,CAAC;IAC1B,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,aAAa,EAAE,MAA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uCAAuC;IACvC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,6EAA6E;IAC7E,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,OAAO,gCAAgC,CAAC;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,yDAAyD;IACzD,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,mBAAmB,EAAE,CAAC;IAClC,OAAO,EAAE;QACP,eAAe,EAAE,MAAM,CAAC;QACxB,QAAQ,EAAE,MAAM,CAAC;QACjB,eAAe,EAAE,MAAM,CAAC;QACxB,QAAQ,EAAE,MAAM,CAAC,4BAA4B,EAAE,MAAM,CAAC,CAAC;QACvD,mFAAmF;QACnF,QAAQ,EAAE,yBAAyB,EAAE,CAAC;KACvC,CAAC;IACF,eAAe,EAAE,0BAA0B,EAAE,CAAC;IAC9C,eAAe,EAAE,yBAAyB,EAAE,CAAC;IAC7C,MAAM,EAAE,4BAA4B,CAAC;IACrC,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ /**
3
+ * Runtime Risk Pack Report (Iteration 11 — AppSec-Adjacent Runtime Risk Pack).
4
+ *
5
+ * Neurcode is a runtime control plane for AI coding agents — a seatbelt and
6
+ * flight recorder. It is NOT an AppSec scanner, SAST engine, CVE/vulnerability
7
+ * database, or code-review bot. This report states, in one honest source-free
8
+ * surface, which AppSec-adjacent *runtime* boundaries the agent must obey
9
+ * BEFORE a write lands — and exactly what enforcement each one carries.
10
+ *
11
+ * The enforcement is NOT authored here. The CLI builder
12
+ * (`packages/cli/src/utils/runtime-risk-pack.ts`) derives every category's
13
+ * `family`, `enforcementAction`, `truthTier`, and `reasonIds` by running the
14
+ * canonical Runtime Safety Kernel classifiers (`evaluateRuntimeSafetyCheck`
15
+ * over representative fixture paths) — it never re-implements classify logic and
16
+ * never introduces a second taxonomy. The `family` type is the same
17
+ * {@link ManagerEvidenceRiskFamily} the kernel and manager-evidence dashboard
18
+ * use, so no new RuntimeSafetyFamily can drift in.
19
+ *
20
+ * Source-free by construction: category ids, buyer-facing labels, kernel reason
21
+ * codes, families, enforcement-action strings, truth tiers, counts, and
22
+ * representative *fixture* paths (synthetic, not repository source paths) —
23
+ * never source bodies, diffs, prompts, secrets, or CVE text.
24
+ */
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.RUNTIME_RISK_ADVISORY_SOURCES = exports.RUNTIME_RISK_CATEGORY_IDS = exports.RUNTIME_RISK_PACK_SCHEMA_VERSION = void 0;
27
+ exports.isRuntimeRiskCategoryId = isRuntimeRiskCategoryId;
28
+ exports.RUNTIME_RISK_PACK_SCHEMA_VERSION = 'neurcode.runtime-risk-pack.v1';
29
+ /** The eight AppSec-adjacent runtime-risk categories on the Iteration 11 roadmap. */
30
+ exports.RUNTIME_RISK_CATEGORY_IDS = [
31
+ 'dependency_manifest_change',
32
+ 'script_lifecycle_risk',
33
+ 'secret_like_content',
34
+ 'auth_rbac_edit',
35
+ 'crypto_session_edit',
36
+ 'migration_edit',
37
+ 'network_boundary_edit',
38
+ 'ci_cd_edit',
39
+ ];
40
+ function isRuntimeRiskCategoryId(value) {
41
+ return typeof value === 'string' && exports.RUNTIME_RISK_CATEGORY_IDS.includes(value);
42
+ }
43
+ /* ── D6: advisory import stub (schema-forward only; no ingest in V1) ────────── */
44
+ /** External AppSec finding sources we may ingest as advisory context later. */
45
+ exports.RUNTIME_RISK_ADVISORY_SOURCES = ['endor', 'snyk', 'github_advanced_security'];
46
+ //# sourceMappingURL=runtime-risk-pack-v1.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-risk-pack-v1.js","sourceRoot":"","sources":["../src/runtime-risk-pack-v1.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;AAoBH,0DAEC;AAlBY,QAAA,gCAAgC,GAAG,+BAAwC,CAAC;AAEzF,qFAAqF;AACxE,QAAA,yBAAyB,GAAG;IACvC,4BAA4B;IAC5B,uBAAuB;IACvB,qBAAqB;IACrB,gBAAgB;IAChB,qBAAqB;IACrB,gBAAgB;IAChB,uBAAuB;IACvB,YAAY;CACJ,CAAC;AAIX,SAAgB,uBAAuB,CAAC,KAAc;IACpD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,iCAA+C,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACvG,CAAC;AAgDD,mFAAmF;AAEnF,+EAA+E;AAClE,QAAA,6BAA6B,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,0BAA0B,CAAU,CAAC"}
package/package.json CHANGED
@@ -1,18 +1,12 @@
1
1
  {
2
2
  "name": "@neurcode-ai/contracts",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Shared JSON contracts for Neurcode CLI, API, action, IDE, and MCP surfaces",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "files": [
8
8
  "dist"
9
9
  ],
10
- "scripts": {
11
- "build": "tsc",
12
- "dev": "tsc --watch",
13
- "test": "tsx --test src/*.test.ts",
14
- "prepare": "npm run build"
15
- },
16
10
  "license": "MIT",
17
11
  "dependencies": {},
18
12
  "publishConfig": {
@@ -22,5 +16,10 @@
22
16
  "@types/node": "^20.10.0",
23
17
  "tsx": "^4.20.6",
24
18
  "typescript": "^5.3.0"
19
+ },
20
+ "scripts": {
21
+ "build": "tsc",
22
+ "dev": "tsc --watch",
23
+ "test": "tsx --test src/*.test.ts"
25
24
  }
26
- }
25
+ }