@company-semantics/contracts 0.48.0 → 0.49.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/package.json +2 -1
- package/src/index.ts +0 -10
- package/src/ralph/index.ts +1 -13
- package/src/ralph/progress.ts +2 -4
- package/src/ralph/trust.ts +0 -125
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@company-semantics/contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.49.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
|
+
"build": "tsc -b --noEmit",
|
|
54
55
|
"typecheck": "tsc -b --noEmit",
|
|
55
56
|
"typecheck:ci": "tsc -p scripts/ci/tsconfig.json",
|
|
56
57
|
"lint:md": "markdownlint-cli2 '**/*.md' '#node_modules'",
|
package/src/index.ts
CHANGED
|
@@ -332,16 +332,6 @@ export type {
|
|
|
332
332
|
RalphIteration,
|
|
333
333
|
RalphMode,
|
|
334
334
|
RalphProgress,
|
|
335
|
-
// Trust types
|
|
336
|
-
RalphTrustLevel,
|
|
337
|
-
RalphRunResult,
|
|
338
|
-
RalphCIStatus,
|
|
339
|
-
RalphTrustLog,
|
|
340
|
-
RalphTL1Policy,
|
|
341
|
-
RalphTL2Policy,
|
|
342
|
-
RalphTL3Policy,
|
|
343
|
-
RalphTrustPolicy,
|
|
344
|
-
RalphDemotionReason,
|
|
345
335
|
} from './ralph/index';
|
|
346
336
|
|
|
347
337
|
// Ralph constants (cross-repo support)
|
package/src/ralph/index.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Import from '@company-semantics/contracts/ralph' or '@company-semantics/contracts'.
|
|
6
6
|
*
|
|
7
7
|
* Note: This module exports types only (no runtime code per contracts policy).
|
|
8
|
-
* Orchestration
|
|
8
|
+
* Orchestration and prompts live in company-semantics-control.
|
|
9
9
|
*
|
|
10
10
|
* @see company-semantics-control/docs/ralph.md for usage
|
|
11
11
|
*/
|
|
@@ -40,15 +40,3 @@ export type {
|
|
|
40
40
|
RalphProgress,
|
|
41
41
|
} from './progress';
|
|
42
42
|
|
|
43
|
-
// Trust types
|
|
44
|
-
export type {
|
|
45
|
-
RalphTrustLevel,
|
|
46
|
-
RalphRunResult,
|
|
47
|
-
RalphCIStatus,
|
|
48
|
-
RalphTrustLog,
|
|
49
|
-
RalphTL1Policy,
|
|
50
|
-
RalphTL2Policy,
|
|
51
|
-
RalphTL3Policy,
|
|
52
|
-
RalphTrustPolicy,
|
|
53
|
-
RalphDemotionReason,
|
|
54
|
-
} from './trust';
|
package/src/ralph/progress.ts
CHANGED
|
@@ -11,8 +11,6 @@
|
|
|
11
11
|
* @see company-semantics-control/docs/ralph.md for usage
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import type { RalphTrustLevel } from './trust';
|
|
15
|
-
|
|
16
14
|
// =============================================================================
|
|
17
15
|
// Iteration Types
|
|
18
16
|
// =============================================================================
|
|
@@ -60,8 +58,8 @@ export type RalphProgress = {
|
|
|
60
58
|
sessionId: string;
|
|
61
59
|
/** Target repository name */
|
|
62
60
|
repo: string;
|
|
63
|
-
/**
|
|
64
|
-
trustLevel
|
|
61
|
+
/** @deprecated Trust level removed — field retained for serialization compat */
|
|
62
|
+
trustLevel?: number;
|
|
65
63
|
/** Operation mode (HITL or AFK) */
|
|
66
64
|
mode: RalphMode;
|
|
67
65
|
/** Completed iterations */
|
package/src/ralph/trust.ts
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ralph Trust Level Types
|
|
3
|
-
*
|
|
4
|
-
* Defines the Trust Promotion framework for graduated AI autonomy.
|
|
5
|
-
* Ralph earns trust through repeated, measurable compliance — not intent.
|
|
6
|
-
*
|
|
7
|
-
* Trust Level Summary:
|
|
8
|
-
* - TL0 (Sandbox): Default, no network, single repo
|
|
9
|
-
* - TL1 (Verified): Earned after 8+ consecutive clean runs
|
|
10
|
-
* - TL2 (Limited Network): Requires human approval, npm/GitHub access
|
|
11
|
-
* - TL3 (Full AFK): Rare, mechanical tasks only, full network
|
|
12
|
-
*
|
|
13
|
-
* @see company-semantics-control/docs/ralph.md for usage
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
// =============================================================================
|
|
17
|
-
// Trust Level Types
|
|
18
|
-
// =============================================================================
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Trust level numeric value.
|
|
22
|
-
*
|
|
23
|
-
* - 0: Sandbox (default)
|
|
24
|
-
* - 1: Verified AFK
|
|
25
|
-
* - 2: Limited Network
|
|
26
|
-
* - 3: Full AFK
|
|
27
|
-
*/
|
|
28
|
-
export type RalphTrustLevel = 0 | 1 | 2 | 3;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Result of a Ralph run.
|
|
32
|
-
*/
|
|
33
|
-
export type RalphRunResult = 'success' | 'failure';
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* CI status after a Ralph run.
|
|
37
|
-
*/
|
|
38
|
-
export type RalphCIStatus = 'green' | 'red' | 'skipped';
|
|
39
|
-
|
|
40
|
-
// =============================================================================
|
|
41
|
-
// Trust Log Types
|
|
42
|
-
// =============================================================================
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Record of a single Ralph run outcome.
|
|
46
|
-
*
|
|
47
|
-
* Stored in `.ralph/trust-log.json` for audit and promotion decisions.
|
|
48
|
-
*/
|
|
49
|
-
export type RalphTrustLog = {
|
|
50
|
-
/** Run identifier (ISO timestamp) */
|
|
51
|
-
runId: string;
|
|
52
|
-
/** Repository where run occurred */
|
|
53
|
-
repo: string;
|
|
54
|
-
/** Trust level at time of run */
|
|
55
|
-
trustLevel: RalphTrustLevel;
|
|
56
|
-
/** Overall run result */
|
|
57
|
-
result: RalphRunResult;
|
|
58
|
-
/** CI status after run */
|
|
59
|
-
ciStatus: RalphCIStatus;
|
|
60
|
-
/** Whether human fixes were required post-run */
|
|
61
|
-
humanFixesRequired: boolean;
|
|
62
|
-
/** Reason for demotion if applicable */
|
|
63
|
-
demotionReason?: string;
|
|
64
|
-
/** Number of iterations completed */
|
|
65
|
-
iterationsCompleted?: number;
|
|
66
|
-
/** Number of features completed */
|
|
67
|
-
featuresCompleted?: number;
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
// =============================================================================
|
|
71
|
-
// Trust Policy Types
|
|
72
|
-
// =============================================================================
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Promotion criteria for TL1 (Verified AFK).
|
|
76
|
-
*/
|
|
77
|
-
export type RalphTL1Policy = {
|
|
78
|
-
requiredConsecutiveRuns: number;
|
|
79
|
-
allowNetwork: false;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Promotion criteria for TL2 (Limited Network).
|
|
84
|
-
*/
|
|
85
|
-
export type RalphTL2Policy = {
|
|
86
|
-
requiresHumanApproval: true;
|
|
87
|
-
/** Domains allowed for network access */
|
|
88
|
-
networkAllowlist: string[];
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Promotion criteria for TL3 (Full AFK).
|
|
93
|
-
*/
|
|
94
|
-
export type RalphTL3Policy = {
|
|
95
|
-
requiresExplicitPromotion: true;
|
|
96
|
-
/** Glob patterns for allowed repos */
|
|
97
|
-
allowedRepoPatterns: string[];
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Complete trust policy configuration.
|
|
102
|
-
*
|
|
103
|
-
* Note: Policy logic lives in control repo, not here.
|
|
104
|
-
* This type defines vocabulary only.
|
|
105
|
-
*/
|
|
106
|
-
export type RalphTrustPolicy = {
|
|
107
|
-
trustLevel1: RalphTL1Policy;
|
|
108
|
-
trustLevel2: RalphTL2Policy;
|
|
109
|
-
trustLevel3: RalphTL3Policy;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
// =============================================================================
|
|
113
|
-
// Demotion Types
|
|
114
|
-
// =============================================================================
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Reasons for automatic demotion to TL0.
|
|
118
|
-
*/
|
|
119
|
-
export type RalphDemotionReason =
|
|
120
|
-
| 'ci_failed'
|
|
121
|
-
| 'guard_violation'
|
|
122
|
-
| 'manual_patch_required'
|
|
123
|
-
| 'scope_violation'
|
|
124
|
-
| 'network_abuse'
|
|
125
|
-
| 'prd_marked_complete_incorrectly';
|