@neurcode-ai/contracts 0.2.3 → 0.2.4
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/LICENSE +201 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/integrations-compatibility-v1.d.ts +106 -0
- package/dist/integrations-compatibility-v1.d.ts.map +1 -0
- package/dist/integrations-compatibility-v1.js +24 -0
- package/dist/integrations-compatibility-v1.js.map +1 -0
- package/dist/manager-evidence/index.d.ts +131 -0
- package/dist/manager-evidence/index.d.ts.map +1 -0
- package/dist/manager-evidence/index.js +97 -0
- package/dist/manager-evidence/index.js.map +1 -0
- package/dist/pilot-funnel/index.d.ts +96 -0
- package/dist/pilot-funnel/index.d.ts.map +1 -0
- package/dist/pilot-funnel/index.js +227 -0
- package/dist/pilot-funnel/index.js.map +1 -0
- package/dist/pilot-setup/index.d.ts +56 -0
- package/dist/pilot-setup/index.d.ts.map +1 -0
- package/dist/pilot-setup/index.js +19 -0
- package/dist/pilot-setup/index.js.map +1 -0
- package/dist/repo-intelligence-v2.d.ts +57 -0
- package/dist/repo-intelligence-v2.d.ts.map +1 -1
- package/dist/repo-intelligence-v2.js +2 -1
- package/dist/repo-intelligence-v2.js.map +1 -1
- package/dist/runtime-risk-pack-v1.d.ts +138 -0
- package/dist/runtime-risk-pack-v1.d.ts.map +1 -0
- package/dist/runtime-risk-pack-v1.js +46 -0
- package/dist/runtime-risk-pack-v1.js.map +1 -0
- package/package.json +7 -8
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Manager Evidence Dashboard - source-free aggregate contract.
|
|
4
|
+
*
|
|
5
|
+
* Org-scoped rollup of runtime governance value for engineering managers.
|
|
6
|
+
* Only paths, owners, hashes, counts, reason codes, verdicts, timestamps, and
|
|
7
|
+
* tenant ids are permitted. No source, prompts, diffs, secrets, or raw user
|
|
8
|
+
* identities. Actor identifiers are always hashed/prefix form.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.MANAGER_EVIDENCE_ALLOWED_FIELDS = exports.MANAGER_EVIDENCE_RISK_FAMILIES = exports.MANAGER_EVIDENCE_SUMMARY_SCHEMA_VERSION = void 0;
|
|
12
|
+
exports.isManagerEvidenceRiskFamily = isManagerEvidenceRiskFamily;
|
|
13
|
+
exports.MANAGER_EVIDENCE_SUMMARY_SCHEMA_VERSION = 'neurcode.manager-evidence-summary.v1';
|
|
14
|
+
/**
|
|
15
|
+
* Risk families surfaced to managers. Mirrors `RuntimeSafetyFamily` in
|
|
16
|
+
* `@neurcode-ai/governance-runtime`; kept as a local copy so `contracts`
|
|
17
|
+
* remains a dependency-free leaf package. Keep in sync if the kernel families
|
|
18
|
+
* change.
|
|
19
|
+
*/
|
|
20
|
+
exports.MANAGER_EVIDENCE_RISK_FAMILIES = [
|
|
21
|
+
'runtime_scope',
|
|
22
|
+
'sensitive_surface',
|
|
23
|
+
'credential_or_secret',
|
|
24
|
+
'dependency_supply_chain',
|
|
25
|
+
'auth_rbac_boundary',
|
|
26
|
+
'migration_data_boundary',
|
|
27
|
+
'infra_deploy_boundary',
|
|
28
|
+
'test_or_verification_gap',
|
|
29
|
+
'plan_drift',
|
|
30
|
+
'approval_required_boundary',
|
|
31
|
+
];
|
|
32
|
+
function isManagerEvidenceRiskFamily(value) {
|
|
33
|
+
return (typeof value === 'string' &&
|
|
34
|
+
exports.MANAGER_EVIDENCE_RISK_FAMILIES.includes(value));
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Source-free allowlist of field names that may appear in any manager-evidence
|
|
38
|
+
* payload. Used by the authority harness / leak scan to assert no source-like
|
|
39
|
+
* keys leak into the aggregate.
|
|
40
|
+
*/
|
|
41
|
+
exports.MANAGER_EVIDENCE_ALLOWED_FIELDS = [
|
|
42
|
+
'schemaVersion',
|
|
43
|
+
'generatedAt',
|
|
44
|
+
'organizationId',
|
|
45
|
+
'tier',
|
|
46
|
+
'window',
|
|
47
|
+
'since',
|
|
48
|
+
'until',
|
|
49
|
+
'appliedFilters',
|
|
50
|
+
'available',
|
|
51
|
+
'reason',
|
|
52
|
+
'repoKey',
|
|
53
|
+
'riskFamily',
|
|
54
|
+
'actor',
|
|
55
|
+
'team',
|
|
56
|
+
'scope',
|
|
57
|
+
'repos',
|
|
58
|
+
'sessions',
|
|
59
|
+
'activeSessions',
|
|
60
|
+
'finishedSessions',
|
|
61
|
+
'owners',
|
|
62
|
+
'attempts',
|
|
63
|
+
'totalChecks',
|
|
64
|
+
'allowedEdits',
|
|
65
|
+
'allowedWithAdvisories',
|
|
66
|
+
'blocked',
|
|
67
|
+
'total',
|
|
68
|
+
'byFamily',
|
|
69
|
+
'family',
|
|
70
|
+
'count',
|
|
71
|
+
'topPaths',
|
|
72
|
+
'path',
|
|
73
|
+
'topOwners',
|
|
74
|
+
'owner',
|
|
75
|
+
'approvals',
|
|
76
|
+
'granted',
|
|
77
|
+
'boundariesTouched',
|
|
78
|
+
'boundary',
|
|
79
|
+
'planDrift',
|
|
80
|
+
'sessionsWithDrift',
|
|
81
|
+
'dependencyChanges',
|
|
82
|
+
'governed',
|
|
83
|
+
'byKind',
|
|
84
|
+
'kind',
|
|
85
|
+
'credentialBlocksLocal',
|
|
86
|
+
'note',
|
|
87
|
+
'neighborContainment',
|
|
88
|
+
'sessionsWithContainedDenials',
|
|
89
|
+
'byRepo',
|
|
90
|
+
'sourceFree',
|
|
91
|
+
'sourceUploaded',
|
|
92
|
+
'localOnly',
|
|
93
|
+
'synced',
|
|
94
|
+
'privacy',
|
|
95
|
+
'uploadedFields',
|
|
96
|
+
];
|
|
97
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/manager-evidence/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AA0BH,kEAKC;AA7BY,QAAA,uCAAuC,GAClD,sCAA+C,CAAC;AAElD;;;;;GAKG;AACU,QAAA,8BAA8B,GAAG;IAC5C,eAAe;IACf,mBAAmB;IACnB,sBAAsB;IACtB,yBAAyB;IACzB,oBAAoB;IACpB,yBAAyB;IACzB,uBAAuB;IACvB,0BAA0B;IAC1B,YAAY;IACZ,4BAA4B;CACpB,CAAC;AAIX,SAAgB,2BAA2B,CAAC,KAAc;IACxD,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACxB,sCAAoD,CAAC,QAAQ,CAAC,KAAK,CAAC,CACtE,CAAC;AACJ,CAAC;AASD;;;;GAIG;AACU,QAAA,+BAA+B,GAAG;IAC7C,eAAe;IACf,aAAa;IACb,gBAAgB;IAChB,MAAM;IACN,QAAQ;IACR,OAAO;IACP,OAAO;IACP,gBAAgB;IAChB,WAAW;IACX,QAAQ;IACR,SAAS;IACT,YAAY;IACZ,OAAO;IACP,MAAM;IACN,OAAO;IACP,OAAO;IACP,UAAU;IACV,gBAAgB;IAChB,kBAAkB;IAClB,QAAQ;IACR,UAAU;IACV,aAAa;IACb,cAAc;IACd,uBAAuB;IACvB,SAAS;IACT,OAAO;IACP,UAAU;IACV,QAAQ;IACR,OAAO;IACP,UAAU;IACV,MAAM;IACN,WAAW;IACX,OAAO;IACP,WAAW;IACX,SAAS;IACT,mBAAmB;IACnB,UAAU;IACV,WAAW;IACX,mBAAmB;IACnB,mBAAmB;IACnB,UAAU;IACV,QAAQ;IACR,MAAM;IACN,uBAAuB;IACvB,MAAM;IACN,qBAAqB;IACrB,8BAA8B;IAC9B,QAAQ;IACR,YAAY;IACZ,gBAAgB;IAChB,WAAW;IACX,QAAQ;IACR,SAAS;IACT,gBAAgB;CACR,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Self-Serve Pilot Operating System — source-free funnel contract.
|
|
3
|
+
*
|
|
4
|
+
* Machine-readable milestone model for signup → governed value → manager review.
|
|
5
|
+
* No hardcoded repository paths, languages, teams, or billing directories.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PILOT_FUNNEL_SCHEMA_VERSION: "neurcode.pilot-funnel.v1";
|
|
8
|
+
/** Privacy-safe activation milestones tracked across dashboard, API, and CLI. */
|
|
9
|
+
export declare const PILOT_ACTIVATION_MILESTONES: readonly ["signup_completed", "workspace_selected", "organization_created", "organization_joined", "repository_connected", "cli_authenticated", "brain_not_started", "brain_discovering", "brain_parsing", "brain_indexing", "brain_ready", "brain_partial", "brain_stale", "brain_corrupt", "brain_canceled", "brain_failed", "agent_configured", "governed_session_started", "first_block_observed", "first_exact_approval", "first_completed_ai_change_record", "teammate_invited", "seven_day_return"];
|
|
10
|
+
export type PilotActivationMilestone = (typeof PILOT_ACTIVATION_MILESTONES)[number];
|
|
11
|
+
/** Ordered funnel stages a first-time user traverses. */
|
|
12
|
+
export declare const PILOT_FUNNEL_STAGES: readonly [{
|
|
13
|
+
readonly id: "account";
|
|
14
|
+
readonly label: "Account";
|
|
15
|
+
readonly milestones: readonly ["signup_completed"];
|
|
16
|
+
readonly nextAction: "Choose personal workspace or create/join an organization.";
|
|
17
|
+
}, {
|
|
18
|
+
readonly id: "workspace";
|
|
19
|
+
readonly label: "Workspace";
|
|
20
|
+
readonly milestones: readonly ["workspace_selected", "organization_created", "organization_joined"];
|
|
21
|
+
readonly nextAction: "Connect a repository and select your AI agent.";
|
|
22
|
+
}, {
|
|
23
|
+
readonly id: "repository";
|
|
24
|
+
readonly label: "Repository & agent";
|
|
25
|
+
readonly milestones: readonly ["repository_connected", "cli_authenticated", "agent_configured"];
|
|
26
|
+
readonly nextAction: "Index repository Brain and start a governed session.";
|
|
27
|
+
}, {
|
|
28
|
+
readonly id: "brain";
|
|
29
|
+
readonly label: "Repository Brain";
|
|
30
|
+
readonly milestones: readonly ["brain_not_started", "brain_discovering", "brain_parsing", "brain_indexing", "brain_ready", "brain_partial", "brain_stale", "brain_corrupt", "brain_canceled", "brain_failed"];
|
|
31
|
+
readonly nextAction: "Run the repository-native evaluation to prove governed value.";
|
|
32
|
+
}, {
|
|
33
|
+
readonly id: "governance";
|
|
34
|
+
readonly label: "Governed value";
|
|
35
|
+
readonly milestones: readonly ["governed_session_started", "first_block_observed", "first_exact_approval", "first_completed_ai_change_record"];
|
|
36
|
+
readonly nextAction: "Review evidence in the manager dashboard or invite a teammate.";
|
|
37
|
+
}, {
|
|
38
|
+
readonly id: "team";
|
|
39
|
+
readonly label: "Team & retention";
|
|
40
|
+
readonly milestones: readonly ["teammate_invited", "seven_day_return"];
|
|
41
|
+
readonly nextAction: "Continue pilot rollout across repositories.";
|
|
42
|
+
}];
|
|
43
|
+
export type PilotFunnelStageId = (typeof PILOT_FUNNEL_STAGES)[number]['id'];
|
|
44
|
+
/** Brain lifecycle states exposed to operators (maps CLI brain-lifecycle.v2). */
|
|
45
|
+
export declare const PILOT_BRAIN_STATES: readonly ["not_started", "discovering", "parsing", "indexing", "ready", "partial", "stale", "corrupt", "canceled", "failed"];
|
|
46
|
+
export type PilotBrainState = (typeof PILOT_BRAIN_STATES)[number];
|
|
47
|
+
/** Map CLI brain-lifecycle state to pilot Brain state vocabulary. */
|
|
48
|
+
export declare function mapBrainLifecycleToPilotState(input: {
|
|
49
|
+
lifecycleState?: string | null;
|
|
50
|
+
progressPhase?: string | null;
|
|
51
|
+
}): PilotBrainState;
|
|
52
|
+
export declare function brainStateToMilestone(state: PilotBrainState): PilotActivationMilestone;
|
|
53
|
+
export type PilotEnforcementPosture = 'hard_pre_write_deny' | 'cooperative_supervision' | 'post_pr_advisory' | 'unsupported';
|
|
54
|
+
export interface PilotHostCapability {
|
|
55
|
+
agent: string;
|
|
56
|
+
enforcementPosture: PilotEnforcementPosture;
|
|
57
|
+
automatic: boolean;
|
|
58
|
+
description: string;
|
|
59
|
+
}
|
|
60
|
+
export interface PilotFunnelStageProgress {
|
|
61
|
+
stageId: PilotFunnelStageId;
|
|
62
|
+
label: string;
|
|
63
|
+
complete: boolean;
|
|
64
|
+
currentMilestone: PilotActivationMilestone | null;
|
|
65
|
+
nextAction: string;
|
|
66
|
+
}
|
|
67
|
+
export interface PilotFunnelState {
|
|
68
|
+
schemaVersion: typeof PILOT_FUNNEL_SCHEMA_VERSION;
|
|
69
|
+
organizationId: string;
|
|
70
|
+
userIdPrefix: string;
|
|
71
|
+
completedMilestones: PilotActivationMilestone[];
|
|
72
|
+
currentStage: PilotFunnelStageId;
|
|
73
|
+
stages: PilotFunnelStageProgress[];
|
|
74
|
+
progressPercent: number;
|
|
75
|
+
failureReasonCodes: string[];
|
|
76
|
+
updatedAt: string;
|
|
77
|
+
}
|
|
78
|
+
export interface PilotRecoveryAction {
|
|
79
|
+
code: string;
|
|
80
|
+
label: string;
|
|
81
|
+
command: string;
|
|
82
|
+
safeLocalSource: boolean;
|
|
83
|
+
}
|
|
84
|
+
export interface PilotFailureRecovery {
|
|
85
|
+
whatFailed: string;
|
|
86
|
+
reasonCode: string;
|
|
87
|
+
safeLocalSource: boolean;
|
|
88
|
+
recommendedAction: PilotRecoveryAction;
|
|
89
|
+
diagnosticExportCommand: string;
|
|
90
|
+
}
|
|
91
|
+
/** Source-free fields allowed in activation analytics payloads. */
|
|
92
|
+
export declare const PILOT_ANALYTICS_ALLOWED_FIELDS: readonly ["milestone", "reasonCode", "stageId", "agent", "enforcementPosture", "brainState", "workspaceKind", "durationMs", "attempt"];
|
|
93
|
+
export declare function isPilotActivationMilestone(value: unknown): value is PilotActivationMilestone;
|
|
94
|
+
export declare function resolveCurrentFunnelStage(completed: ReadonlySet<PilotActivationMilestone>): PilotFunnelStageId;
|
|
95
|
+
export declare function buildFunnelStageProgress(completed: ReadonlySet<PilotActivationMilestone>): PilotFunnelStageProgress[];
|
|
96
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pilot-funnel/index.ts"],"names":[],"m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;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,OAAO,2BAA2B,CAAC;IAClD,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,wBAAwB,EAAE,CAAC;IAChD,YAAY,EAAE,kBAAkB,CAAC;IACjC,MAAM,EAAE,wBAAwB,EAAE,CAAC;IACnC,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,OAAO,CAAC;IACzB,iBAAiB,EAAE,mBAAmB,CAAC;IACvC,uBAAuB,EAAE,MAAM,CAAC;CACjC;AAED,mEAAmE;AACnE,eAAO,MAAM,8BAA8B,wIAUjC,CAAC;AAEX,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,wBAAwB,CAE5F;AAED,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,WAAW,CAAC,wBAAwB,CAAC,GAC/C,kBAAkB,CAwBpB;AAED,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,WAAW,CAAC,wBAAwB,CAAC,GAC/C,wBAAwB,EAAE,CAuB5B"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Self-Serve Pilot Operating System — source-free funnel contract.
|
|
4
|
+
*
|
|
5
|
+
* Machine-readable milestone model for signup → governed value → manager review.
|
|
6
|
+
* No hardcoded repository paths, languages, teams, or billing directories.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.PILOT_ANALYTICS_ALLOWED_FIELDS = exports.PILOT_BRAIN_STATES = exports.PILOT_FUNNEL_STAGES = exports.PILOT_ACTIVATION_MILESTONES = exports.PILOT_FUNNEL_SCHEMA_VERSION = void 0;
|
|
10
|
+
exports.mapBrainLifecycleToPilotState = mapBrainLifecycleToPilotState;
|
|
11
|
+
exports.brainStateToMilestone = brainStateToMilestone;
|
|
12
|
+
exports.isPilotActivationMilestone = isPilotActivationMilestone;
|
|
13
|
+
exports.resolveCurrentFunnelStage = resolveCurrentFunnelStage;
|
|
14
|
+
exports.buildFunnelStageProgress = buildFunnelStageProgress;
|
|
15
|
+
exports.PILOT_FUNNEL_SCHEMA_VERSION = 'neurcode.pilot-funnel.v1';
|
|
16
|
+
/** Privacy-safe activation milestones tracked across dashboard, API, and CLI. */
|
|
17
|
+
exports.PILOT_ACTIVATION_MILESTONES = [
|
|
18
|
+
'signup_completed',
|
|
19
|
+
'workspace_selected',
|
|
20
|
+
'organization_created',
|
|
21
|
+
'organization_joined',
|
|
22
|
+
'repository_connected',
|
|
23
|
+
'cli_authenticated',
|
|
24
|
+
'brain_not_started',
|
|
25
|
+
'brain_discovering',
|
|
26
|
+
'brain_parsing',
|
|
27
|
+
'brain_indexing',
|
|
28
|
+
'brain_ready',
|
|
29
|
+
'brain_partial',
|
|
30
|
+
'brain_stale',
|
|
31
|
+
'brain_corrupt',
|
|
32
|
+
'brain_canceled',
|
|
33
|
+
'brain_failed',
|
|
34
|
+
'agent_configured',
|
|
35
|
+
'governed_session_started',
|
|
36
|
+
'first_block_observed',
|
|
37
|
+
'first_exact_approval',
|
|
38
|
+
'first_completed_ai_change_record',
|
|
39
|
+
'teammate_invited',
|
|
40
|
+
'seven_day_return',
|
|
41
|
+
];
|
|
42
|
+
/** Ordered funnel stages a first-time user traverses. */
|
|
43
|
+
exports.PILOT_FUNNEL_STAGES = [
|
|
44
|
+
{
|
|
45
|
+
id: 'account',
|
|
46
|
+
label: 'Account',
|
|
47
|
+
milestones: ['signup_completed'],
|
|
48
|
+
nextAction: 'Choose personal workspace or create/join an organization.',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: 'workspace',
|
|
52
|
+
label: 'Workspace',
|
|
53
|
+
milestones: ['workspace_selected', 'organization_created', 'organization_joined'],
|
|
54
|
+
nextAction: 'Connect a repository and select your AI agent.',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: 'repository',
|
|
58
|
+
label: 'Repository & agent',
|
|
59
|
+
milestones: ['repository_connected', 'cli_authenticated', 'agent_configured'],
|
|
60
|
+
nextAction: 'Index repository Brain and start a governed session.',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: 'brain',
|
|
64
|
+
label: 'Repository Brain',
|
|
65
|
+
milestones: [
|
|
66
|
+
'brain_not_started',
|
|
67
|
+
'brain_discovering',
|
|
68
|
+
'brain_parsing',
|
|
69
|
+
'brain_indexing',
|
|
70
|
+
'brain_ready',
|
|
71
|
+
'brain_partial',
|
|
72
|
+
'brain_stale',
|
|
73
|
+
'brain_corrupt',
|
|
74
|
+
'brain_canceled',
|
|
75
|
+
'brain_failed',
|
|
76
|
+
],
|
|
77
|
+
nextAction: 'Run the repository-native evaluation to prove governed value.',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 'governance',
|
|
81
|
+
label: 'Governed value',
|
|
82
|
+
milestones: [
|
|
83
|
+
'governed_session_started',
|
|
84
|
+
'first_block_observed',
|
|
85
|
+
'first_exact_approval',
|
|
86
|
+
'first_completed_ai_change_record',
|
|
87
|
+
],
|
|
88
|
+
nextAction: 'Review evidence in the manager dashboard or invite a teammate.',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: 'team',
|
|
92
|
+
label: 'Team & retention',
|
|
93
|
+
milestones: ['teammate_invited', 'seven_day_return'],
|
|
94
|
+
nextAction: 'Continue pilot rollout across repositories.',
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
/** Brain lifecycle states exposed to operators (maps CLI brain-lifecycle.v2). */
|
|
98
|
+
exports.PILOT_BRAIN_STATES = [
|
|
99
|
+
'not_started',
|
|
100
|
+
'discovering',
|
|
101
|
+
'parsing',
|
|
102
|
+
'indexing',
|
|
103
|
+
'ready',
|
|
104
|
+
'partial',
|
|
105
|
+
'stale',
|
|
106
|
+
'corrupt',
|
|
107
|
+
'canceled',
|
|
108
|
+
'failed',
|
|
109
|
+
];
|
|
110
|
+
/** Map CLI brain-lifecycle state to pilot Brain state vocabulary. */
|
|
111
|
+
function mapBrainLifecycleToPilotState(input) {
|
|
112
|
+
const lifecycle = input.lifecycleState ?? 'missing';
|
|
113
|
+
const phase = input.progressPhase ?? null;
|
|
114
|
+
if (lifecycle === 'missing')
|
|
115
|
+
return 'not_started';
|
|
116
|
+
if (lifecycle === 'scheduled')
|
|
117
|
+
return 'discovering';
|
|
118
|
+
if (lifecycle === 'building') {
|
|
119
|
+
if (phase === 'discovering' || phase === 'scanning')
|
|
120
|
+
return 'discovering';
|
|
121
|
+
if (phase === 'parsing')
|
|
122
|
+
return 'parsing';
|
|
123
|
+
return 'indexing';
|
|
124
|
+
}
|
|
125
|
+
if (lifecycle === 'fresh')
|
|
126
|
+
return 'ready';
|
|
127
|
+
if (lifecycle === 'partial')
|
|
128
|
+
return 'partial';
|
|
129
|
+
if (lifecycle === 'stale')
|
|
130
|
+
return 'stale';
|
|
131
|
+
if (lifecycle === 'failed') {
|
|
132
|
+
if (input.progressPhase === 'cancelled_by_operator')
|
|
133
|
+
return 'canceled';
|
|
134
|
+
return 'failed';
|
|
135
|
+
}
|
|
136
|
+
if (lifecycle === 'unsupported')
|
|
137
|
+
return 'partial';
|
|
138
|
+
return 'corrupt';
|
|
139
|
+
}
|
|
140
|
+
function brainStateToMilestone(state) {
|
|
141
|
+
switch (state) {
|
|
142
|
+
case 'not_started': return 'brain_not_started';
|
|
143
|
+
case 'discovering': return 'brain_discovering';
|
|
144
|
+
case 'parsing': return 'brain_parsing';
|
|
145
|
+
case 'indexing': return 'brain_indexing';
|
|
146
|
+
case 'ready': return 'brain_ready';
|
|
147
|
+
case 'partial': return 'brain_partial';
|
|
148
|
+
case 'stale': return 'brain_stale';
|
|
149
|
+
case 'corrupt': return 'brain_corrupt';
|
|
150
|
+
case 'canceled': return 'brain_canceled';
|
|
151
|
+
case 'failed': return 'brain_failed';
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/** Source-free fields allowed in activation analytics payloads. */
|
|
155
|
+
exports.PILOT_ANALYTICS_ALLOWED_FIELDS = [
|
|
156
|
+
'milestone',
|
|
157
|
+
'reasonCode',
|
|
158
|
+
'stageId',
|
|
159
|
+
'agent',
|
|
160
|
+
'enforcementPosture',
|
|
161
|
+
'brainState',
|
|
162
|
+
'workspaceKind',
|
|
163
|
+
'durationMs',
|
|
164
|
+
'attempt',
|
|
165
|
+
];
|
|
166
|
+
function isPilotActivationMilestone(value) {
|
|
167
|
+
return typeof value === 'string' && exports.PILOT_ACTIVATION_MILESTONES.includes(value);
|
|
168
|
+
}
|
|
169
|
+
function resolveCurrentFunnelStage(completed) {
|
|
170
|
+
for (const stage of exports.PILOT_FUNNEL_STAGES) {
|
|
171
|
+
const stageMilestones = stage.milestones;
|
|
172
|
+
let stageComplete = false;
|
|
173
|
+
if (stage.id === 'brain') {
|
|
174
|
+
stageComplete = completed.has('brain_ready') || completed.has('brain_partial');
|
|
175
|
+
}
|
|
176
|
+
else if (stage.id === 'workspace') {
|
|
177
|
+
stageComplete = completed.has('workspace_selected')
|
|
178
|
+
|| completed.has('organization_created')
|
|
179
|
+
|| completed.has('organization_joined');
|
|
180
|
+
}
|
|
181
|
+
else if (stage.id === 'account') {
|
|
182
|
+
stageComplete = completed.has('signup_completed');
|
|
183
|
+
}
|
|
184
|
+
else if (stage.id === 'repository') {
|
|
185
|
+
stageComplete = stageMilestones.every((m) => completed.has(m));
|
|
186
|
+
}
|
|
187
|
+
else if (stage.id === 'governance') {
|
|
188
|
+
stageComplete = completed.has('first_completed_ai_change_record');
|
|
189
|
+
}
|
|
190
|
+
else if (stage.id === 'team') {
|
|
191
|
+
stageComplete = completed.has('seven_day_return');
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
stageComplete = stageMilestones.some((m) => completed.has(m));
|
|
195
|
+
}
|
|
196
|
+
if (!stageComplete)
|
|
197
|
+
return stage.id;
|
|
198
|
+
}
|
|
199
|
+
return 'team';
|
|
200
|
+
}
|
|
201
|
+
function buildFunnelStageProgress(completed) {
|
|
202
|
+
const current = resolveCurrentFunnelStage(completed);
|
|
203
|
+
return exports.PILOT_FUNNEL_STAGES.map((stage) => {
|
|
204
|
+
const stageMilestones = stage.milestones;
|
|
205
|
+
let complete = false;
|
|
206
|
+
if (stage.id === 'brain') {
|
|
207
|
+
complete = completed.has('brain_ready') || completed.has('brain_partial');
|
|
208
|
+
}
|
|
209
|
+
else if (stage.id === 'workspace') {
|
|
210
|
+
complete = completed.has('workspace_selected')
|
|
211
|
+
|| completed.has('organization_created')
|
|
212
|
+
|| completed.has('organization_joined');
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
complete = stageMilestones.some((m) => completed.has(m));
|
|
216
|
+
}
|
|
217
|
+
const currentMilestone = stageMilestones.find((m) => !completed.has(m)) ?? null;
|
|
218
|
+
return {
|
|
219
|
+
stageId: stage.id,
|
|
220
|
+
label: stage.label,
|
|
221
|
+
complete,
|
|
222
|
+
currentMilestone: stage.id === current ? currentMilestone : null,
|
|
223
|
+
nextAction: stage.nextAction,
|
|
224
|
+
};
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/pilot-funnel/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AA4GH,sEAuBC;AAED,sDAaC;AA+DD,gEAEC;AAED,8DA0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C,MAAM,eAAe,GAAG,KAAK,CAAC,UAAiD,CAAC;QAChF,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,IAAI,KAAK,CAAC,EAAE,KAAK,OAAO,EAAE,CAAC;YACzB,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QAC5E,CAAC;aAAM,IAAI,KAAK,CAAC,EAAE,KAAK,WAAW,EAAE,CAAC;YACpC,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,oBAAoB,CAAC;mBACzC,SAAS,CAAC,GAAG,CAAC,sBAAsB,CAAC;mBACrC,SAAS,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;QAC5C,CAAC;aAAM,CAAC;YACN,QAAQ,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3D,CAAC;QACD,MAAM,gBAAgB,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;QAChF,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,EAAE;YACjB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,QAAQ;YACR,gBAAgB,EAAE,KAAK,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI;YAChE,UAAU,EAAE,KAAK,CAAC,UAAU;SAC7B,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared typed setup contract between CLI and dashboard.
|
|
3
|
+
*
|
|
4
|
+
* Both surfaces consume the same JSON shape from `neurcode agent setup --json`
|
|
5
|
+
* and the dashboard setup API mirror. No duplicated command templates.
|
|
6
|
+
*/
|
|
7
|
+
import type { PilotEnforcementPosture } from '../pilot-funnel/index.js';
|
|
8
|
+
export declare const PILOT_SETUP_CONTRACT_SCHEMA_VERSION: "neurcode.pilot-setup.v1";
|
|
9
|
+
export interface PilotSetupCommandStep {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
command: string;
|
|
13
|
+
/** When true, this step is the single recovery command if setup fails. */
|
|
14
|
+
recovery?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface PilotSetupRepoFacts {
|
|
17
|
+
trackedFileCount: number;
|
|
18
|
+
primaryLanguages: string[];
|
|
19
|
+
hasCodeowners: boolean;
|
|
20
|
+
sensitiveSurfaceCount: number;
|
|
21
|
+
scale: 'small' | 'medium' | 'large' | 'unknown';
|
|
22
|
+
}
|
|
23
|
+
export interface PilotSetupHostCapability {
|
|
24
|
+
agent: string;
|
|
25
|
+
adapter: string;
|
|
26
|
+
enforcementPosture: PilotEnforcementPosture;
|
|
27
|
+
automatic: boolean;
|
|
28
|
+
description: string;
|
|
29
|
+
}
|
|
30
|
+
export interface PilotSetupPairingStatus {
|
|
31
|
+
status: 'connected' | 'pending' | 'local_only';
|
|
32
|
+
repoName: string | null;
|
|
33
|
+
organizationHandle: string | null;
|
|
34
|
+
}
|
|
35
|
+
export interface PilotSetupContract {
|
|
36
|
+
schemaVersion: typeof PILOT_SETUP_CONTRACT_SCHEMA_VERSION;
|
|
37
|
+
generatedAt: string;
|
|
38
|
+
agent: string;
|
|
39
|
+
adapter: string;
|
|
40
|
+
privacy: {
|
|
41
|
+
metadataOnly: true;
|
|
42
|
+
sourceUploaded: false;
|
|
43
|
+
sourceIncluded: false;
|
|
44
|
+
};
|
|
45
|
+
repoFacts: PilotSetupRepoFacts;
|
|
46
|
+
hostCapability: PilotSetupHostCapability;
|
|
47
|
+
pairing: PilotSetupPairingStatus;
|
|
48
|
+
steps: PilotSetupCommandStep[];
|
|
49
|
+
recoveryCommand: string;
|
|
50
|
+
validation: {
|
|
51
|
+
authCheck: string;
|
|
52
|
+
pairingCheck: string;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export declare function buildPilotSetupRecoveryCommand(steps: PilotSetupCommandStep[]): string;
|
|
56
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pilot-setup/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAExE,eAAO,MAAM,mCAAmC,EAAG,yBAAkC,CAAC;AAEtF,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;CACjD;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,EAAE,uBAAuB,CAAC;IAC5C,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,YAAY,CAAC;IAC/C,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,OAAO,mCAAmC,CAAC;IAC1D,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE;QACP,YAAY,EAAE,IAAI,CAAC;QACnB,cAAc,EAAE,KAAK,CAAC;QACtB,cAAc,EAAE,KAAK,CAAC;KACvB,CAAC;IACF,SAAS,EAAE,mBAAmB,CAAC;IAC/B,cAAc,EAAE,wBAAwB,CAAC;IACzC,OAAO,EAAE,uBAAuB,CAAC;IACjC,KAAK,EAAE,qBAAqB,EAAE,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE;QACV,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAKrF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared typed setup contract between CLI and dashboard.
|
|
4
|
+
*
|
|
5
|
+
* Both surfaces consume the same JSON shape from `neurcode agent setup --json`
|
|
6
|
+
* and the dashboard setup API mirror. No duplicated command templates.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.PILOT_SETUP_CONTRACT_SCHEMA_VERSION = void 0;
|
|
10
|
+
exports.buildPilotSetupRecoveryCommand = buildPilotSetupRecoveryCommand;
|
|
11
|
+
exports.PILOT_SETUP_CONTRACT_SCHEMA_VERSION = 'neurcode.pilot-setup.v1';
|
|
12
|
+
function buildPilotSetupRecoveryCommand(steps) {
|
|
13
|
+
const recovery = steps.find((step) => step.recovery === true);
|
|
14
|
+
if (recovery)
|
|
15
|
+
return recovery.command;
|
|
16
|
+
const doctor = steps.find((step) => step.id === 'health' || step.id === 'doctor');
|
|
17
|
+
return doctor?.command ?? steps[0]?.command ?? 'neurcode doctor --runtime';
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/pilot-setup/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAyDH,wEAKC;AA1DY,QAAA,mCAAmC,GAAG,yBAAkC,CAAC;AAqDtF,SAAgB,8BAA8B,CAAC,KAA8B;IAC3E,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC;IAC9D,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC,OAAO,CAAC;IACtC,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,QAAQ,IAAI,IAAI,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC;IAClF,OAAO,MAAM,EAAE,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,2BAA2B,CAAC;AAC7E,CAAC"}
|
|
@@ -5,6 +5,7 @@ export declare const POLICY_EVALUATION_SCHEMA_VERSION: "neurcode.policy-evaluati
|
|
|
5
5
|
export declare const SEMANTIC_ADVISORY_SCHEMA_VERSION: "neurcode.semantic-advisory.v2";
|
|
6
6
|
export declare const REPO_INTELLIGENCE_EVIDENCE_SCHEMA_VERSION: "neurcode.repo-intelligence-evidence.v2";
|
|
7
7
|
export declare const REPO_INTELLIGENCE_OPERATIONS_SCHEMA_VERSION: "neurcode.repo-intelligence-operations.v1";
|
|
8
|
+
export declare const LANGUAGE_COVERAGE_MATRIX_SCHEMA_VERSION: "neurcode.language-coverage-matrix.v1";
|
|
8
9
|
export type IntelligenceTruthClassification = 'deterministic' | 'backend_signed' | 'advisory' | 'not_evaluated';
|
|
9
10
|
export type PolicyVerdict = 'allow' | 'warn' | 'block' | 'not_evaluated';
|
|
10
11
|
export type PolicyMode = 'off' | 'warn' | 'block';
|
|
@@ -22,6 +23,62 @@ export interface LanguageAnalysisCoverage {
|
|
|
22
23
|
facts: Array<'symbols' | 'references' | 'imports' | 'exports' | 'calls'>;
|
|
23
24
|
limitations: string[];
|
|
24
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Canonical relationship-authority class. Structurally identical to
|
|
28
|
+
* governance-runtime's `RelationshipAuthorityClass`; declared here because
|
|
29
|
+
* contracts is the lowest layer and cannot import governance-runtime. The
|
|
30
|
+
* language-coverage builder derives capability tiers from this class.
|
|
31
|
+
*/
|
|
32
|
+
export type RepositoryRelationshipAuthorityClass = 'deterministic_exact' | 'deterministic_structural' | 'bounded_inference' | 'advisory_heuristic' | 'not_evaluated' | 'unsupported';
|
|
33
|
+
/**
|
|
34
|
+
* Per-language capability tier (Iteration 7 — Language Coverage Matrix).
|
|
35
|
+
*
|
|
36
|
+
* This is deliberately distinct from {@link IntelligenceTruthClassification}:
|
|
37
|
+
* that classifies how strongly a *single claim* is known; this classifies how
|
|
38
|
+
* well a *language dimension* is handled a priori. Fail-closed contract: an
|
|
39
|
+
* absent or unproven parser is `not_evaluated`, never `supported`.
|
|
40
|
+
*
|
|
41
|
+
* - `supported` — deterministic structural facts (e.g. resolved imports, symbols).
|
|
42
|
+
* - `partial` — bounded inference; useful but not a guarantee (e.g. test adjacency).
|
|
43
|
+
* - `advisory` — heuristic signal worth a human look; never a hard block.
|
|
44
|
+
* - `not_evaluated` — no parser/evidence; the dimension is not assessed.
|
|
45
|
+
*/
|
|
46
|
+
export type LanguageSupportTier = 'supported' | 'partial' | 'advisory' | 'not_evaluated';
|
|
47
|
+
export type LanguageCoverageDimension = 'parsing' | 'imports' | 'symbols' | 'testImpact' | 'ownership';
|
|
48
|
+
export interface LanguageCoverageDimensionCell {
|
|
49
|
+
tier: LanguageSupportTier;
|
|
50
|
+
/**
|
|
51
|
+
* Relationship-authority class this tier derives from. `null` for dimensions
|
|
52
|
+
* that are not edge-based: `parsing` is parser-depth derived and `ownership`
|
|
53
|
+
* is CODEOWNERS/path derived, independent of any language parser.
|
|
54
|
+
*/
|
|
55
|
+
authorityClass: RepositoryRelationshipAuthorityClass | null;
|
|
56
|
+
/** Source-free reason codes explaining the tier. */
|
|
57
|
+
reasonCodes: string[];
|
|
58
|
+
}
|
|
59
|
+
export interface LanguageCoverageRow {
|
|
60
|
+
language: RepositoryLanguage;
|
|
61
|
+
/** Highest parser depth available: observed depth when indexed, else catalog floor. */
|
|
62
|
+
parserDepth: ParserDepth;
|
|
63
|
+
/** True when at least one file of this language is present in the indexed graph. */
|
|
64
|
+
observed: boolean;
|
|
65
|
+
filesSeen: number;
|
|
66
|
+
filesAnalyzed: number;
|
|
67
|
+
dimensions: Record<LanguageCoverageDimension, LanguageCoverageDimensionCell>;
|
|
68
|
+
/** Honest, static limitation statements. Source-free: no paths, symbols, or bodies. */
|
|
69
|
+
limitations: string[];
|
|
70
|
+
}
|
|
71
|
+
export interface LanguageCoverageMatrix {
|
|
72
|
+
schemaVersion: typeof LANGUAGE_COVERAGE_MATRIX_SCHEMA_VERSION;
|
|
73
|
+
/**
|
|
74
|
+
* Whether the indexed graph is coverage-complete. Tiers describe per-language
|
|
75
|
+
* capability on covered paths; overall graph completeness is governed
|
|
76
|
+
* separately by `scaleStatus.coverage.impactAuthority`.
|
|
77
|
+
*/
|
|
78
|
+
coverageComplete: boolean;
|
|
79
|
+
/** One row per roadmap language plus any other observed language, sorted by name. */
|
|
80
|
+
languages: LanguageCoverageRow[];
|
|
81
|
+
}
|
|
25
82
|
export interface SourceFreeSymbolFact {
|
|
26
83
|
id: string;
|
|
27
84
|
name: string;
|