@buildr-ai/buildr 0.1.0-rc.21 → 0.1.0-rc.22
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/application-payload.json +167 -155
- package/installation-origin.json +5 -5
- package/package/targets/test-context/definition.d.ts +7 -0
- package/package/targets/test-context/definition.js +114 -0
- package/package/targets/test-context/index.d.ts +5 -0
- package/package/targets/test-context/index.js +4 -0
- package/package/targets/test-context/node-runner-cli.d.ts +2 -0
- package/package/targets/test-context/node-runner-cli.js +60 -0
- package/package/targets/test-context/node-runner.d.ts +2 -0
- package/package/targets/test-context/node-runner.js +86 -0
- package/package/targets/test-context/node-test.d.ts +14 -0
- package/package/targets/test-context/node-test.js +93 -0
- package/package/targets/test-context/runtime.d.ts +2 -0
- package/package/targets/test-context/runtime.js +342 -0
- package/package/targets/test-context/types.d.ts +216 -0
- package/package/targets/test-context/types.js +1 -0
- package/package.json +11 -1
- package/payload/licenses/dependencies/ajv-LICENSE +22 -0
- package/payload/product/package/targets/runtime/skills/buildr/SKILL.md +7 -7
- package/payload/product/package.json +2 -1
- package/payload/product/{package/bootstrap/contract.yml → resources/contracts/bootstrap.yml} +1 -1
- package/payload/product/{package → resources}/manifest.yml +95 -91
- package/payload/product/resources/workspace/AGENTS.md +9 -0
- package/payload/product/{package/targets → resources}/workspace/components/buildr/openspec/component.yml +3 -3
- package/payload/product/{package/targets → resources}/workspace/components/buildr/openspec/contributions/openspec-apply-sidebar.md +1 -1
- package/payload/product/{package/targets → resources}/workspace/components/buildr/openspec/contributions/openspec-propose-sidebar.md +1 -1
- package/payload/product/{package/targets → resources}/workspace/components/buildr/openspec/contributions/openspec-update-sidebar.md +1 -1
- package/payload/product/resources/workspace/rules/buildr/core.md +40 -0
- package/payload/product/{package/targets → resources}/workspace/skills/buildr/current-knowledge-maintenance/SKILL.md +4 -4
- package/payload/product/{package/targets → resources}/workspace/skills/buildr/declaration-intake/SKILL.md +14 -8
- package/payload/product/{package/targets → resources}/workspace/skills/buildr/git-operations/SKILL.md +5 -5
- package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-development/SKILL.md +34 -16
- package/payload/product/resources/workspace/skills/buildr/task-environment/SKILL.md +55 -0
- package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-environment/references/project-environment-preparation-v1.md +1 -1
- package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-environment/templates/task-environment-plan-request.json +2 -1
- package/payload/product/resources/workspace/skills/buildr/task-finish/SKILL.md +79 -0
- package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-manager/SKILL.md +9 -1
- package/payload/product/resources/workspace/skills/buildr/task-manager/agents/openai.yaml +4 -0
- package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-triage/SKILL.md +17 -9
- package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-verification/SKILL.md +23 -15
- package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-verification/references/project-verification-v2.md +3 -1
- package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-verification/templates/project-verification.yml +6 -0
- package/payload/product/{package/targets/workspace/skills/buildr/ui-preview → resources/workspace/skills/buildr/ui-prototype}/SKILL.md +14 -12
- package/payload/product/{package/targets → resources}/workspace/skills/contracts/buildr/current-knowledge-maintenance/v2.md +3 -3
- package/payload/product/{package/targets → resources}/workspace/skills/contracts/buildr/git-operations/v1.md +1 -1
- package/payload/product/resources/workspace/skills/contracts/buildr/task-development/v2.md +67 -0
- package/payload/product/resources/workspace/skills/contracts/buildr/task-environment/v1.md +37 -0
- package/payload/product/resources/workspace/skills/contracts/buildr/task-finish/v1.md +43 -0
- package/payload/product/{package/targets → resources}/workspace/skills/contracts/buildr/task-record/v2.md +1 -1
- package/payload/product/resources/workspace/skills/contracts/buildr/task-verification/v3.md +67 -0
- package/payload/product/src/infrastructure/sqlite/migrations/0018_create_terminal_contribution_reconciliations.sql +19 -0
- package/payload/product/web-dist/assets/index-BnXBiObM.css +1 -0
- package/payload/product/web-dist/assets/index-CbM3dspL.js +39 -0
- package/payload/product/{src/interfaces/local-app/web-dist → web-dist}/index.html +2 -2
- package/payload/runtime/read-worker.cjs +53751 -34167
- package/runtime/buildr.cjs +53599 -39369
- package/test-context.mjs +12 -0
- package/payload/product/package/README.md +0 -42
- package/payload/product/package/targets/workspace/AGENTS.md +0 -5
- package/payload/product/package/targets/workspace/rules/buildr/core.md +0 -62
- package/payload/product/package/targets/workspace/skills/buildr/task-environment/SKILL.md +0 -42
- package/payload/product/package/targets/workspace/skills/buildr/task-finish/SKILL.md +0 -80
- package/payload/product/package/targets/workspace/skills/buildr/task-manager/agents/openai.yaml +0 -4
- package/payload/product/package/targets/workspace/skills/contracts/buildr/task-development/v2.md +0 -61
- package/payload/product/package/targets/workspace/skills/contracts/buildr/task-environment/v1.md +0 -37
- package/payload/product/package/targets/workspace/skills/contracts/buildr/task-finish/v1.md +0 -59
- package/payload/product/package/targets/workspace/skills/contracts/buildr/task-verification/v3.md +0 -63
- package/payload/product/src/interfaces/local-app/web-dist/assets/index-BqoyfMSY.css +0 -1
- package/payload/product/src/interfaces/local-app/web-dist/assets/index-DTqvE0TF.js +0 -39
- /package/payload/product/{package/bootstrap/guide.md → docs/bootstrap-guide.md} +0 -0
- /package/payload/product/{package/launchers/assets → resources/installation/launcher}/Buildr.icns +0 -0
- /package/payload/product/{package/launchers/assets → resources/installation/launcher}/Buildr.ico +0 -0
- /package/payload/product/{package/targets → resources}/workspace/commands/buildr/openspec/manifest.yml +0 -0
- /package/payload/product/{package/targets → resources}/workspace/components/buildr/openspec/contributions/openspec-archive-converge.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/components/buildr/openspec/contributions/openspec-explore-terminology.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/components/buildr/openspec/contributions/openspec-sync-converge.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/gitattributes +0 -0
- /package/payload/product/{package/targets → resources}/workspace/gitignore +0 -0
- /package/payload/product/{package/targets → resources}/workspace/projects/AGENTS.project.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/buildr/capability-adaptation/SKILL.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/buildr/capability-adaptation/agents/openai.yaml +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/buildr/openspec-contract-guard/SKILL.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/buildr/project-daily-progress/SKILL.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/buildr/project-testing/SKILL.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/buildr/project-testing/references/testing-model-v1.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-environment/agents/openai.yaml +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-environment/templates/project-preparation.yml +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-retrospective/SKILL.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-retrospective/agents/openai.yaml +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-review/SKILL.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-review/agents/openai.yaml +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/buildr/task-worktree/SKILL.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/buildr/terminology-governance/SKILL.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/contracts/buildr/current-knowledge-maintenance/v1.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/contracts/buildr/git-worktree-provider/v1.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/contracts/buildr/task-retrospective/v2.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/contracts/buildr/task-review/v1.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/contracts/buildr/terminology-governance/v1.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/openspec/openspec-apply-change/SKILL.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/openspec/openspec-archive-change/SKILL.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/openspec/openspec-explore/SKILL.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/openspec/openspec-propose/SKILL.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/openspec/openspec-sync-specs/SKILL.md +0 -0
- /package/payload/product/{package/targets → resources}/workspace/skills/openspec/openspec-update-change/SKILL.md +0 -0
- /package/payload/product/{src/interfaces/local-app/web-dist → web-dist}/assets/antd-NAtxFWmu.js +0 -0
- /package/payload/product/{src/interfaces/local-app/web-dist → web-dist}/assets/react-9kRp7SbA.js +0 -0
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import crypto from 'node:crypto';
|
|
2
|
+
import { canonicalContextConfiguration, contextConfigurationIdentity, normalizeContextRequest, testContextError, } from './definition.js';
|
|
3
|
+
const SCOPE_RANK = Object.freeze({ test: 1, suite: 2, worker: 3 });
|
|
4
|
+
function digest(parts) {
|
|
5
|
+
return `sha256-${crypto.createHash('sha256').update(parts.join('\0')).digest('hex')}`;
|
|
6
|
+
}
|
|
7
|
+
function inspectDisposition(value) {
|
|
8
|
+
if (value == null || value === true || value === 'clean' || value.status === 'clean')
|
|
9
|
+
return { dirty: false, reason: null };
|
|
10
|
+
if (value === false || value === 'dirty')
|
|
11
|
+
return { dirty: true, reason: 'provider-inspection' };
|
|
12
|
+
if (value?.dirty === true || value?.status === 'dirty')
|
|
13
|
+
return { dirty: true, reason: value.reason ?? 'provider-inspection' };
|
|
14
|
+
throw testContextError('test_context_inspection_invalid', 'Context inspect() returned an unsupported disposition.', { value });
|
|
15
|
+
}
|
|
16
|
+
function scopeIdentity(definition, owner) {
|
|
17
|
+
if (definition.scope === 'worker')
|
|
18
|
+
return 'worker';
|
|
19
|
+
if (definition.scope === 'suite') {
|
|
20
|
+
if (!owner.suiteId)
|
|
21
|
+
throw testContextError('test_context_scope_identity_missing', `Suite Context ${definition.key} requires suiteId.`);
|
|
22
|
+
return `suite:${owner.suiteId}`;
|
|
23
|
+
}
|
|
24
|
+
if (!owner.testId)
|
|
25
|
+
throw testContextError('test_context_scope_identity_missing', `Test Context ${definition.key} requires testId.`);
|
|
26
|
+
return `test:${owner.testId}`;
|
|
27
|
+
}
|
|
28
|
+
function dependencyConfig(dependency, parentConfig) {
|
|
29
|
+
return typeof dependency.config === 'function' ? dependency.config(parentConfig) : dependency.config;
|
|
30
|
+
}
|
|
31
|
+
export function createTestContextRuntime(options = {}) {
|
|
32
|
+
const entries = new Map();
|
|
33
|
+
const activeLeases = new Set();
|
|
34
|
+
const events = [];
|
|
35
|
+
let sequence = 0;
|
|
36
|
+
let closed = false;
|
|
37
|
+
const record = (event) => {
|
|
38
|
+
const item = Object.freeze({ sequence: ++sequence, observedAt: new Date().toISOString(), pid: process.pid, ...event });
|
|
39
|
+
events.push(item);
|
|
40
|
+
options.onEvent?.(item);
|
|
41
|
+
return item;
|
|
42
|
+
};
|
|
43
|
+
const validateGraph = (definition, stack = [], visited = new Set()) => {
|
|
44
|
+
if (stack.includes(definition.key)) {
|
|
45
|
+
const cycle = [...stack.slice(stack.indexOf(definition.key)), definition.key];
|
|
46
|
+
throw testContextError('test_context_dependency_cycle', 'Context dependency graph contains a cycle.', { cycle });
|
|
47
|
+
}
|
|
48
|
+
if (visited.has(definition))
|
|
49
|
+
return;
|
|
50
|
+
visited.add(definition);
|
|
51
|
+
for (const dependency of definition.dependencies) {
|
|
52
|
+
if (SCOPE_RANK[dependency.definition.scope] < SCOPE_RANK[definition.scope]) {
|
|
53
|
+
throw testContextError('test_context_dependency_scope_invalid', `${definition.key} cannot depend on shorter-lived ${dependency.definition.key}.`, {
|
|
54
|
+
context: definition.key,
|
|
55
|
+
dependency: dependency.definition.key,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
validateGraph(dependency.definition, [...stack, definition.key], visited);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const ensureEntry = async (definition, config, owner) => {
|
|
62
|
+
if (closed)
|
|
63
|
+
throw testContextError('test_context_runtime_closed', 'Test Context Runtime is closed.');
|
|
64
|
+
validateGraph(definition);
|
|
65
|
+
const dependencies = [];
|
|
66
|
+
for (const dependency of definition.dependencies) {
|
|
67
|
+
dependencies.push(await ensureEntry(dependency.definition, dependencyConfig(dependency, config), owner));
|
|
68
|
+
}
|
|
69
|
+
const normalizedConfig = canonicalContextConfiguration(config);
|
|
70
|
+
const sourceIdentity = typeof definition.sourceIdentity === 'function'
|
|
71
|
+
? await definition.sourceIdentity({ config })
|
|
72
|
+
: definition.sourceIdentity ?? 'source:unspecified';
|
|
73
|
+
if (typeof sourceIdentity !== 'string' || !sourceIdentity)
|
|
74
|
+
throw testContextError('test_context_source_identity_invalid', `${definition.key} returned an invalid source identity.`);
|
|
75
|
+
const identity = digest([
|
|
76
|
+
definition.key,
|
|
77
|
+
contextConfigurationIdentity(config),
|
|
78
|
+
sourceIdentity,
|
|
79
|
+
...dependencies.map((entry) => entry.identity),
|
|
80
|
+
]);
|
|
81
|
+
const scope = scopeIdentity(definition, owner);
|
|
82
|
+
const cacheKey = `${definition.key}:${scope}:${identity}`;
|
|
83
|
+
let entry = entries.get(cacheKey);
|
|
84
|
+
if (entry) {
|
|
85
|
+
if (entry.creating)
|
|
86
|
+
await entry.creating;
|
|
87
|
+
record({ operation: 'cache-hit', context: definition.key, cacheKey, identity, scope });
|
|
88
|
+
return entry;
|
|
89
|
+
}
|
|
90
|
+
entry = {
|
|
91
|
+
cacheKey,
|
|
92
|
+
definition,
|
|
93
|
+
config: JSON.parse(normalizedConfig),
|
|
94
|
+
identity,
|
|
95
|
+
scope,
|
|
96
|
+
dependencies,
|
|
97
|
+
state: null,
|
|
98
|
+
active: 0,
|
|
99
|
+
waiters: [],
|
|
100
|
+
dirty: false,
|
|
101
|
+
dirtyReason: null,
|
|
102
|
+
createdSequence: sequence + 1,
|
|
103
|
+
creating: null,
|
|
104
|
+
destroyed: false,
|
|
105
|
+
};
|
|
106
|
+
entries.set(cacheKey, entry);
|
|
107
|
+
const startedAt = Date.now();
|
|
108
|
+
const current = entry;
|
|
109
|
+
current.creating = (async () => {
|
|
110
|
+
try {
|
|
111
|
+
current.state = await current.definition.create({
|
|
112
|
+
config: current.config,
|
|
113
|
+
identity,
|
|
114
|
+
dependencies: Object.freeze(Object.fromEntries(dependencies.map((item) => [item.definition.id, item.state]))),
|
|
115
|
+
record,
|
|
116
|
+
});
|
|
117
|
+
record({ operation: 'create', context: definition.key, cacheKey, identity, scope, durationMs: Date.now() - startedAt });
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
entries.delete(cacheKey);
|
|
121
|
+
const failure = error;
|
|
122
|
+
record({ operation: 'create', context: definition.key, cacheKey, identity, scope, durationMs: Date.now() - startedAt, status: 'failed', error: failure.message });
|
|
123
|
+
throw error;
|
|
124
|
+
}
|
|
125
|
+
finally {
|
|
126
|
+
current.creating = null;
|
|
127
|
+
}
|
|
128
|
+
})();
|
|
129
|
+
await current.creating;
|
|
130
|
+
return current;
|
|
131
|
+
};
|
|
132
|
+
const waitForEntry = async (entry) => {
|
|
133
|
+
if (entry.definition.parallelSafety !== 'exclusive' || entry.active === 0)
|
|
134
|
+
return 0;
|
|
135
|
+
const startedAt = Date.now();
|
|
136
|
+
await new Promise((resolve) => entry.waiters.push(resolve));
|
|
137
|
+
return Date.now() - startedAt;
|
|
138
|
+
};
|
|
139
|
+
const activateEntry = async (entry) => {
|
|
140
|
+
const waitMs = await waitForEntry(entry);
|
|
141
|
+
entry.active += 1;
|
|
142
|
+
if (waitMs > 0)
|
|
143
|
+
record({ operation: 'wait', context: entry.definition.key, cacheKey: entry.cacheKey, identity: entry.identity, durationMs: waitMs });
|
|
144
|
+
};
|
|
145
|
+
const deactivateEntry = (entry) => {
|
|
146
|
+
entry.active -= 1;
|
|
147
|
+
if (entry.active < 0)
|
|
148
|
+
throw testContextError('test_context_lease_invalid', `${entry.definition.key} active lease count became negative.`);
|
|
149
|
+
if (entry.active === 0)
|
|
150
|
+
entry.waiters.shift()?.();
|
|
151
|
+
};
|
|
152
|
+
const destroyEntry = async (entry, reason) => {
|
|
153
|
+
if (entry.destroyed)
|
|
154
|
+
return;
|
|
155
|
+
if (entry.active !== 0)
|
|
156
|
+
throw testContextError('test_context_destroy_active', `Cannot destroy active Context ${entry.definition.key}.`, { active: entry.active });
|
|
157
|
+
const startedAt = Date.now();
|
|
158
|
+
entry.destroyed = true;
|
|
159
|
+
entries.delete(entry.cacheKey);
|
|
160
|
+
if (entry.dirty)
|
|
161
|
+
record({ operation: 'evict', context: entry.definition.key, cacheKey: entry.cacheKey, identity: entry.identity, reason });
|
|
162
|
+
try {
|
|
163
|
+
await entry.definition.destroy?.({ state: entry.state, config: entry.config, identity: entry.identity, reason, record });
|
|
164
|
+
record({ operation: 'destroy', context: entry.definition.key, cacheKey: entry.cacheKey, identity: entry.identity, durationMs: Date.now() - startedAt, reason });
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
const failure = error;
|
|
168
|
+
record({ operation: 'destroy', context: entry.definition.key, cacheKey: entry.cacheKey, identity: entry.identity, durationMs: Date.now() - startedAt, reason, status: 'failed', error: failure.message });
|
|
169
|
+
throw error;
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
const acquire = async (requests, owner = {}) => {
|
|
173
|
+
const normalized = Object.entries(requests ?? {}).map(([alias, request]) => normalizeContextRequest(request, alias));
|
|
174
|
+
if (normalized.length === 0)
|
|
175
|
+
throw testContextError('test_context_request_invalid', 'At least one Context request is required.');
|
|
176
|
+
if (new Set(normalized.map((item) => item.alias)).size !== normalized.length)
|
|
177
|
+
throw testContextError('test_context_request_invalid', 'Context request aliases must be unique.');
|
|
178
|
+
const requested = [];
|
|
179
|
+
for (const request of normalized)
|
|
180
|
+
requested.push({ request, entry: await ensureEntry(request.definition, request.config, owner) });
|
|
181
|
+
const reachableEntries = new Map();
|
|
182
|
+
const collectEntry = (entry) => {
|
|
183
|
+
for (const dependency of entry.dependencies)
|
|
184
|
+
collectEntry(dependency);
|
|
185
|
+
reachableEntries.set(entry.cacheKey, entry);
|
|
186
|
+
};
|
|
187
|
+
for (const item of requested)
|
|
188
|
+
collectEntry(item.entry);
|
|
189
|
+
const lockEntries = [...reachableEntries.values()].sort((left, right) => left.cacheKey.localeCompare(right.cacheKey));
|
|
190
|
+
for (const entry of lockEntries)
|
|
191
|
+
await activateEntry(entry);
|
|
192
|
+
const acquired = [];
|
|
193
|
+
const values = {};
|
|
194
|
+
const startedAt = Date.now();
|
|
195
|
+
try {
|
|
196
|
+
for (const item of requested) {
|
|
197
|
+
const value = item.entry.definition.acquire
|
|
198
|
+
? await item.entry.definition.acquire({ state: item.entry.state, config: item.entry.config, identity: item.entry.identity, owner, record })
|
|
199
|
+
: item.entry.state;
|
|
200
|
+
if (item.entry.definition.parallelSafety === 'isolated' && value === item.entry.state) {
|
|
201
|
+
throw testContextError('test_context_isolation_invalid', `${item.entry.definition.key} must acquire an isolated value.`);
|
|
202
|
+
}
|
|
203
|
+
acquired.push({ ...item, value, dirty: false, dirtyReason: null });
|
|
204
|
+
values[item.request.alias] = value;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
for (const entry of lockEntries.reverse())
|
|
209
|
+
deactivateEntry(entry);
|
|
210
|
+
throw error;
|
|
211
|
+
}
|
|
212
|
+
let released = false;
|
|
213
|
+
const lease = {
|
|
214
|
+
values: Object.freeze(values),
|
|
215
|
+
identities: Object.freeze(Object.fromEntries(requested.map((item) => [item.request.alias, item.entry.identity]))),
|
|
216
|
+
markDirty(alias, reason = 'test-marked-dirty') {
|
|
217
|
+
const item = acquired.find((candidate) => candidate.request.alias === alias);
|
|
218
|
+
if (!item)
|
|
219
|
+
throw testContextError('test_context_dirty_alias_unknown', `Unknown Context alias: ${alias}`);
|
|
220
|
+
item.dirty = true;
|
|
221
|
+
item.dirtyReason = reason;
|
|
222
|
+
},
|
|
223
|
+
async release(releaseOptions = {}) {
|
|
224
|
+
if (released)
|
|
225
|
+
return Object.freeze({ status: 'already-released' });
|
|
226
|
+
released = true;
|
|
227
|
+
activeLeases.delete(lease);
|
|
228
|
+
const failures = [];
|
|
229
|
+
for (const item of [...acquired].reverse()) {
|
|
230
|
+
const hookContext = { state: item.entry.state, value: item.value, config: item.entry.config, identity: item.entry.identity, owner, outcome: releaseOptions.outcome ?? 'unknown', record };
|
|
231
|
+
try {
|
|
232
|
+
await item.entry.definition.release?.(hookContext);
|
|
233
|
+
}
|
|
234
|
+
catch (error) {
|
|
235
|
+
failures.push(error);
|
|
236
|
+
item.dirty = true;
|
|
237
|
+
item.dirtyReason ??= 'release-failed';
|
|
238
|
+
}
|
|
239
|
+
try {
|
|
240
|
+
const inspection = inspectDisposition(await item.entry.definition.inspect?.(hookContext));
|
|
241
|
+
if (inspection.dirty) {
|
|
242
|
+
item.dirty = true;
|
|
243
|
+
item.dirtyReason ??= inspection.reason;
|
|
244
|
+
failures.push(testContextError('test_context_dirty_detected', `${item.entry.definition.key} inspect() detected unexpected drift.`, { reason: inspection.reason }));
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
catch (error) {
|
|
248
|
+
failures.push(error);
|
|
249
|
+
item.dirty = true;
|
|
250
|
+
item.dirtyReason ??= 'inspect-failed';
|
|
251
|
+
}
|
|
252
|
+
if (item.dirty) {
|
|
253
|
+
item.entry.dirty = true;
|
|
254
|
+
item.entry.dirtyReason ??= item.dirtyReason;
|
|
255
|
+
record({ operation: 'dirty', context: item.entry.definition.key, cacheKey: item.entry.cacheKey, identity: item.entry.identity, reason: item.dirtyReason ?? undefined });
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
for (const entry of [...lockEntries].reverse())
|
|
259
|
+
deactivateEntry(entry);
|
|
260
|
+
for (const entry of [...lockEntries].reverse()) {
|
|
261
|
+
if (entry.active !== 0)
|
|
262
|
+
continue;
|
|
263
|
+
if (!entry.dirty && entry.definition.reset) {
|
|
264
|
+
const resetStartedAt = Date.now();
|
|
265
|
+
try {
|
|
266
|
+
await entry.definition.reset({ state: entry.state, config: entry.config, identity: entry.identity, owner, record });
|
|
267
|
+
record({ operation: 'reset', context: entry.definition.key, cacheKey: entry.cacheKey, identity: entry.identity, durationMs: Date.now() - resetStartedAt });
|
|
268
|
+
}
|
|
269
|
+
catch (error) {
|
|
270
|
+
failures.push(error);
|
|
271
|
+
entry.dirty = true;
|
|
272
|
+
entry.dirtyReason ??= 'reset-failed';
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
if (entry.definition.scope === 'test' || entry.dirty) {
|
|
276
|
+
try {
|
|
277
|
+
await destroyEntry(entry, entry.dirty ? entry.dirtyReason ?? 'dirty' : 'test-scope-complete');
|
|
278
|
+
}
|
|
279
|
+
catch (error) {
|
|
280
|
+
failures.push(error);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
record({ operation: 'release', contexts: acquired.map((item) => item.entry.definition.key), durationMs: Date.now() - startedAt, status: failures.length ? 'failed' : 'released' });
|
|
285
|
+
if (failures.length === 1)
|
|
286
|
+
throw failures[0];
|
|
287
|
+
if (failures.length > 1)
|
|
288
|
+
throw new AggregateError(failures, 'Test Context release failed.');
|
|
289
|
+
return Object.freeze({ status: 'released' });
|
|
290
|
+
},
|
|
291
|
+
};
|
|
292
|
+
activeLeases.add(lease);
|
|
293
|
+
record({ operation: 'acquire', contexts: acquired.map((item) => item.entry.definition.key), durationMs: Date.now() - startedAt, owner });
|
|
294
|
+
return Object.freeze(lease);
|
|
295
|
+
};
|
|
296
|
+
const closeSuite = async (suiteId) => {
|
|
297
|
+
const selected = [...entries.values()].filter((entry) => entry.definition.scope === 'suite' && entry.scope === `suite:${suiteId}`)
|
|
298
|
+
.sort((left, right) => right.createdSequence - left.createdSequence);
|
|
299
|
+
for (const entry of selected)
|
|
300
|
+
await destroyEntry(entry, 'suite-close');
|
|
301
|
+
return Object.freeze({ status: 'closed', suiteId, destroyed: selected.length });
|
|
302
|
+
};
|
|
303
|
+
const close = async () => {
|
|
304
|
+
if (closed)
|
|
305
|
+
return Object.freeze({ status: 'already-closed', events: Object.freeze([...events]) });
|
|
306
|
+
const failures = [];
|
|
307
|
+
for (const lease of [...activeLeases]) {
|
|
308
|
+
try {
|
|
309
|
+
await lease.release({ outcome: 'runtime-close' });
|
|
310
|
+
}
|
|
311
|
+
catch (error) {
|
|
312
|
+
failures.push(error);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
const selected = [...entries.values()].sort((left, right) => right.createdSequence - left.createdSequence);
|
|
316
|
+
for (const entry of selected) {
|
|
317
|
+
if (entry.destroyed)
|
|
318
|
+
continue;
|
|
319
|
+
try {
|
|
320
|
+
await destroyEntry(entry, 'runtime-close');
|
|
321
|
+
}
|
|
322
|
+
catch (error) {
|
|
323
|
+
failures.push(error);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
closed = true;
|
|
327
|
+
record({ operation: 'runtime-close', status: failures.length ? 'failed' : 'closed', destroyed: selected.length });
|
|
328
|
+
if (failures.length === 1)
|
|
329
|
+
throw failures[0];
|
|
330
|
+
if (failures.length > 1)
|
|
331
|
+
throw new AggregateError(failures, 'Test Context Runtime close failed.');
|
|
332
|
+
return Object.freeze({ status: 'closed', events: Object.freeze([...events]) });
|
|
333
|
+
};
|
|
334
|
+
return Object.freeze({
|
|
335
|
+
acquire,
|
|
336
|
+
closeSuite,
|
|
337
|
+
close,
|
|
338
|
+
record,
|
|
339
|
+
events: () => Object.freeze([...events]),
|
|
340
|
+
snapshot: () => Object.freeze({ closed, entries: entries.size, activeLeases: activeLeases.size, events: events.length }),
|
|
341
|
+
});
|
|
342
|
+
}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import type { TestContext, TestOptions } from 'node:test';
|
|
2
|
+
export type JsonPrimitive = string | number | boolean | null;
|
|
3
|
+
export type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
4
|
+
[key: string]: JsonValue;
|
|
5
|
+
};
|
|
6
|
+
export type JsonObject = {
|
|
7
|
+
[key: string]: JsonValue;
|
|
8
|
+
};
|
|
9
|
+
export type MaybePromise<T> = T | Promise<T>;
|
|
10
|
+
export type TestContextScope = 'worker' | 'suite' | 'test';
|
|
11
|
+
export type TestContextParallelSafety = 'shared' | 'exclusive' | 'isolated';
|
|
12
|
+
export type TestContextOutcome = 'passed' | 'failed' | 'unknown' | 'runtime-close' | string;
|
|
13
|
+
export interface TestContextOwner {
|
|
14
|
+
suiteId?: string;
|
|
15
|
+
testId?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface TestContextEvent {
|
|
20
|
+
sequence: number;
|
|
21
|
+
observedAt: string;
|
|
22
|
+
pid: number;
|
|
23
|
+
operation: string;
|
|
24
|
+
context?: string;
|
|
25
|
+
cacheKey?: string;
|
|
26
|
+
identity?: string;
|
|
27
|
+
scope?: string;
|
|
28
|
+
durationMs?: number;
|
|
29
|
+
status?: string;
|
|
30
|
+
error?: string;
|
|
31
|
+
reason?: string;
|
|
32
|
+
owner?: TestContextOwner;
|
|
33
|
+
contexts?: readonly string[];
|
|
34
|
+
[key: string]: unknown;
|
|
35
|
+
}
|
|
36
|
+
export interface TestContextError extends Error {
|
|
37
|
+
code: string;
|
|
38
|
+
details: Readonly<Record<string, unknown>>;
|
|
39
|
+
}
|
|
40
|
+
export interface TestContextHookBase<Config extends JsonValue = JsonObject> {
|
|
41
|
+
config: Config;
|
|
42
|
+
identity: string;
|
|
43
|
+
record: (event: Omit<TestContextEvent, 'sequence' | 'observedAt' | 'pid'>) => TestContextEvent;
|
|
44
|
+
}
|
|
45
|
+
export interface TestContextCreateHook<Config extends JsonValue, Dependencies extends Readonly<Record<string, unknown>>> extends TestContextHookBase<Config> {
|
|
46
|
+
dependencies: Dependencies;
|
|
47
|
+
}
|
|
48
|
+
export interface TestContextAcquireHook<State, Config extends JsonValue> extends TestContextHookBase<Config> {
|
|
49
|
+
state: State;
|
|
50
|
+
owner: TestContextOwner;
|
|
51
|
+
}
|
|
52
|
+
export interface TestContextReleaseHook<State, Acquired, Config extends JsonValue> extends TestContextAcquireHook<State, Config> {
|
|
53
|
+
value: Acquired;
|
|
54
|
+
outcome: TestContextOutcome;
|
|
55
|
+
}
|
|
56
|
+
export interface TestContextResetHook<State, Config extends JsonValue> extends TestContextAcquireHook<State, Config> {
|
|
57
|
+
}
|
|
58
|
+
export interface TestContextDestroyHook<State, Config extends JsonValue> extends TestContextHookBase<Config> {
|
|
59
|
+
state: State;
|
|
60
|
+
reason: string;
|
|
61
|
+
}
|
|
62
|
+
export type TestContextInspection = boolean | 'clean' | 'dirty' | {
|
|
63
|
+
status?: 'clean' | 'dirty';
|
|
64
|
+
dirty?: boolean;
|
|
65
|
+
reason?: string;
|
|
66
|
+
} | null | undefined;
|
|
67
|
+
export interface TestContextDefinition<Id extends string = string, State = unknown, Config extends JsonValue = JsonObject, Acquired = State> {
|
|
68
|
+
readonly id: Id;
|
|
69
|
+
readonly version: number;
|
|
70
|
+
readonly key: `${Id}/v${number}`;
|
|
71
|
+
readonly scope: TestContextScope;
|
|
72
|
+
readonly parallelSafety: TestContextParallelSafety;
|
|
73
|
+
readonly dependencies: readonly NormalizedTestContextDependency[];
|
|
74
|
+
readonly create: (context: TestContextCreateHook<Config, Readonly<Record<string, unknown>>>) => MaybePromise<State>;
|
|
75
|
+
readonly acquire: ((context: TestContextAcquireHook<State, Config>) => MaybePromise<Acquired>) | null;
|
|
76
|
+
readonly release: ((context: TestContextReleaseHook<State, Acquired, Config>) => MaybePromise<void>) | null;
|
|
77
|
+
readonly reset: ((context: TestContextResetHook<State, Config>) => MaybePromise<void>) | null;
|
|
78
|
+
readonly inspect: ((context: TestContextReleaseHook<State, Acquired, Config>) => MaybePromise<TestContextInspection>) | null;
|
|
79
|
+
readonly destroy: ((context: TestContextDestroyHook<State, Config>) => MaybePromise<void>) | null;
|
|
80
|
+
readonly sourceIdentity: string | ((context: {
|
|
81
|
+
config: Config;
|
|
82
|
+
}) => MaybePromise<string>) | null;
|
|
83
|
+
}
|
|
84
|
+
export type AnyTestContextDefinition = TestContextDefinition<string, any, any, any>;
|
|
85
|
+
export type TestContextDependency<Definition extends AnyTestContextDefinition = AnyTestContextDefinition> = Definition | {
|
|
86
|
+
definition: Definition;
|
|
87
|
+
config?: JsonValue | ((parentConfig: JsonValue) => JsonValue);
|
|
88
|
+
};
|
|
89
|
+
export interface NormalizedTestContextDependency<Definition extends AnyTestContextDefinition = AnyTestContextDefinition> {
|
|
90
|
+
readonly definition: Definition;
|
|
91
|
+
readonly config: JsonValue | ((parentConfig: JsonValue) => JsonValue);
|
|
92
|
+
}
|
|
93
|
+
type DefinitionFromDependency<Value> = Value extends AnyTestContextDefinition ? Value : Value extends {
|
|
94
|
+
definition: infer Definition extends AnyTestContextDefinition;
|
|
95
|
+
} ? Definition : never;
|
|
96
|
+
type StateOf<Definition> = Definition extends TestContextDefinition<any, infer State, any, any> ? State : never;
|
|
97
|
+
export type TestContextDependencyValues<Dependencies extends readonly TestContextDependency[]> = Readonly<{
|
|
98
|
+
[Definition in DefinitionFromDependency<Dependencies[number]> as Definition['id']]: StateOf<Definition>;
|
|
99
|
+
}>;
|
|
100
|
+
export interface TestContextDefinitionInput<Id extends string, State, Config extends JsonValue, Acquired, Dependencies extends readonly TestContextDependency[]> {
|
|
101
|
+
id: Id;
|
|
102
|
+
version: number;
|
|
103
|
+
scope: TestContextScope;
|
|
104
|
+
parallelSafety: TestContextParallelSafety;
|
|
105
|
+
dependencies?: Dependencies;
|
|
106
|
+
create: (context: TestContextCreateHook<Config, TestContextDependencyValues<Dependencies>>) => MaybePromise<State>;
|
|
107
|
+
acquire?: (context: TestContextAcquireHook<State, Config>) => MaybePromise<Acquired>;
|
|
108
|
+
release?: (context: TestContextReleaseHook<State, Acquired, Config>) => MaybePromise<void>;
|
|
109
|
+
reset?: (context: TestContextResetHook<State, Config>) => MaybePromise<void>;
|
|
110
|
+
inspect?: (context: TestContextReleaseHook<State, Acquired, Config>) => MaybePromise<TestContextInspection>;
|
|
111
|
+
destroy?: (context: TestContextDestroyHook<State, Config>) => MaybePromise<void>;
|
|
112
|
+
sourceIdentity?: string | ((context: {
|
|
113
|
+
config: Config;
|
|
114
|
+
}) => MaybePromise<string>);
|
|
115
|
+
}
|
|
116
|
+
export type TestContextRequest<Definition extends AnyTestContextDefinition = AnyTestContextDefinition> = Definition | {
|
|
117
|
+
definition: Definition;
|
|
118
|
+
config?: Definition extends TestContextDefinition<any, any, infer Config, any> ? Config : never;
|
|
119
|
+
};
|
|
120
|
+
type ConfigOf<Definition> = Definition extends TestContextDefinition<any, any, infer Config, any> ? Config : never;
|
|
121
|
+
export interface NormalizedTestContextRequest<Definition extends AnyTestContextDefinition = AnyTestContextDefinition> {
|
|
122
|
+
readonly alias: string;
|
|
123
|
+
readonly definition: Definition;
|
|
124
|
+
readonly config: JsonValue;
|
|
125
|
+
}
|
|
126
|
+
export type TestContextRequests = Record<string, unknown>;
|
|
127
|
+
export type CheckedTestContextRequests<Requests extends TestContextRequests> = {
|
|
128
|
+
[Alias in keyof Requests]: Requests[Alias] extends infer Definition extends AnyTestContextDefinition ? Definition : Requests[Alias] extends {
|
|
129
|
+
definition: infer Definition extends AnyTestContextDefinition;
|
|
130
|
+
} ? Omit<Requests[Alias], 'config'> & {
|
|
131
|
+
definition: Definition;
|
|
132
|
+
config?: ConfigOf<Definition>;
|
|
133
|
+
} : never;
|
|
134
|
+
};
|
|
135
|
+
type DefinitionFromRequest<Value> = Value extends AnyTestContextDefinition ? Value : Value extends {
|
|
136
|
+
definition: infer Definition extends AnyTestContextDefinition;
|
|
137
|
+
} ? Definition : never;
|
|
138
|
+
type AcquiredOf<Definition> = Definition extends TestContextDefinition<any, any, any, infer Acquired> ? Acquired : never;
|
|
139
|
+
export type TestContextValues<Requests extends TestContextRequests> = Readonly<{
|
|
140
|
+
[Alias in keyof Requests]: AcquiredOf<DefinitionFromRequest<Requests[Alias]>>;
|
|
141
|
+
}>;
|
|
142
|
+
export interface TestContextLeaseControl<Requests extends TestContextRequests> {
|
|
143
|
+
readonly identities: Readonly<Record<keyof Requests & string, string>>;
|
|
144
|
+
markDirty(alias: keyof Requests & string, reason?: string): void;
|
|
145
|
+
}
|
|
146
|
+
export interface TestContextLease<Requests extends TestContextRequests> extends TestContextLeaseControl<Requests> {
|
|
147
|
+
readonly values: TestContextValues<Requests>;
|
|
148
|
+
release(options?: {
|
|
149
|
+
outcome?: TestContextOutcome;
|
|
150
|
+
}): Promise<Readonly<{
|
|
151
|
+
status: 'released' | 'already-released';
|
|
152
|
+
}>>;
|
|
153
|
+
}
|
|
154
|
+
export interface TestContextRuntimeOptions {
|
|
155
|
+
onEvent?: (event: TestContextEvent) => void;
|
|
156
|
+
}
|
|
157
|
+
export interface TestContextRuntime {
|
|
158
|
+
acquire<const Requests extends TestContextRequests>(requests: Requests & CheckedTestContextRequests<Requests>, owner?: TestContextOwner): Promise<TestContextLease<Requests>>;
|
|
159
|
+
closeSuite(suiteId: string): Promise<Readonly<{
|
|
160
|
+
status: 'closed';
|
|
161
|
+
suiteId: string;
|
|
162
|
+
destroyed: number;
|
|
163
|
+
}>>;
|
|
164
|
+
close(): Promise<Readonly<{
|
|
165
|
+
status: 'closed' | 'already-closed';
|
|
166
|
+
events: readonly TestContextEvent[];
|
|
167
|
+
}>>;
|
|
168
|
+
record(event: Omit<TestContextEvent, 'sequence' | 'observedAt' | 'pid'>): TestContextEvent;
|
|
169
|
+
events(): readonly TestContextEvent[];
|
|
170
|
+
snapshot(): Readonly<{
|
|
171
|
+
closed: boolean;
|
|
172
|
+
entries: number;
|
|
173
|
+
activeLeases: number;
|
|
174
|
+
events: number;
|
|
175
|
+
}>;
|
|
176
|
+
}
|
|
177
|
+
export interface ContextTestOptions<Requests extends TestContextRequests> extends TestOptions {
|
|
178
|
+
contexts: Requests & CheckedTestContextRequests<Requests>;
|
|
179
|
+
suiteId?: string;
|
|
180
|
+
}
|
|
181
|
+
export type ContextTestCallback<Requests extends TestContextRequests> = (context: TestContext, values: TestContextValues<Requests>, control: TestContextLeaseControl<Requests>) => unknown | Promise<unknown>;
|
|
182
|
+
export interface NodeTestContextAdapter {
|
|
183
|
+
test<const Requests extends TestContextRequests>(name: string, options: ContextTestOptions<Requests>, callback: ContextTestCallback<Requests>): unknown;
|
|
184
|
+
readonly runtime: TestContextRuntime;
|
|
185
|
+
}
|
|
186
|
+
export interface NodeTestContextFile {
|
|
187
|
+
file: string;
|
|
188
|
+
signature?: string;
|
|
189
|
+
}
|
|
190
|
+
export interface NodeTestContextHostResult {
|
|
191
|
+
readonly host: number;
|
|
192
|
+
readonly files: readonly string[];
|
|
193
|
+
readonly events: readonly TestContextEvent[];
|
|
194
|
+
readonly status: 'passed' | 'failed';
|
|
195
|
+
readonly exitCode: number | null;
|
|
196
|
+
readonly signal: NodeJS.Signals | null;
|
|
197
|
+
readonly stdout: string;
|
|
198
|
+
readonly stderr: string;
|
|
199
|
+
}
|
|
200
|
+
export interface NodeTestContextRunOptions {
|
|
201
|
+
cwd?: string;
|
|
202
|
+
files: readonly (string | NodeTestContextFile)[];
|
|
203
|
+
workers?: number;
|
|
204
|
+
nodeExecutable?: string;
|
|
205
|
+
env?: NodeJS.ProcessEnv;
|
|
206
|
+
}
|
|
207
|
+
export interface NodeTestContextRunResult {
|
|
208
|
+
readonly status: 'passed' | 'failed';
|
|
209
|
+
readonly workerCount: number;
|
|
210
|
+
readonly durationMs: number;
|
|
211
|
+
readonly hosts: readonly NodeTestContextHostResult[];
|
|
212
|
+
readonly events: readonly (TestContextEvent & {
|
|
213
|
+
host: number;
|
|
214
|
+
})[];
|
|
215
|
+
}
|
|
216
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buildr-ai/buildr",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.22",
|
|
4
4
|
"description": "Buildr CLI for managing Agent workspace assets.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -24,6 +24,14 @@
|
|
|
24
24
|
"registry": "https://registry.npmjs.org/"
|
|
25
25
|
},
|
|
26
26
|
"type": "module",
|
|
27
|
+
"exports": {
|
|
28
|
+
"./test-context": {
|
|
29
|
+
"types": "./package/targets/test-context/index.d.ts",
|
|
30
|
+
"import": "./test-context.mjs",
|
|
31
|
+
"default": "./test-context.mjs"
|
|
32
|
+
},
|
|
33
|
+
"./package.json": "./package.json"
|
|
34
|
+
},
|
|
27
35
|
"bin": {
|
|
28
36
|
"buildr": "bin/buildr.mjs"
|
|
29
37
|
},
|
|
@@ -36,6 +44,8 @@
|
|
|
36
44
|
"application-payload.json",
|
|
37
45
|
"installation-origin.json",
|
|
38
46
|
"bin/buildr.mjs",
|
|
47
|
+
"test-context.mjs",
|
|
48
|
+
"package/targets/test-context/",
|
|
39
49
|
"scripts/postinstall.mjs",
|
|
40
50
|
"runtime/buildr.cjs",
|
|
41
51
|
"payload/"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015-2021 Evgeny Poberezkin
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|