orizu 0.5.26 → 0.5.28
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/README.md +19 -0
- package/dist/artifacts-git-runtime.d.ts +34 -0
- package/dist/artifacts-git-runtime.d.ts.map +1 -0
- package/dist/artifacts-git-runtime.js +312 -0
- package/dist/cloudflare-artifacts-git-remote.d.ts +5 -0
- package/dist/cloudflare-artifacts-git-remote.d.ts.map +1 -0
- package/dist/cloudflare-artifacts-git-remote.js +21 -0
- package/dist/dataset-transfer-download.d.ts +2 -0
- package/dist/dataset-transfer-download.d.ts.map +1 -0
- package/dist/dataset-transfer-download.js +66 -0
- package/dist/dataset-transfer-policy.d.ts +2 -0
- package/dist/dataset-transfer-policy.d.ts.map +1 -0
- package/dist/dataset-transfer-policy.js +8 -0
- package/dist/dataset-transfer-upload.d.ts +42 -0
- package/dist/dataset-transfer-upload.d.ts.map +1 -0
- package/dist/dataset-transfer-upload.js +110 -0
- package/dist/git-credential.d.ts.map +1 -1
- package/dist/git-credential.js +1 -1
- package/dist/git-recovery-environment.d.ts +1 -0
- package/dist/git-recovery-environment.d.ts.map +1 -1
- package/dist/git-recovery-environment.js +1 -1
- package/dist/help.d.ts.map +1 -1
- package/dist/help.js +44 -11
- package/dist/hosted-boot.d.ts +75 -2
- package/dist/hosted-boot.d.ts.map +1 -1
- package/dist/hosted-boot.js +585 -102
- package/dist/hosted-bootstrap.d.ts +2 -0
- package/dist/hosted-bootstrap.d.ts.map +1 -1
- package/dist/hosted-bootstrap.js +12 -3
- package/dist/hosted-harness-opencode.d.ts +8 -9
- package/dist/hosted-harness-opencode.d.ts.map +1 -1
- package/dist/hosted-harness-opencode.js +126 -24
- package/dist/hosted-harness.d.ts +3 -0
- package/dist/hosted-harness.d.ts.map +1 -1
- package/dist/hosted-harness.js +4 -1
- package/dist/hosted-harvest.d.ts +30 -9
- package/dist/hosted-harvest.d.ts.map +1 -1
- package/dist/hosted-harvest.js +222 -28
- package/dist/hosted-loop-lifecycle.d.ts +15 -3
- package/dist/hosted-loop-lifecycle.d.ts.map +1 -1
- package/dist/hosted-loop-lifecycle.js +6 -4
- package/dist/hosted-loop.d.ts +47 -7
- package/dist/hosted-loop.d.ts.map +1 -1
- package/dist/hosted-loop.js +310 -64
- package/dist/hosted-question-limits.d.ts +7 -0
- package/dist/hosted-question-limits.d.ts.map +1 -0
- package/dist/hosted-question-limits.js +6 -0
- package/dist/hosted-question.d.ts +27 -0
- package/dist/hosted-question.d.ts.map +1 -0
- package/dist/hosted-question.js +118 -0
- package/dist/hosted-run-event-sink.d.ts +10 -5
- package/dist/hosted-run-event-sink.d.ts.map +1 -1
- package/dist/hosted-run-event-sink.js +12 -8
- package/dist/hosted-runtime-assets.d.ts +16 -7
- package/dist/hosted-runtime-assets.d.ts.map +1 -1
- package/dist/hosted-runtime-assets.js +40 -12
- package/dist/hosted-session-cli.d.ts.map +1 -1
- package/dist/hosted-session-cli.js +10 -19
- package/dist/http.d.ts +1 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +10 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +113 -92
- package/dist/instruction-set-gepa-launch.d.ts +1 -1
- package/dist/instruction-set-gepa-launch.d.ts.map +1 -1
- package/dist/instruction-set-gepa-launch.js +5 -3
- package/dist/instruction-set-loader.d.ts.map +1 -1
- package/dist/instruction-set-loader.js +63 -2
- package/dist/instruction-set-lock/index.d.ts +51 -0
- package/dist/instruction-set-lock/index.d.ts.map +1 -0
- package/dist/instruction-set-lock/index.js +459 -0
- package/dist/instruction-set-lock/schema.v1.d.ts +136 -0
- package/dist/instruction-set-lock/schema.v1.d.ts.map +1 -0
- package/dist/instruction-set-lock/schema.v1.js +155 -0
- package/dist/instruction-set-provenance.d.ts +26 -0
- package/dist/instruction-set-provenance.d.ts.map +1 -0
- package/dist/instruction-set-provenance.js +68 -0
- package/dist/instruction-set-sync/helpers.d.ts +22 -0
- package/dist/instruction-set-sync/helpers.d.ts.map +1 -0
- package/dist/instruction-set-sync/helpers.js +677 -0
- package/dist/instruction-set-sync/index.d.ts +60 -0
- package/dist/instruction-set-sync/index.d.ts.map +1 -0
- package/dist/instruction-set-sync/index.js +689 -0
- package/dist/instruction-set-update/index.d.ts +42 -0
- package/dist/instruction-set-update/index.d.ts.map +1 -0
- package/dist/instruction-set-update/index.js +445 -0
- package/dist/instruction-set-verify/index.d.ts +27 -0
- package/dist/instruction-set-verify/index.d.ts.map +1 -0
- package/dist/instruction-set-verify/index.js +865 -0
- package/dist/instruction-sets-cli.d.ts +1 -4
- package/dist/instruction-sets-cli.d.ts.map +1 -1
- package/dist/instruction-sets-cli.js +220 -109
- package/dist/model-config-fields.d.ts +35 -0
- package/dist/model-config-fields.d.ts.map +1 -0
- package/dist/model-config-fields.js +28 -0
- package/dist/optimizations-list-cli.d.ts.map +1 -1
- package/dist/optimizations-list-cli.js +7 -4
- package/dist/score-format.d.ts +2 -0
- package/dist/score-format.d.ts.map +1 -0
- package/dist/score-format.js +18 -0
- package/dist/workbench-repo-contract.d.ts +65 -0
- package/dist/workbench-repo-contract.d.ts.map +1 -0
- package/dist/workbench-repo-contract.js +250 -0
- package/dist/workspace-bootstrap-job.d.ts +45 -0
- package/dist/workspace-bootstrap-job.d.ts.map +1 -0
- package/dist/workspace-bootstrap-job.js +431 -0
- package/dist/workspace-bootstrap-seed.d.ts +74 -0
- package/dist/workspace-bootstrap-seed.d.ts.map +1 -0
- package/dist/workspace-bootstrap-seed.js +209 -0
- package/package.json +4 -3
- package/src/artifacts-git-runtime.ts +360 -0
- package/src/cloudflare-artifacts-git-remote.ts +24 -0
- package/src/dataset-transfer-download.ts +61 -0
- package/src/dataset-transfer-policy.ts +8 -0
- package/src/dataset-transfer-upload.ts +145 -0
- package/src/git-credential.ts +1 -2
- package/src/git-recovery-environment.ts +1 -1
- package/src/help.ts +44 -11
- package/src/hosted-boot.ts +644 -109
- package/src/hosted-bootstrap.ts +14 -3
- package/src/hosted-harness-opencode.ts +130 -28
- package/src/hosted-harness.ts +4 -1
- package/src/hosted-harvest.ts +258 -33
- package/src/hosted-loop-lifecycle.ts +19 -5
- package/src/hosted-loop.ts +340 -68
- package/src/hosted-question-limits.ts +6 -0
- package/src/hosted-question.ts +145 -0
- package/src/hosted-run-event-sink.ts +24 -12
- package/src/hosted-runtime-assets.ts +51 -11
- package/src/hosted-session-cli.ts +10 -24
- package/src/http.ts +10 -4
- package/src/index.ts +108 -134
- package/src/instruction-set-gepa-launch.ts +4 -4
- package/src/instruction-set-loader.ts +53 -2
- package/src/instruction-set-lock/index.ts +561 -0
- package/src/instruction-set-lock/schema.v1.json +141 -0
- package/src/instruction-set-lock/schema.v1.ts +155 -0
- package/src/instruction-set-provenance.ts +89 -0
- package/src/instruction-set-sync/helpers.ts +707 -0
- package/src/instruction-set-sync/index.ts +791 -0
- package/src/instruction-set-update/index.ts +488 -0
- package/src/instruction-set-verify/index.ts +1067 -0
- package/src/instruction-sets-cli.ts +226 -114
- package/src/model-config-fields.ts +31 -0
- package/src/optimizations-list-cli.ts +7 -4
- package/src/score-format.ts +16 -0
- package/src/workbench-repo-contract.ts +314 -0
- package/src/workspace-bootstrap-job.ts +611 -0
- package/src/workspace-bootstrap-seed.ts +350 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/instruction_set_loader.py +46 -2
- package/vendor/skills/orizu/SKILL.md +4 -2
- package/vendor/skills/orizu/flows/promote.md +4 -0
- package/vendor/skills/orizu/references/assess-and-plan.md +1 -1
- package/vendor/skills/orizu/references/authority-map.md +1 -1
- package/vendor/skills/orizu/references/cli-reference.md +151 -35
- package/vendor/skills/orizu/references/instructions-after-prompts.md +3 -3
- package/vendor/skills/orizu/references/migrate-existing-gepa-setup.md +5 -6
- package/vendor/skills/orizu/references/migrate-hand-rolled-instruction-layout.md +252 -0
- package/vendor/skills/orizu/references/optimization-reports.md +5 -4
- package/vendor/skills/orizu/references/optimization-with-gepa.md +1 -1
- package/vendor/skills/orizu/references/orizu-in-your-codebase.md +195 -0
- package/vendor/skills/orizu/references/primer.md +4 -2
- package/vendor/skills/orizu/references/prompt-control-plane.md +33 -29
- package/vendor/skills/orizu/references/vocabulary.md +1 -1
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
export const instructionSetLockSchemaV1 = {
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://orizu.ai/schemas/instruction-set-lock/v1",
|
|
4
|
+
"title": "Orizu instruction set Lock v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": [
|
|
7
|
+
"lockfileVersion",
|
|
8
|
+
"project",
|
|
9
|
+
"instructionSets"
|
|
10
|
+
],
|
|
11
|
+
"additionalProperties": false,
|
|
12
|
+
"properties": {
|
|
13
|
+
"lockfileVersion": {
|
|
14
|
+
"const": 1
|
|
15
|
+
},
|
|
16
|
+
"project": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*/[a-z0-9]+(?:-[a-z0-9]+)*$"
|
|
19
|
+
},
|
|
20
|
+
"instructionSets": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"additionalProperties": false,
|
|
23
|
+
"patternProperties": {
|
|
24
|
+
"^[a-z0-9]+(?:-[a-z0-9]+)*$": {
|
|
25
|
+
"$ref": "#/$defs/instructionSet"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"helpers": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"propertyNames": {
|
|
32
|
+
"pattern": "^helpers\\/(?!\\.{1,2}(?:\\/|$))(?!.*\\/\\.{1,2}(?:\\/|$))[A-Za-z0-9._-]+(?:\\/[A-Za-z0-9._-]+)*$"
|
|
33
|
+
},
|
|
34
|
+
"additionalProperties": {
|
|
35
|
+
"$ref": "#/$defs/sha256"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"pins": {
|
|
39
|
+
"type": "array",
|
|
40
|
+
"uniqueItems": true,
|
|
41
|
+
"items": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*/[^\\s]+@v[1-9][0-9]*$"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"$defs": {
|
|
48
|
+
"sha256": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"pattern": "^sha256:[0-9a-f]{64}$"
|
|
51
|
+
},
|
|
52
|
+
"instructionSet": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"required": [
|
|
55
|
+
"instructionSetId",
|
|
56
|
+
"default",
|
|
57
|
+
"profiles"
|
|
58
|
+
],
|
|
59
|
+
"additionalProperties": false,
|
|
60
|
+
"properties": {
|
|
61
|
+
"instructionSetId": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"format": "uuid",
|
|
64
|
+
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89aAbB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
|
|
65
|
+
},
|
|
66
|
+
"default": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"pattern": "^[a-z0-9][a-z0-9._-]*__[a-z0-9][a-z0-9._-]*$"
|
|
69
|
+
},
|
|
70
|
+
"profiles": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"minProperties": 1,
|
|
73
|
+
"additionalProperties": false,
|
|
74
|
+
"patternProperties": {
|
|
75
|
+
"^[a-z0-9][a-z0-9._-]*__[a-z0-9][a-z0-9._-]*$": {
|
|
76
|
+
"$ref": "#/$defs/profile"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"profile": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"required": [
|
|
85
|
+
"production",
|
|
86
|
+
"versions"
|
|
87
|
+
],
|
|
88
|
+
"additionalProperties": false,
|
|
89
|
+
"properties": {
|
|
90
|
+
"modelConfigIdentity": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"minLength": 1
|
|
93
|
+
},
|
|
94
|
+
"production": {
|
|
95
|
+
"type": [
|
|
96
|
+
"string",
|
|
97
|
+
"null"
|
|
98
|
+
],
|
|
99
|
+
"pattern": "^v[1-9][0-9]*$"
|
|
100
|
+
},
|
|
101
|
+
"versions": {
|
|
102
|
+
"type": "object",
|
|
103
|
+
"minProperties": 1,
|
|
104
|
+
"additionalProperties": false,
|
|
105
|
+
"patternProperties": {
|
|
106
|
+
"^v[1-9][0-9]*$": {
|
|
107
|
+
"$ref": "#/$defs/version"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"version": {
|
|
114
|
+
"type": "object",
|
|
115
|
+
"required": [
|
|
116
|
+
"profileVersionId",
|
|
117
|
+
"versionNumber",
|
|
118
|
+
"digest",
|
|
119
|
+
"components",
|
|
120
|
+
"syncedAt"
|
|
121
|
+
],
|
|
122
|
+
"additionalProperties": false,
|
|
123
|
+
"properties": {
|
|
124
|
+
"profileVersionId": {
|
|
125
|
+
"type": "string",
|
|
126
|
+
"format": "uuid",
|
|
127
|
+
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89aAbB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
|
|
128
|
+
},
|
|
129
|
+
"versionNumber": {
|
|
130
|
+
"type": "integer",
|
|
131
|
+
"minimum": 1,
|
|
132
|
+
"maximum": 2147483647
|
|
133
|
+
},
|
|
134
|
+
"digest": {
|
|
135
|
+
"$ref": "#/$defs/sha256"
|
|
136
|
+
},
|
|
137
|
+
"components": {
|
|
138
|
+
"type": "object",
|
|
139
|
+
"minProperties": 1,
|
|
140
|
+
"propertyNames": {
|
|
141
|
+
"pattern": "^(?!\\.)[A-Za-z0-9._-]+$"
|
|
142
|
+
},
|
|
143
|
+
"additionalProperties": {
|
|
144
|
+
"$ref": "#/$defs/sha256"
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"syncedAt": {
|
|
148
|
+
"type": "string",
|
|
149
|
+
"format": "date-time",
|
|
150
|
+
"pattern": "^(?:(?:[0-9]{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12][0-9]|3[01])|(?:0[469]|11)-(?:0[1-9]|[12][0-9]|30)|02-(?:0[1-9]|1[0-9]|2[0-8])))|(?:(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:00|0[48]|[2468][048]|[13579][26])00)-02-29))T(?:[01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\\.[0-9]{3}Z$"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
} as const
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs'
|
|
2
|
+
import { join } from 'node:path'
|
|
3
|
+
|
|
4
|
+
import { parseLock, parseSpecifier } from './instruction-set-lock/index.js'
|
|
5
|
+
import { profileSlug } from './instruction-set-sync/index.js'
|
|
6
|
+
|
|
7
|
+
export const PROVENANCE_ATTRIBUTE_NAMES = {
|
|
8
|
+
instructionSetId: 'orizu.instruction_set.id',
|
|
9
|
+
profileVersionId: 'orizu.profile_version.id',
|
|
10
|
+
digest: 'orizu.instruction_set.digest',
|
|
11
|
+
} as const
|
|
12
|
+
|
|
13
|
+
export interface InstructionSetProvenanceTriple {
|
|
14
|
+
instructionSetId: string
|
|
15
|
+
profileVersionId: string
|
|
16
|
+
digest: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function resolveInstructionSetProvenance({
|
|
20
|
+
specifier,
|
|
21
|
+
root = '.',
|
|
22
|
+
project,
|
|
23
|
+
}: {
|
|
24
|
+
specifier: string
|
|
25
|
+
root?: string
|
|
26
|
+
project: string
|
|
27
|
+
}): InstructionSetProvenanceTriple {
|
|
28
|
+
const lockPath = join(root, 'orizu', 'orizu.lock.json')
|
|
29
|
+
if (!existsSync(lockPath)) throw new Error(`instruction_set_lock_missing:${lockPath}`)
|
|
30
|
+
const lock = parseLock(readFileSync(lockPath, 'utf8'))
|
|
31
|
+
const projectSegments = project.split('/').map(segment => segment.trim().toLowerCase())
|
|
32
|
+
if (projectSegments.length !== 2 || projectSegments.some(segment => segment.length === 0)) {
|
|
33
|
+
throw new Error(`instruction_set_project_invalid:${projectSegments.join('/')}`)
|
|
34
|
+
}
|
|
35
|
+
const normalizedProject = projectSegments.join('/')
|
|
36
|
+
if (lock.project !== normalizedProject) {
|
|
37
|
+
throw new Error(`instruction_set_lock_project_mismatch:${lock.project}!=${normalizedProject}`)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const parsed = parseSpecifier(specifier)
|
|
41
|
+
const instructionSet = lock.instructionSets[parsed.set]
|
|
42
|
+
if (!instructionSet) throw new Error('instruction_set_specifier_unknown')
|
|
43
|
+
const selectedProfile = parsed.profile === undefined
|
|
44
|
+
? instructionSet.default
|
|
45
|
+
: profileSlug(parsed.profile)
|
|
46
|
+
const profile = instructionSet.profiles[selectedProfile]
|
|
47
|
+
if (!profile) throw new Error('instruction_set_specifier_unknown')
|
|
48
|
+
const selectedVersion = parsed.versionNumber === undefined
|
|
49
|
+
? profile.production
|
|
50
|
+
: `v${parsed.versionNumber}`
|
|
51
|
+
if (profile.modelConfigIdentity === undefined) {
|
|
52
|
+
const repairVersion = selectedVersion ?? Object.keys(profile.versions).sort()[0]!
|
|
53
|
+
const legacyIdentity = selectedProfile.replace('__', '/')
|
|
54
|
+
throw new Error(
|
|
55
|
+
`instruction_set_lock_profile_identity_missing:${parsed.set}/${selectedProfile}; repair with orizu instructions sync ${parsed.set}/${legacyIdentity}@${repairVersion}`
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
if (parsed.profile !== undefined && profile.modelConfigIdentity !== parsed.profile) {
|
|
59
|
+
throw new Error(`instruction_set_specifier_profile_mismatch:${profile.modelConfigIdentity}`)
|
|
60
|
+
}
|
|
61
|
+
if (selectedVersion === null) {
|
|
62
|
+
throw new Error('instruction_set_pointer_unresolved:production')
|
|
63
|
+
}
|
|
64
|
+
const version = profile.versions[selectedVersion]
|
|
65
|
+
if (!version) throw new Error('instruction_set_specifier_unknown')
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
instructionSetId: instructionSet.instructionSetId,
|
|
69
|
+
profileVersionId: version.profileVersionId,
|
|
70
|
+
digest: version.digest,
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function provenanceRequestFields(triple: InstructionSetProvenanceTriple | null) {
|
|
75
|
+
return triple ? {
|
|
76
|
+
[PROVENANCE_ATTRIBUTE_NAMES.instructionSetId]: triple.instructionSetId,
|
|
77
|
+
[PROVENANCE_ATTRIBUTE_NAMES.profileVersionId]: triple.profileVersionId,
|
|
78
|
+
[PROVENANCE_ATTRIBUTE_NAMES.digest]: triple.digest,
|
|
79
|
+
} : {}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function noSubmitScorerOutput(
|
|
83
|
+
data: Record<string, unknown>,
|
|
84
|
+
instructionSetProvenance: Record<string, unknown>
|
|
85
|
+
): Record<string, unknown> {
|
|
86
|
+
const scoreResult = data.scoreResult
|
|
87
|
+
if (typeof scoreResult !== 'object' || scoreResult === null || Array.isArray(scoreResult)) return data
|
|
88
|
+
return { ...scoreResult, provenance: data.provenance, ...instructionSetProvenance }
|
|
89
|
+
}
|