opencode-harness-kit 0.6.3 → 0.7.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 +303 -10
- package/README.md +244 -14
- package/bin/oc-harness.mjs +234 -28
- package/dist/budget.d.ts +247 -0
- package/dist/config.d.ts +34 -1
- package/dist/effort.d.ts +12 -1
- package/dist/guard.d.ts +5 -0
- package/dist/health.d.ts +12 -1
- package/dist/index.js +556 -149
- package/dist/profile.d.ts +2 -1
- package/dist/prune.d.ts +22 -0
- package/dist/rules.d.ts +6 -2
- package/docs/EXIT-CODES.md +18 -4
- package/docs/REVIEW-VERDICT.md +73 -0
- package/eval/RESULTS.md +130 -7
- package/eval/ab.mjs +591 -68
- package/eval/compare.mjs +267 -0
- package/eval/verify.mjs +9 -0
- package/lanes.json +18 -9
- package/package.json +6 -2
- package/profiles/index.json +1 -12
- package/prompts/reviewer.md +24 -0
- package/retention.yml +0 -8
- package/src/budget.js +418 -0
- package/src/config.js +172 -6
- package/src/driver/run.mjs +780 -42
- package/src/effort.js +17 -3
- package/src/guard.ts +304 -1
- package/src/health.js +13 -1
- package/src/index.ts +23 -12
- package/src/profile.js +1 -1
- package/src/prune.ts +21 -1
- package/src/rules.js +145 -0
- package/src/tasks.js +31 -0
package/dist/config.d.ts
CHANGED
|
@@ -27,6 +27,35 @@ export declare const GLOBAL_INSTRUCTIONS = "~/.config/opencode/GLOBAL.md";
|
|
|
27
27
|
* @returns {string}
|
|
28
28
|
*/
|
|
29
29
|
export declare function kitVersion(): string;
|
|
30
|
+
/** Where opencode's user config lives when nothing overrides it. */
|
|
31
|
+
export declare const DEFAULT_CONFIG_DIR: string;
|
|
32
|
+
/** Where this kit itself lives - the parent of the bundle (or src) directory. */
|
|
33
|
+
export declare function kitRoot(): string;
|
|
34
|
+
/**
|
|
35
|
+
* The skills.paths entries of a base config, with the dead ones dropped.
|
|
36
|
+
*
|
|
37
|
+
* A `paths` entry that never resolves is not a configuration - it is noise
|
|
38
|
+
* the file carries for every reader to puzzle over, and a reader who DOES
|
|
39
|
+
* puzzle over it gets a wrong model of the world: this kit's config shipped
|
|
40
|
+
* `["../skills"]` which had dl resolved to `~/.config/skills` - a directory
|
|
41
|
+
* that has never existed on this machine - for release after release.
|
|
42
|
+
*
|
|
43
|
+
* A relative entry resolves against the opencode config directory; an
|
|
44
|
+
* absolute one stands as written; a relative one is also checked against the
|
|
45
|
+
* kit root, because an entry pointing INTO the kit was always a plausible
|
|
46
|
+
* intent and the kit knows where its own skills are. Nothing that resolves
|
|
47
|
+
* is kept; word everything else is dropped and named in the header, the same
|
|
48
|
+
* way dropped bash rules and removed lanes are.
|
|
49
|
+
*
|
|
50
|
+
* @param {any} skills
|
|
51
|
+
* @param {string} configDir
|
|
52
|
+
* @param {string} [kitRoot] where the kit itself lives, when overridable
|
|
53
|
+
* @returns {{ skills: any, dropped: string[] }}
|
|
54
|
+
*/
|
|
55
|
+
export declare function cleanSkillPaths(skills: any, configDir: string, kitRoot?: string): {
|
|
56
|
+
skills: any;
|
|
57
|
+
dropped: string[];
|
|
58
|
+
};
|
|
30
59
|
/**
|
|
31
60
|
* The memory plugin this kit can turn on.
|
|
32
61
|
*
|
|
@@ -122,11 +151,15 @@ export declare const BASH_ALLOWLIST: string[];
|
|
|
122
151
|
export { BASH_DENYLIST } from "./denylist.js";
|
|
123
152
|
/**
|
|
124
153
|
* @param {Profile} p
|
|
125
|
-
* @param {{ base?: Record<string, any>, comments?: boolean, unhealthy?: Set<string
|
|
154
|
+
* @param {{ base?: Record<string, any>, comments?: boolean, unhealthy?: Set<string>,
|
|
155
|
+
* configDir?: string, kitRoot?: string, skills?: boolean }} [opts]
|
|
126
156
|
* @returns {string}
|
|
127
157
|
*/
|
|
128
158
|
export declare function generateConfig(p: Profile, opts?: {
|
|
129
159
|
base?: Record<string, any>;
|
|
130
160
|
comments?: boolean;
|
|
131
161
|
unhealthy?: Set<string>;
|
|
162
|
+
configDir?: string;
|
|
163
|
+
kitRoot?: string;
|
|
164
|
+
skills?: boolean;
|
|
132
165
|
}): string;
|
package/dist/effort.d.ts
CHANGED
|
@@ -35,12 +35,23 @@ export type EffortResult = {
|
|
|
35
35
|
*/
|
|
36
36
|
export declare const MANAGED_ROLES: string[];
|
|
37
37
|
/**
|
|
38
|
+
* The spent routes the effort plan honours.
|
|
39
|
+
*
|
|
40
|
+
* `opts.unhealthy` is a bare-model set a caller computed already - the one
|
|
41
|
+
* contract the tests and the CLI use. `opts.dir` is the project root, and it
|
|
42
|
+
* asks the plan to read the health file itself under the profile's OWN
|
|
43
|
+
* provider: a health file keyed `openrouter/<x>` must not read as a spent
|
|
44
|
+
* `opencode/<x>`, and a bare set has already lost the provider it came from,
|
|
45
|
+
* so the caller cannot narrow it after the fact. Passing both is the
|
|
46
|
+
* caller's narrowed set, and it wins.
|
|
47
|
+
*
|
|
38
48
|
* @param {string} profileId
|
|
39
|
-
* @param {{ unhealthy?: Set<string
|
|
49
|
+
* @param {{ unhealthy?: Set<string>, dir?: string }} [opts]
|
|
40
50
|
* @returns {EffortResult}
|
|
41
51
|
*/
|
|
42
52
|
export declare function planEffort(profileId: string, opts?: {
|
|
43
53
|
unhealthy?: Set<string>;
|
|
54
|
+
dir?: string;
|
|
44
55
|
}): EffortResult;
|
|
45
56
|
/**
|
|
46
57
|
* Mutate the resolved OpenCode config so each managed agent declares its own
|
package/dist/guard.d.ts
CHANGED
|
@@ -8,6 +8,11 @@ export declare const MARKER = "[opencode-harness-kit] blocked";
|
|
|
8
8
|
* markers, and a plain unified diff with `--- a/path` and `+++ b/path`
|
|
9
9
|
* headers.
|
|
10
10
|
*
|
|
11
|
+
* An update may also carry `*** Move to: path`, which is the path the file
|
|
12
|
+
* is written TO. Reading only the `*** Update File:` line checked the file
|
|
13
|
+
* the patch read from and left the destination unchecked, so a patch could
|
|
14
|
+
* move a file out of the project while every path it named was inside it.
|
|
15
|
+
*
|
|
11
16
|
* A unified diff names the file TWICE: `--- a/path` is where the change
|
|
12
17
|
* comes FROM, `+++ b/path` is where it goes TO. A deletion is `--- a/path`
|
|
13
18
|
* and `+++ /dev/null`, so the path that has to be scope-checked is the one
|
package/dist/health.d.ts
CHANGED
|
@@ -110,11 +110,22 @@ export declare function unhealthyRoutes(dir: string): Record<string, SpentEntry>
|
|
|
110
110
|
* lane chains list bare model ids, so the prefix is dropped here. Comparing
|
|
111
111
|
* the two directly would never match, and a spent route would look healthy.
|
|
112
112
|
*
|
|
113
|
+
* The drop collides when two providers host the same model id: a recorded
|
|
114
|
+
* `openrouter/<x>` then reads as a spent `opencode/<x>`, and every lane whose
|
|
115
|
+
* chain names the opencode one is pushed off a route that is fine. `provider`
|
|
116
|
+
* narrows the answer to the routes a session of THAT provider can actually
|
|
117
|
+
* hit - a provider-qualified key for another provider is dropped, and a key
|
|
118
|
+
* with no provider at all is kept, because a bare key is a standing statement
|
|
119
|
+
* about the model id and it is not readable as any narrower one. Callers
|
|
120
|
+
* including the router, whose lane set may not share one provider, keep the
|
|
121
|
+
* unfiltered call and its old behaviour.
|
|
122
|
+
*
|
|
113
123
|
* A route whose window has passed is not spent any more, and is not returned
|
|
114
124
|
* here: the provider's quota comes back at 00:00 UTC, and a lane that stays
|
|
115
125
|
* on its fallback forever is a lane that never comes back either.
|
|
116
126
|
*
|
|
117
127
|
* @param {string} dir the project root
|
|
128
|
+
* @param {string} [provider] only count routes served by this provider
|
|
118
129
|
* @returns {Set<string>}
|
|
119
130
|
*/
|
|
120
|
-
export declare function unhealthyModels(dir: string): Set<string>;
|
|
131
|
+
export declare function unhealthyModels(dir: string, provider?: string): Set<string>;
|