contextos-agents 2.0.0-beta.3 → 2.0.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/.agents/doctor.js +7 -20
- package/LICENSE +201 -21
- package/NOTICE +4 -0
- package/README.md +14 -18
- package/bin/commands/update.js +7 -8
- package/package.json +8 -12
- package/benchmarks/v2/analysis/statistics.js +0 -140
- package/benchmarks/v2/analysis/stats.js +0 -69
- package/benchmarks/v2/arms/arm-definitions.js +0 -79
- package/benchmarks/v2/dataset.schema.json +0 -34
- package/benchmarks/v2/evaluators/index.js +0 -25
- package/benchmarks/v2/evaluators/verified-success.js +0 -116
- package/benchmarks/v2/harness/runner.js +0 -88
- package/benchmarks/v2/pilot-tasks.json +0 -392
package/.agents/doctor.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Implements Milestone 8 Doctor v2 specification:
|
|
6
6
|
* - Standardized status outcomes: PASS, WARN, FAIL, SKIP, UNVERIFIED, RECOVERY_REQUIRED
|
|
7
7
|
* - Deep diagnostic checks:
|
|
8
|
-
* 1. Node.js environment (Node
|
|
8
|
+
* 1. Node.js environment (Node 22+ for the stable Core)
|
|
9
9
|
* 2. Git availability & version
|
|
10
10
|
* 3. Filesystem permissions and path containment
|
|
11
11
|
* 4. Manifests & schema compliance
|
|
@@ -76,33 +76,20 @@ function checkNodeVersion() {
|
|
|
76
76
|
ok: false,
|
|
77
77
|
version,
|
|
78
78
|
message: `${version} (unknown format)`,
|
|
79
|
-
remediation: 'Install Node.js >=
|
|
79
|
+
remediation: 'Install Node.js >= 22.0.0 from https://nodejs.org',
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
const major = parseInt(match[1], 10);
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
// Core requires Node >= 18.0.0 (or 16.7.0 for basic cpSync). Runtime requires Node >= 20.0.0.
|
|
87
|
-
if (major < 18) {
|
|
84
|
+
// Stable Core requires Node.js 22 or newer.
|
|
85
|
+
if (major < 22) {
|
|
88
86
|
return {
|
|
89
87
|
id: 'node_version',
|
|
90
88
|
status: STATUS.FAIL,
|
|
91
89
|
ok: false,
|
|
92
90
|
version,
|
|
93
|
-
message: `Node.js ${version} (<
|
|
94
|
-
remediation: 'Upgrade Node.js to >=
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (major < 20) {
|
|
99
|
-
return {
|
|
100
|
-
id: 'node_version',
|
|
101
|
-
status: STATUS.WARN,
|
|
102
|
-
ok: true,
|
|
103
|
-
version,
|
|
104
|
-
message: `Node.js ${version} (>= 18.0.0 for Core, Node 20 recommended for Runtime)`,
|
|
105
|
-
remediation: 'Upgrade to Node.js >= 20.0.0 for optimal sandbox and runtime worker support',
|
|
91
|
+
message: `Node.js ${version} (< 22.0.0, Node 22 required for Core)`,
|
|
92
|
+
remediation: 'Upgrade Node.js to >= 22.0.0 from https://nodejs.org',
|
|
106
93
|
};
|
|
107
94
|
}
|
|
108
95
|
|
|
@@ -111,7 +98,7 @@ function checkNodeVersion() {
|
|
|
111
98
|
status: STATUS.PASS,
|
|
112
99
|
ok: true,
|
|
113
100
|
version,
|
|
114
|
-
message: `Node.js ${version} (>=
|
|
101
|
+
message: `Node.js ${version} (>= 22.0.0, supported)`,
|
|
115
102
|
remediation: null,
|
|
116
103
|
};
|
|
117
104
|
}
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,201 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or exemplary damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 ContextOS Contributors
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/NOTICE
ADDED
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# <img src="./Frame%202.png" height="40" align="absmiddle" /> contextos-agents
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/contextos-agents)
|
|
4
|
-
[](https://opensource.org/licenses/Apache-2.0)
|
|
5
|
+
[](https://nodejs.org/)
|
|
6
6
|
[](https://github.com/kok-o/contextos-agents/actions/workflows/validate-skills.yml)
|
|
7
7
|
|
|
8
|
-
**One source of
|
|
8
|
+
**One version-controlled source of engineering rules for supported coding agents.**
|
|
9
9
|
|
|
10
|
-
ContextOS is a deterministic context and policy compiler for AI coding agents. It transforms your team's version-controlled engineering rules into
|
|
10
|
+
ContextOS is a deterministic context and policy compiler for AI coding agents. It transforms your team's version-controlled engineering rules into focused, verifiable context for Gemini, Claude Code, Cursor, GitHub Copilot, Aider, and Zed—and detects configuration drift in CI.
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
@@ -40,8 +40,8 @@ Most AI coding assistants suffer from two extremes: they either operate in a vac
|
|
|
40
40
|
|
|
41
41
|
### The Three Pillars
|
|
42
42
|
|
|
43
|
-
1. **Portable:** Define your engineering rules once. ContextOS exports
|
|
44
|
-
2. **
|
|
43
|
+
1. **Portable:** Define your engineering rules once. ContextOS exports configurations for supported agents (Gemini, Claude Code, Cursor, Copilot, Aider, and Zed).
|
|
44
|
+
2. **Focused:** The resolver selects rules and skills relevant to a task so agents receive less unrelated context.
|
|
45
45
|
3. **Verifiable:** Lockfiles, provenance, drift detection, and CI gates make generated agent configuration reproducible and auditable.
|
|
46
46
|
|
|
47
47
|
## How it works
|
|
@@ -121,25 +121,21 @@ jobs:
|
|
|
121
121
|
runs-on: ubuntu-latest
|
|
122
122
|
steps:
|
|
123
123
|
- uses: actions/checkout@v4
|
|
124
|
-
- uses: kok-o/contextos-agents/.github/actions/contextos-gate@
|
|
124
|
+
- uses: kok-o/contextos-agents/.github/actions/contextos-gate@v2.0.0
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
-
##
|
|
127
|
+
## Optional MCP integration (Beta)
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
The MCP server is a separate beta package. It is not part of the stable `contextos-agents` core.
|
|
130
130
|
|
|
131
|
-
|
|
132
|
-
> **Separation of Concerns:** The MCP Bridge and experimental runtime orchestration tools are distributed separately in the `@contextos/mcp` package (Beta). The `--with-mcp` flag in the Core CLI is deprecated.
|
|
131
|
+
Install it separately if you want to try the beta integration:
|
|
133
132
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
`ash
|
|
133
|
+
```bash
|
|
137
134
|
npm install --save-dev @contextos/mcp
|
|
138
135
|
npx contextos-mcp --dir .
|
|
139
|
-
|
|
136
|
+
```
|
|
140
137
|
|
|
141
|
-
The MCP
|
|
142
|
-
the explicit --enable-runtime flag and should only be used in trusted repositories.
|
|
138
|
+
The MCP server is read-only by default. Runtime execution remains experimental and is outside the stable core scope.
|
|
143
139
|
|
|
144
140
|
## Security — Third-Party Skills
|
|
145
141
|
|
|
@@ -154,4 +150,4 @@ We are open to pull requests! See [CONTRIBUTING.md](./CONTRIBUTING.md) for a ste
|
|
|
154
150
|
|
|
155
151
|
## License
|
|
156
152
|
|
|
157
|
-
Distributed under the
|
|
153
|
+
Distributed under the Apache License, Version 2.0. See [LICENSE](./LICENSE) and [NOTICE](./NOTICE) for details.
|
package/bin/commands/update.js
CHANGED
|
@@ -32,6 +32,7 @@ const {
|
|
|
32
32
|
} = require('../lib/safe-writer.js');
|
|
33
33
|
|
|
34
34
|
const pkg = require('../../package.json');
|
|
35
|
+
const profiles = require('../../.agents/profiles.js');
|
|
35
36
|
|
|
36
37
|
/**
|
|
37
38
|
* Collect all distributable files from the source .agents directory.
|
|
@@ -112,13 +113,9 @@ function planUpdate(projectDir, sourceAgentsDir, options = {}) {
|
|
|
112
113
|
// Determine active profile exclusions if available
|
|
113
114
|
let excludedSkills = [];
|
|
114
115
|
try {
|
|
115
|
-
const
|
|
116
|
-
if (
|
|
117
|
-
|
|
118
|
-
const active = profilesModule.getActiveProfile(projectDir);
|
|
119
|
-
if (active && Array.isArray(active.exclude_skills)) {
|
|
120
|
-
excludedSkills = active.exclude_skills;
|
|
121
|
-
}
|
|
116
|
+
const active = profiles.getActiveProfile(projectDir);
|
|
117
|
+
if (active && Array.isArray(active.exclude_skills)) {
|
|
118
|
+
excludedSkills = active.exclude_skills;
|
|
122
119
|
}
|
|
123
120
|
} catch {}
|
|
124
121
|
|
|
@@ -299,7 +296,9 @@ function runUpdate(projectDir = process.cwd(), options = {}) {
|
|
|
299
296
|
|
|
300
297
|
// Re-compile if ctx.js exists and not skipped
|
|
301
298
|
if (!options.skipCompile) {
|
|
302
|
-
|
|
299
|
+
// Run the compiler shipped with this package. The project's .agents/ctx.js
|
|
300
|
+
// is user-controlled and must never be executed implicitly during update.
|
|
301
|
+
const ctxPath = path.join(sourceAgentsDir, 'ctx.js');
|
|
303
302
|
if (fs.existsSync(ctxPath)) {
|
|
304
303
|
try {
|
|
305
304
|
const { execFileSync } = require('child_process');
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contextos-agents",
|
|
3
|
-
"version": "2.0.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Deterministic context and policy compiler for supported AI coding agents.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"contextos": "./bin/index.js",
|
|
7
7
|
"contextos-agents": "./bin/index.js",
|
|
8
8
|
"koko-contextos-agents": "./bin/index.js"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
|
+
"NOTICE",
|
|
11
12
|
"bin",
|
|
12
13
|
"registry.json",
|
|
13
14
|
"registry.schema.json",
|
|
@@ -35,22 +36,18 @@
|
|
|
35
36
|
".agents/workspace",
|
|
36
37
|
".agents/filesystem",
|
|
37
38
|
".agents/transaction-core",
|
|
38
|
-
".agents/customization-dx.js"
|
|
39
|
-
"benchmarks/v2"
|
|
39
|
+
".agents/customization-dx.js"
|
|
40
40
|
],
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "node .agents/ctx.js compile \u0026\u0026 node .agents/ctx.js export all",
|
|
43
43
|
"compile": "node .agents/ctx.js compile",
|
|
44
44
|
"export": "node .agents/ctx.js export gemini",
|
|
45
45
|
"validate": "node .agents/ctx.js validate",
|
|
46
|
-
"
|
|
47
|
-
"benchmark:live": "node benchmarks/run-live-benchmark.js",
|
|
48
|
-
"benchmark:runtime": "node benchmarks/run-runtime-benchmark.js",
|
|
49
|
-
"lint:md": "markdownlint README.md CONTRIBUTING.md .agents/core/skills/**/*.md --ignore .agents/generated/** --config .markdownlint.json",
|
|
46
|
+
"lint:md": "markdownlint README.md CONTRIBUTING.md GUIDE.md \".agents/core/skills/**/*.md\" --ignore \".agents/generated/**\" --config .markdownlint.json",
|
|
50
47
|
"check:secrets": "node scripts/check-secrets.js --all",
|
|
51
48
|
"setup:hooks": "node scripts/install-hooks.js",
|
|
52
49
|
"watch": "node .agents/watch.js",
|
|
53
|
-
"test": "node --test --test-concurrency=1 tests/install.test.js tests/lockfile.test.js tests/safe-writer.test.js tests/adapter-safety.test.js tests/update.test.js tests/uninstall.test.js tests/plugin-security.test.js tests/export.test.js tests/skills.test.js tests/validate.test.js tests/plugins.test.js tests/benchmark.test.js tests/profile.test.js tests/resolver.test.js tests/cli-registry.test.js tests/profile-enforcement.test.js tests/doctor-hardening.test.js tests/manifest-compiler.test.js tests/canonical-resolver.test.js tests/workspace-graph.test.js tests/profiles-v2.test.js tests/safe-path.test.js tests/project-lock.test.js tests/journaled-transaction.test.js tests/pure-adapters.test.js tests/prompt-skill-system.test.js tests/runtime-state-machine.test.js tests/verification-reviewer-pipeline.test.js tests/durable-concurrency-locks.test.js tests/transactional-git.test.js tests/sandbox-execution.test.js tests/plugin-supply-chain.test.js tests/platform-hardening.test.js tests/customization-dx.test.js tests/claims-governance.test.js tests/benchmark-v2.test.js tests/init-engine.test.js tests/mutation-paths.test.js tests/tarball-smoke.test.js",
|
|
50
|
+
"test": "node --test --test-concurrency=1 tests/install.test.js tests/lockfile.test.js tests/safe-writer.test.js tests/adapter-safety.test.js tests/update.test.js tests/uninstall.test.js tests/plugin-security.test.js tests/export.test.js tests/skills.test.js tests/validate.test.js tests/plugins.test.js tests/benchmark.test.js tests/benchmark-api.test.js tests/profile.test.js tests/resolver.test.js tests/cli-registry.test.js tests/profile-enforcement.test.js tests/doctor-hardening.test.js tests/manifest-compiler.test.js tests/canonical-resolver.test.js tests/workspace-graph.test.js tests/profiles-v2.test.js tests/safe-path.test.js tests/project-lock.test.js tests/journaled-transaction.test.js tests/pure-adapters.test.js tests/prompt-skill-system.test.js tests/runtime-state-machine.test.js tests/verification-reviewer-pipeline.test.js tests/durable-concurrency-locks.test.js tests/transactional-git.test.js tests/sandbox-execution.test.js tests/plugin-supply-chain.test.js tests/platform-hardening.test.js tests/customization-dx.test.js tests/claims-governance.test.js tests/benchmark-v2.test.js tests/init-engine.test.js tests/mutation-paths.test.js tests/tarball-smoke.test.js",
|
|
54
51
|
"prepublishOnly": "npm run validate \u0026\u0026 npm run build"
|
|
55
52
|
},
|
|
56
53
|
"keywords": [
|
|
@@ -65,11 +62,10 @@
|
|
|
65
62
|
"github-copilot",
|
|
66
63
|
"gemini",
|
|
67
64
|
"zed",
|
|
68
|
-
"mcp",
|
|
69
65
|
"contextos"
|
|
70
66
|
],
|
|
71
67
|
"author": "koko-o",
|
|
72
|
-
"license": "
|
|
68
|
+
"license": "Apache-2.0",
|
|
73
69
|
"repository": {
|
|
74
70
|
"type": "git",
|
|
75
71
|
"url": "https://github.com/kok-o/contextos-agents.git"
|
|
@@ -79,7 +75,7 @@
|
|
|
79
75
|
"url": "https://github.com/kok-o/contextos-agents/issues"
|
|
80
76
|
},
|
|
81
77
|
"engines": {
|
|
82
|
-
"node": "\u003e=
|
|
78
|
+
"node": "\u003e=22.0.0"
|
|
83
79
|
},
|
|
84
80
|
"devDependencies": {
|
|
85
81
|
"esbuild": "^0.28.2",
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* benchmarks/v2/analysis/statistics.js
|
|
3
|
-
* ContextOS Benchmark v2 — Statistical Analysis Engine
|
|
4
|
-
*
|
|
5
|
-
* Implements Section 24 of CONTEXTOS_IMPLEMENTATION_PLAN.md:
|
|
6
|
-
* - Primary metric: cost per independently verified successful task
|
|
7
|
-
* - Wilson score 95% confidence intervals for binomial success proportions
|
|
8
|
-
* - Pairwise delta comparison between Arm C/D and Arm B (Concise Checklist comparator)
|
|
9
|
-
* - Structured tabular summary generation
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
'use strict';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Calculates Wilson score 95% confidence interval for a proportion.
|
|
16
|
-
*
|
|
17
|
-
* @param {number} successes
|
|
18
|
-
* @param {number} total
|
|
19
|
-
* @param {number} [z=1.96] - 95% confidence z-score
|
|
20
|
-
* @returns {[number, number]} [lower, upper] as percentages [0, 100]
|
|
21
|
-
*/
|
|
22
|
-
function calculateWilsonInterval(successes, total, z = 1.96) {
|
|
23
|
-
if (total === 0) return [0, 0];
|
|
24
|
-
const p = successes / total;
|
|
25
|
-
const z2 = z * z;
|
|
26
|
-
const denominator = 1 + z2 / total;
|
|
27
|
-
const center = (p + z2 / (2 * total)) / denominator;
|
|
28
|
-
const margin = (z * Math.sqrt((p * (1 - p)) / total + z2 / (4 * total * total))) / denominator;
|
|
29
|
-
|
|
30
|
-
return [
|
|
31
|
-
Math.max(0, parseFloat(((center - margin) * 100).toFixed(1))),
|
|
32
|
-
Math.min(100, parseFloat(((center + margin) * 100).toFixed(1))),
|
|
33
|
-
];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
class BenchmarkStatistics {
|
|
37
|
-
/**
|
|
38
|
-
* Analyzes an array of run outcomes across experimental arms.
|
|
39
|
-
*
|
|
40
|
-
* @param {Array<Object>} runs - List of run records: { armId, success, totalCost, durationMs }
|
|
41
|
-
* @returns {Object} Comprehensive statistical summary
|
|
42
|
-
*/
|
|
43
|
-
static analyze(runs) {
|
|
44
|
-
const armsMap = {};
|
|
45
|
-
|
|
46
|
-
for (const run of runs) {
|
|
47
|
-
const { armId, success, totalCost = 0, durationMs = 0 } = run;
|
|
48
|
-
if (!armsMap[armId]) {
|
|
49
|
-
armsMap[armId] = {
|
|
50
|
-
armId,
|
|
51
|
-
totalRuns: 0,
|
|
52
|
-
successfulRuns: 0,
|
|
53
|
-
totalCost: 0,
|
|
54
|
-
totalDurationMs: 0,
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const item = armsMap[armId];
|
|
59
|
-
item.totalRuns++;
|
|
60
|
-
if (success) item.successfulRuns++;
|
|
61
|
-
item.totalCost += totalCost;
|
|
62
|
-
item.totalDurationMs += durationMs;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const armStats = {};
|
|
66
|
-
for (const [armId, d] of Object.entries(armsMap)) {
|
|
67
|
-
const successRate = d.totalRuns > 0 ? (d.successfulRuns / d.totalRuns) * 100 : 0;
|
|
68
|
-
const ci95 = calculateWilsonInterval(d.successfulRuns, d.totalRuns);
|
|
69
|
-
const costPerSuccess = d.successfulRuns > 0 ? d.totalCost / d.successfulRuns : null;
|
|
70
|
-
const avgDurationMs = d.totalRuns > 0 ? d.totalDurationMs / d.totalRuns : 0;
|
|
71
|
-
|
|
72
|
-
armStats[armId] = {
|
|
73
|
-
armId,
|
|
74
|
-
totalRuns: d.totalRuns,
|
|
75
|
-
successfulRuns: d.successfulRuns,
|
|
76
|
-
successRate: parseFloat(successRate.toFixed(1)),
|
|
77
|
-
ci95,
|
|
78
|
-
totalCost: parseFloat(d.totalCost.toFixed(4)),
|
|
79
|
-
costPerVerifiedSuccess: costPerSuccess !== null ? parseFloat(costPerSuccess.toFixed(4)) : null,
|
|
80
|
-
avgDurationMs: Math.round(avgDurationMs),
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Pairwise comparisons against Arm B (Concise Checklist)
|
|
85
|
-
const comparator = armStats['arm-b-concise-checklist'];
|
|
86
|
-
const comparisons = {};
|
|
87
|
-
|
|
88
|
-
if (comparator) {
|
|
89
|
-
for (const [armId, stat] of Object.entries(armStats)) {
|
|
90
|
-
if (armId === 'arm-b-concise-checklist') continue;
|
|
91
|
-
|
|
92
|
-
const rateDelta = parseFloat((stat.successRate - comparator.successRate).toFixed(1));
|
|
93
|
-
let costRatio = null;
|
|
94
|
-
if (comparator.costPerVerifiedSuccess && stat.costPerVerifiedSuccess) {
|
|
95
|
-
costRatio = parseFloat((stat.costPerVerifiedSuccess / comparator.costPerVerifiedSuccess).toFixed(2));
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
comparisons[armId] = {
|
|
99
|
-
vsComparator: 'arm-b-concise-checklist',
|
|
100
|
-
successRateDelta: rateDelta,
|
|
101
|
-
costRatio,
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return {
|
|
107
|
-
timestamp: Date.now(),
|
|
108
|
-
totalRunsAnalyzed: runs.length,
|
|
109
|
-
arms: armStats,
|
|
110
|
-
comparisons,
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Formats statistical analysis into an aligned markdown summary table.
|
|
116
|
-
*
|
|
117
|
-
* @param {Object} analysis
|
|
118
|
-
* @returns {string}
|
|
119
|
-
*/
|
|
120
|
-
static formatTable(analysis) {
|
|
121
|
-
const lines = [];
|
|
122
|
-
lines.push('| Arm ID | Runs | Successes | Success Rate (95% CI) | Cost / Verified Success | Avg Latency |');
|
|
123
|
-
lines.push('|---|---:|---:|---:|---:|---:|');
|
|
124
|
-
|
|
125
|
-
for (const arm of Object.values(analysis.arms)) {
|
|
126
|
-
const ciStr = `[${arm.ci95[0]}%, ${arm.ci95[1]}%]`;
|
|
127
|
-
const costStr = arm.costPerVerifiedSuccess !== null ? `$${arm.costPerVerifiedSuccess}` : 'N/A';
|
|
128
|
-
lines.push(
|
|
129
|
-
`| **${arm.armId}** | ${arm.totalRuns} | ${arm.successfulRuns} | ${arm.successRate}% ${ciStr} | ${costStr} | ${arm.avgDurationMs}ms |`
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
return lines.join('\n');
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
module.exports = {
|
|
138
|
-
calculateWilsonInterval,
|
|
139
|
-
BenchmarkStatistics,
|
|
140
|
-
};
|