@treeseed/sdk 0.13.0-rc.122 → 0.13.0-rc.124
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/dist/agent-capacity/contracts/capacity/assignments/agent-execution.d.ts +1392 -974
- package/dist/agent-capacity/contracts/capacity/assignments/agent-execution.js +72 -27
- package/dist/agent-capacity/contracts/capacity/assignments/assignment-context-pack.d.ts +34 -34
- package/dist/agent-capacity/contracts/capacity/assignments/assignment-path.d.ts +2 -0
- package/dist/agent-capacity/contracts/capacity/assignments/assignment-path.js +13 -0
- package/dist/agent-capacity/contracts/capacity/assignments/assignment-records.d.ts +1 -0
- package/dist/agent-capacity/contracts/capacity/providers/supply-policy.d.ts +126 -1
- package/dist/agent-capacity/contracts/capacity/providers/supply-policy.js +35 -1
- package/dist/agent-capacity/contracts/capacity/workdays/assignment-allocation.d.ts +1 -3
- package/dist/agent-capacity/contracts/capacity/workdays/assignment-allocation.js +21 -15
- package/dist/agent-capacity/contracts/capacity/workdays/capability-accounting.d.ts +3 -42
- package/dist/agent-capacity/contracts/capacity/workdays/capability-accounting.js +8 -8
- package/dist/agent-capacity/contracts/capacity/workdays/workday-allocation.d.ts +227 -66
- package/dist/agent-capacity/contracts/capacity/workdays/workday-allocation.js +54 -19
- package/dist/agent-capacity/contracts/capacity/workdays/workday-records.d.ts +214 -5
- package/dist/agent-capacity/contracts/capacity/workdays/workday-records.js +19 -0
- package/dist/agent-capacity/contracts/operations/agent-team-clone.d.ts +47 -47
- package/dist/agent-capacity/contracts/projects/agents/project-agent-class.d.ts +119 -0
- package/dist/agent-capacity/contracts/projects/agents/project-agent-class.js +16 -0
- package/dist/agent-capacity/contracts/support/execution-graph.d.ts +434 -230
- package/dist/agent-capacity/contracts/support/execution-graph.js +20 -18
- package/dist/agent-capacity/contracts/support/financial-records.d.ts +2 -0
- package/dist/agent-capacity/validation/agent-definition-schema.d.ts +286 -254
- package/dist/agent-capacity/validation/agent-definition-schema.js +22 -28
- package/dist/agent-capacity/validation/agent-lab-forensics-schema.d.ts +1 -1
- package/dist/agent-capacity/validation/assignment-records.js +45 -0
- package/dist/capacity/agents/agent-capacity.d.ts +1 -0
- package/dist/capacity/agents/agent-capacity.js +1 -0
- package/dist/capacity-provider/capability-ontology.d.ts +102 -102
- package/dist/capacity-provider/client.d.ts +14 -7
- package/dist/capacity-provider/client.js +1 -4
- package/dist/capacity-provider/contracts/capacity-facts.d.ts +0 -1
- package/dist/capacity-provider/contracts/environment-profiles.d.ts +40 -40
- package/dist/capacity-provider/contracts/governance.d.ts +2 -17
- package/dist/capacity-provider/contracts/index.d.ts +2 -0
- package/dist/capacity-provider/contracts/index.js +2 -0
- package/dist/capacity-provider/core-capability-catalog.d.ts +7 -7
- package/dist/capacity-provider/environment-catalog.d.ts +22 -22
- package/dist/capacity-provider/environment-catalog.js +1 -1
- package/dist/capacity-provider/install-configuration.d.ts +4 -4
- package/dist/capacity-provider/sandbox-contracts.d.ts +54 -54
- package/dist/capacity-provider/source-workspace.d.ts +76 -76
- package/dist/capacity-provider/validation.d.ts +10 -2
- package/dist/capacity-provider/validation.js +52 -22
- package/dist/content/validation/agent-operational-content-schemas.d.ts +120 -118
- package/dist/content/validation/agent-operational-content-schemas.js +2 -0
- package/dist/content/validation/auxiliary-content-schemas.d.ts +92 -92
- package/dist/content/validation/content-model-schemas.d.ts +3155 -2512
- package/dist/content/validation/content-model-schemas.js +97 -87
- package/dist/content/validation/portable-content-data.d.ts +173 -168
- package/dist/content/validation/schema-constraints.d.ts +78 -0
- package/dist/content/validation/schema-constraints.js +149 -0
- package/dist/deployment/ai/storage.d.ts +20 -20
- package/dist/deployment/ai-hosting.d.ts +12 -12
- package/dist/deployment/ai-instance.d.ts +12 -12
- package/dist/deployment/ai-mode.d.ts +34 -34
- package/dist/deployment/hosted-topology-template.d.ts +25 -25
- package/dist/deployment/hosted-topology.d.ts +146 -146
- package/dist/deployment/postgres/transfer.d.ts +2 -2
- package/dist/deployment/schemas.d.ts +504 -504
- package/dist/development/schemas.d.ts +325 -325
- package/dist/graph/context-query-contracts.js +1 -1
- package/dist/guarantees/index.d.ts +26 -2
- package/dist/identity/contracts.js +6 -1
- package/dist/operator-contracts/canonical-command-tree.js +22 -8
- package/dist/operator-contracts/catalog/agents/agent-team-clone-operations.d.ts +27 -27
- package/dist/operator-contracts/catalog/capability-ontology-operations.d.ts +25 -25
- package/dist/operator-contracts/catalog/commands/command-tree-builders.d.ts +11 -9
- package/dist/operator-contracts/catalog/communication-operations.d.ts +108 -90
- package/dist/operator-contracts/catalog/hosted-topology-operations.d.ts +33 -33
- package/dist/operator-contracts/catalog/inbox-operations.d.ts +27 -27
- package/dist/operator-contracts/catalog/infrastructure/ai-instance-operations.d.ts +4 -4
- package/dist/operator-contracts/catalog/infrastructure/ai-instance-operations.js +2 -1
- package/dist/operator-contracts/catalog/knowledge-share-operations.d.ts +5 -5
- package/dist/operator-contracts/catalog/provider-environment-operations.d.ts +3 -3
- package/dist/operator-contracts/catalog/services/secret-operations.d.ts +16 -8
- package/dist/operator-contracts/catalog/services/secret-operations.js +2 -1
- package/dist/operator-contracts/catalog/workdays/profile-operations.d.ts +11 -11
- package/dist/operator-contracts/catalog/workdays/selection-commands.js +7 -6
- package/dist/operator-contracts/communication/contracts.d.ts +340 -198
- package/dist/operator-contracts/communication/contracts.js +6 -1
- package/dist/operator-contracts/control-plane-operation.d.ts +7 -0
- package/dist/operator-contracts/control-plane-operation.js +6 -0
- package/dist/operator-contracts/control-plane-operations.d.ts +469 -442
- package/dist/operator-contracts/control-plane-operations.js +26 -10
- package/dist/operator-contracts/inbox/contracts.d.ts +100 -100
- package/dist/operator-contracts/knowledge/contracts.d.ts +6 -6
- package/dist/operator-contracts/mcp.js +4 -3
- package/dist/operator-contracts/workday-lifecycle.d.ts +192 -2
- package/dist/operator-contracts/workday-lifecycle.js +108 -45
- package/dist/platform/agent-schema-verification.js +316 -33
- package/dist/platform/contracts.d.ts +72 -72
- package/dist/platform/schemas.d.ts +144 -36
- package/dist/platform/schemas.js +26 -0
- package/dist/platform/verification.js +4 -0
- package/dist/sdk-types/support/sdk-search-request.d.ts +2 -2
- package/dist/secrets-capability/secret-contracts.d.ts +2 -2
- package/dist/secrets-capability/shared-access.d.ts +1 -1
- package/dist/secrets-capability/shared-resources.d.ts +30 -30
- package/dist/security/encrypted-envelope.d.ts +6 -6
- package/dist/treedx/client.d.ts +4 -4
- package/dist/treedx/index.d.ts +1 -1
- package/dist/treedx/index.js +1 -0
- package/dist/treedx/types.d.ts +286 -0
- package/dist/treedx/types.js +44 -0
- package/dist/types/agents/agent-activity-profile.d.ts +1 -0
- package/guarantees/agent/golden/component-boundaries.guarantee.yaml +12 -0
- package/guarantees/agent/golden/product-custody.guarantee.yaml +12 -0
- package/guarantees/agent/golden/product.guarantee.yaml +12 -0
- package/guarantees/agent/golden/scenes/component-boundaries.scene.yaml +837 -0
- package/guarantees/agent/golden/scenes/product-custody.scene.yaml +53 -0
- package/guarantees/agent/golden/scenes/product.scene.yaml +8 -0
- package/guarantees/verifiers/golden.verifiers.yaml +1429 -0
- package/package.json +10 -5
- package/tests/acceptance/golden-product.test.ts +205 -0
- package/tests/acceptance/golden-product.ts +404 -0
- package/tests/acceptance/product/base-red.ts +73 -0
- package/tests/acceptance/product/documentation-examples.ts +68 -0
- package/tests/acceptance/product/intent-runtime.ts +145 -0
- package/tests/acceptance/product/release-output.ts +160 -0
- package/tests/acceptance/product/research-artifact.ts +87 -0
- package/tests/acceptance/product/research-revision.ts +82 -0
- package/tests/acceptance/product/research-source.ts +91 -0
- package/tests/acceptance/product/test-chain.ts +192 -0
- package/treeseed.package.yaml +147 -0
- package/dist/.treeseed-build-complete.json +0 -1
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import {verifySdkDocumentationExamples} from './documentation-examples.ts';
|
|
2
|
+
export {verifySdkDocumentationExamples} from './documentation-examples.ts';
|
|
3
|
+
import assert from 'node:assert/strict';
|
|
4
|
+
import { execFileSync } from 'node:child_process';
|
|
5
|
+
import { createHash } from 'node:crypto';
|
|
6
|
+
import { existsSync, lstatSync, realpathSync } from 'node:fs';
|
|
7
|
+
import { isAbsolute, join } from 'node:path';
|
|
8
|
+
import { assignmentReferenceSchema, type AssignmentAttempt, type AssignmentReference, type AssignmentResult } from '@treeseed/sdk/agent-capacity';
|
|
9
|
+
import { sourceWorkspaceKeySchema, sourceWorkspaceAuthorizationSchema } from '@treeseed/sdk/capacity-provider/sandbox';
|
|
10
|
+
|
|
11
|
+
export type PublishedSourceAttempt = Pick<AssignmentAttempt, 'id' | 'teamId' | 'projectId' | 'attempt' | 'workspace'>
|
|
12
|
+
& { provider: Pick<AssignmentAttempt['provider'], 'providerId'> };
|
|
13
|
+
|
|
14
|
+
const failure = 'ACCEPTANCE_SDK_NATIVE_TEST_CHAIN';
|
|
15
|
+
/** Join original reviewed predecessors; workspace compilation remains API-owned. */
|
|
16
|
+
export function verifySdkReviewedSourceInput(next: Pick<AssignmentAttempt, 'workspace' | 'predecessorResultIds' | 'createdAt'>,
|
|
17
|
+
predecessor: Pick<AssignmentResult, 'id'>, review: Pick<AssignmentResult, 'id' | 'completedAt'>, reference: AssignmentReference): void {
|
|
18
|
+
assert.ok(reference.kind === 'git', failure);
|
|
19
|
+
assert.ok(next.predecessorResultIds.includes(predecessor.id) && next.predecessorResultIds.includes(review.id), failure);
|
|
20
|
+
assert.ok(next.workspace.mode === 'git' && next.workspace.repository === reference.repository, failure);
|
|
21
|
+
assert.ok(Date.parse(review.completedAt) <= Date.parse(next.createdAt), failure);
|
|
22
|
+
}
|
|
23
|
+
const object = (value: unknown): Record<string, unknown> => {
|
|
24
|
+
assert.ok(value && typeof value === 'object' && !Array.isArray(value), failure);
|
|
25
|
+
return value as Record<string, unknown>;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** The existing fixed public owning inventory supplies the locator, never an operator path. */
|
|
29
|
+
export function sdkPublishedRepository(workspace: unknown, sandboxId: string, attempt: PublishedSourceAttempt, reference: AssignmentReference) {
|
|
30
|
+
const observation = object(workspace), scope = object(observation.scope), journals = object(observation.journals);
|
|
31
|
+
assert.equal(observation.complete, true, failure); assert.deepEqual(observation.errors, [], failure);
|
|
32
|
+
assert.equal(scope.storageRoot, '/var/lib/treeseed/agent/workspaces', failure);
|
|
33
|
+
assert.match(sandboxId, /^sandbox-[A-Za-z0-9-]{1,128}$/u, failure);
|
|
34
|
+
assert.deepEqual(object(observation.confirmation).journals, journals, failure);
|
|
35
|
+
const entry = (kind: string) => {
|
|
36
|
+
const inventory = object(journals[kind]); assert.equal(inventory.rootPresent, true, failure);
|
|
37
|
+
assert.ok(Array.isArray(inventory.entries), failure);
|
|
38
|
+
const matches = inventory.entries.map(object).filter(item => item.name === `${sandboxId}.json`);
|
|
39
|
+
assert.equal(matches.length, 1, failure); const value = matches[0]!;
|
|
40
|
+
assert.equal(value.type, 'file', failure); assert.match(String(value.digest), /^[a-f0-9]{64}$/u, failure);
|
|
41
|
+
return object(value.metadata);
|
|
42
|
+
};
|
|
43
|
+
const job = entry('jobs'), result = entry('results');
|
|
44
|
+
assert.equal(job.schemaVersion, 'treeseed.assignment-source-job/v1', failure);
|
|
45
|
+
assert.deepEqual(job.owner, { assignmentId: attempt.id, providerId: attempt.provider.providerId,
|
|
46
|
+
teamId: attempt.teamId, projectId: attempt.projectId, attempt: attempt.attempt }, failure);
|
|
47
|
+
assert.equal(result.schemaVersion, 'treeseed.source-result/v1', failure);
|
|
48
|
+
assert.equal(result.sandboxId, sandboxId, failure); assert.equal(result.leaseId, job.leaseId, failure);
|
|
49
|
+
assert.ok(typeof result.leaseId === 'string' && result.leaseId.length > 0, failure);
|
|
50
|
+
assert.equal(result.status, 'completed', failure); assert.equal(result.teardownVerified, true, failure);
|
|
51
|
+
const source = sourceWorkspaceKeySchema.parse(result.source);
|
|
52
|
+
assert.equal(source.teamId, attempt.teamId, failure); assert.equal(source.projectId, attempt.projectId, failure);
|
|
53
|
+
assert.equal(attempt.workspace.mode, 'git', failure);
|
|
54
|
+
assert.ok(attempt.workspace.mode === 'git'); assert.equal(source.commit, attempt.workspace.baseCommit, failure);
|
|
55
|
+
assert.equal(reference.kind, 'git', failure); assert.deepEqual(assignmentReferenceSchema.parse(result.sourceReference), reference, failure);
|
|
56
|
+
assert.ok(reference.kind === 'git'); assert.equal(reference.repository, attempt.workspace.repository, failure);
|
|
57
|
+
assert.equal(reference.branch, attempt.workspace.branch, failure);
|
|
58
|
+
const parsedAuthority = sourceWorkspaceAuthorizationSchema.safeParse(job.authority); assert.ok(parsedAuthority.success, failure);
|
|
59
|
+
const authority = parsedAuthority.data; assert.deepEqual(authority, job.authority, failure);
|
|
60
|
+
assert.equal(authority.assignmentId, attempt.id, failure); assert.equal(authority.providerId, attempt.provider.providerId, failure);
|
|
61
|
+
assert.equal(authority.attempt, attempt.attempt, failure); assert.deepEqual(authority.source, source, failure);
|
|
62
|
+
assert.equal(authority.mode, 'work', failure); assert.equal(authority.publication, 'simulation-branch', failure);
|
|
63
|
+
assert.ok(['upstream-public', 'simulation-local'].includes(authority.acquisition), failure);
|
|
64
|
+
assert.equal(Object.hasOwn(authority, 'credentialBindingId'), false, failure);
|
|
65
|
+
assert.equal(authority.publicationRef, reference.branch, failure);
|
|
66
|
+
|
|
67
|
+
const candidate = entry('candidates'), verification = object(candidate.verification);
|
|
68
|
+
assert.equal(candidate.state, 'published', failure);
|
|
69
|
+
assert.equal(candidate.assignmentId, attempt.id, failure); assert.equal(candidate.attempt, attempt.attempt, failure);
|
|
70
|
+
assert.equal(candidate.providerId, attempt.provider.providerId, failure); assert.equal(candidate.leaseId, job.leaseId, failure);
|
|
71
|
+
const candidateSource = sourceWorkspaceKeySchema.safeParse(candidate.source); assert.ok(candidateSource.success, failure);
|
|
72
|
+
assert.deepEqual(candidateSource.data, candidate.source, failure); assert.deepEqual(candidateSource.data, source, failure);
|
|
73
|
+
assert.equal(candidate.commit, reference.commit, failure); assert.equal(verification.baseCommit, attempt.workspace.baseCommit, failure);
|
|
74
|
+
assert.equal(verification.commit, reference.commit, failure);
|
|
75
|
+
assert.deepEqual(Object.keys(verification).sort(), ['ancestry', 'baseCommit', 'bytes', 'clean', 'commit', 'isolatedVerifier', 'objectClosure'], failure);
|
|
76
|
+
assert.ok(Number.isSafeInteger(verification.bytes) && Number(verification.bytes) > 0, failure);
|
|
77
|
+
for (const flag of ['clean', 'objectClosure', 'ancestry', 'isolatedVerifier']) assert.equal(verification[flag], true, failure);
|
|
78
|
+
assert.ok(typeof candidate.verifierId === 'string' && /^sandbox-warm-[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$/u.test(candidate.verifierId), failure);
|
|
79
|
+
assert.equal(candidate.verifierStopped, true, failure);
|
|
80
|
+
assert.ok(typeof candidate.digest === 'string' && /^sha256:[a-f0-9]{64}$/u.test(candidate.digest), failure);
|
|
81
|
+
const repository = result.simulationRepository;
|
|
82
|
+
assert.ok(typeof repository === 'string' && /^\/var\/lib\/treeseed\/agent\/workspaces\/simulations\/[a-f0-9]{64}\.git$/u.test(repository), failure);
|
|
83
|
+
return repository;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function nativePublishedGit(repository: string) {
|
|
87
|
+
assert.ok(isAbsolute(repository), failure);
|
|
88
|
+
assert.equal(realpathSync(repository), repository, failure); assert.ok(lstatSync(repository).isDirectory(), failure);
|
|
89
|
+
assert.equal(existsSync(join(repository, 'objects/info/alternates')), false, failure);
|
|
90
|
+
assert.equal(existsSync(join(repository, 'shallow')), false, failure);
|
|
91
|
+
const git = (args: string[]) => execFileSync('/usr/bin/git', ['--no-replace-objects', `--git-dir=${repository}`,
|
|
92
|
+
'-c', 'core.hooksPath=/dev/null', ...args], { timeout: 5000, maxBuffer: 32 * 1024 * 1024,
|
|
93
|
+
env: { PATH: '/usr/bin:/bin', LANG: 'C', GIT_CONFIG_NOSYSTEM: '1', GIT_CONFIG_GLOBAL: '/dev/null' } });
|
|
94
|
+
assert.equal(git(['rev-parse', '--is-bare-repository']).toString().trim(), 'true', failure);
|
|
95
|
+
return git;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** Resolve the original published assignment branch independently from its journal and result. */
|
|
99
|
+
export function verifySdkPublishedBranch(repository: string, reference: AssignmentReference) {
|
|
100
|
+
assert.equal(reference.kind, 'git', failure); assert.ok(reference.kind === 'git');
|
|
101
|
+
assert.ok(typeof reference.branch === 'string' && reference.branch.length > 0, failure);
|
|
102
|
+
assert.match(reference.commit, /^[a-f0-9]{40}$/u, failure);
|
|
103
|
+
const git = nativePublishedGit(repository), ref = `refs/heads/${reference.branch}`;
|
|
104
|
+
git(['check-ref-format', ref]);
|
|
105
|
+
assert.equal(git(['show-ref', '--verify', '--hash', ref]).toString().trim(), reference.commit, failure);
|
|
106
|
+
assert.equal(git(['rev-parse', '--verify', `${reference.commit}^{commit}`]).toString().trim(), reference.commit, failure);
|
|
107
|
+
assert.equal(git(['show-ref', '--verify', '--hash', ref]).toString().trim(), reference.commit, failure);
|
|
108
|
+
return reference.commit;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** Inspect visible committed documentation, rather than metadata or comments alone. */
|
|
112
|
+
export function sdkDocumentationBody(bytes: Buffer): string {
|
|
113
|
+
const text = bytes.toString('utf8'); assert.deepEqual(Buffer.from(text), bytes, `${failure}: Documentation must be UTF-8`);
|
|
114
|
+
assert.ok(!text.includes('\0'), `${failure}: Binary documentation denied`);
|
|
115
|
+
return text.replace(/^---\r?\n[\s\S]*?\r?\n---(?:\r?\n|$)/u, '').replace(/<!--[\s\S]*?-->/gu, '').trim();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Independent native Git objects prove ancestry and exact approved test bytes. No product code is changed. */
|
|
119
|
+
export function verifySdkCommittedTests(repository: string, base: string, tester: string, engineer: string,
|
|
120
|
+
integration?: { writer: string; release: string; writerBase: string }) {
|
|
121
|
+
for (const commit of [base, tester, engineer]) assert.match(commit, /^[a-f0-9]{40}$/u, failure);
|
|
122
|
+
if (integration) {
|
|
123
|
+
for (const commit of [integration.writer, integration.release, integration.writerBase]) assert.ok(typeof commit === 'string' && /^[a-f0-9]{40}$/u.test(commit), failure);
|
|
124
|
+
assert.equal(integration.writerBase, engineer, `${failure}: Writer must start from the independently approved implementation`);
|
|
125
|
+
}
|
|
126
|
+
assert.equal(new Set([base, tester, engineer]).size, 3, failure);
|
|
127
|
+
const git = nativePublishedGit(repository);
|
|
128
|
+
for (const commit of [base, tester, engineer]) assert.equal(git(['rev-parse', '--verify', `${commit}^{commit}`]).toString().trim(), commit, failure);
|
|
129
|
+
git(['merge-base', '--is-ancestor', base, tester]); git(['merge-base', '--is-ancestor', tester, engineer]);
|
|
130
|
+
if (integration) {
|
|
131
|
+
for (const commit of [integration.writer, integration.release])
|
|
132
|
+
assert.equal(git(['rev-parse', '--verify', `${commit}^{commit}`]).toString().trim(), commit, failure);
|
|
133
|
+
git(['merge-base', '--is-ancestor', engineer, integration.writer]);
|
|
134
|
+
const changed = git(['diff', '--name-only', '--no-renames', '-z', engineer, integration.writer]).toString('utf8').split('\0').filter(Boolean);
|
|
135
|
+
assert.ok(changed.every(path => /^(?:[^/]+\.mdx?$|docs\/|examples\/)/u.test(path)),
|
|
136
|
+
`${failure}: Writer must preserve the independently approved implementation and test runner`);
|
|
137
|
+
const docs = changed.filter(path => /^(?:[^/]+\.mdx?|docs\/.+\.mdx?)$/u.test(path));
|
|
138
|
+
let documented = 0;
|
|
139
|
+
for (const path of docs) {
|
|
140
|
+
const entry = git(['ls-tree', '-z', integration.writer, '--', path]).toString('utf8');
|
|
141
|
+
if (!entry) continue; // Removed obsolete pages cannot count as the delivered documentation.
|
|
142
|
+
assert.ok(/^(100644|100755) blob [a-f0-9]{40}\t/u.test(entry), `${failure}: Writer deleted or redirected documentation`);
|
|
143
|
+
const body = sdkDocumentationBody(git(['cat-file', 'blob', `${integration.writer}:${path}`]));
|
|
144
|
+
assert.ok(body && /[\p{L}\p{N}]/u.test(body), `${failure}: Empty documentation is not a delivered product`);
|
|
145
|
+
const previous = git(['ls-tree', '-z', engineer, '--', path]);
|
|
146
|
+
if (previous.length && body === sdkDocumentationBody(git(['cat-file', 'blob', `${engineer}:${path}`]))) continue;
|
|
147
|
+
documented++;
|
|
148
|
+
}
|
|
149
|
+
assert.ok(documented > 0, `${failure}: Actual repository documentation must change`);
|
|
150
|
+
|
|
151
|
+
git(['merge-base', '--is-ancestor', integration.writer, integration.release]);
|
|
152
|
+
assert.equal(git(['rev-parse', `${integration.release}^{tree}`]).toString().trim(),
|
|
153
|
+
git(['rev-parse', `${integration.writer}^{tree}`]).toString().trim(), `${failure}: Integration contains unreviewed changes`);
|
|
154
|
+
}
|
|
155
|
+
const implementation = git(['diff', '--name-only', '--no-renames', '-z', tester, engineer]).toString('utf8').split('\0').filter(Boolean);
|
|
156
|
+
assert.ok(implementation.every(path => !path.startsWith('tests/') && !path.startsWith('scripts/')
|
|
157
|
+
&& !['package.json', 'package-lock.json', 'npm-shrinkwrap.json', '.npmrc'].includes(path)
|
|
158
|
+
&& !/^(?:vitest|vite|tsconfig)(?:\.[^/]+)?\.(?:ts|mts|cts|js|mjs|cjs|json)$/u.test(path)),
|
|
159
|
+
`${failure}: Engineer must retain every approved test and the original complete-suite runner`);
|
|
160
|
+
assert.ok(implementation.some(path => /^src\/.*\.ts$/u.test(path)
|
|
161
|
+
&& /^100(?:644|755) blob [a-f0-9]{40}\t/u.test(git(['ls-tree', '-z', engineer, '--', path]).toString('utf8'))),
|
|
162
|
+
`${failure}: Engineer must produce a native source implementation after approved tests`);
|
|
163
|
+
const changed = git(['diff', '--name-only', '--no-renames', '-z', base, tester]).toString('utf8').split('\0').filter(Boolean);
|
|
164
|
+
assert.ok(changed.length > 0 && new Set(changed).size === changed.length, failure);
|
|
165
|
+
assert.ok(changed.every(path => /^tests\//u.test(path) && !path.split('/').some(part => part === '..' || part === '.' || part === '')), failure);
|
|
166
|
+
assert.ok(changed.some(path => /\.(?:test|spec)\.ts$/u.test(path)), failure);
|
|
167
|
+
const tests = changed.map(path => {
|
|
168
|
+
const original = git(['ls-tree', '-z', tester, '--', path]), consumed = git(['ls-tree', '-z', engineer, '--', path]);
|
|
169
|
+
assert.deepEqual(consumed, original, `${failure}: Engineer changed approved test ${path}`);
|
|
170
|
+
if (integration) for (const commit of [integration.writer, integration.release])
|
|
171
|
+
assert.deepEqual(git(['ls-tree', '-z', commit, '--', path]), original, `${failure}: Integrated candidate changed approved test ${path}`);
|
|
172
|
+
const match = /^(100644|100755) blob ([a-f0-9]{40})\t([^\0]+)\0$/u.exec(original.toString('utf8'));
|
|
173
|
+
assert.ok(match && match[3] === path, `${failure}: Tester deleted or redirected test ${path}`);
|
|
174
|
+
const blob = git(['cat-file', 'blob', `${tester}:${path}`]);
|
|
175
|
+
assert.deepEqual(git(['cat-file', 'blob', `${engineer}:${path}`]), blob, failure);
|
|
176
|
+
return { path, mode: match[1]!, objectId: match[2]!, digest: createHash('sha256').update(blob).digest('hex') };
|
|
177
|
+
});
|
|
178
|
+
for (const commit of [base, tester, engineer]) assert.equal(git(['rev-parse', '--verify', `${commit}^{commit}`]).toString().trim(), commit, failure);
|
|
179
|
+
return tests;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export {verifySdkBaseRed,verifySdkIntentRuntime} from './base-red.ts';
|
|
183
|
+
|
|
184
|
+
/** Resolve actual Writer documentation bytes from the independently published native Git repository. */
|
|
185
|
+
export function verifySdkReferenceDocumentation(repository:string,engineer:string,writer:string):void{
|
|
186
|
+
const label='ACCEPTANCE_SDK_DOCUMENTATION';for(const commit of [engineer,writer])assert.match(commit,/^[a-f0-9]{40}$/u,label);
|
|
187
|
+
const git=nativePublishedGit(repository);git(['merge-base','--is-ancestor',engineer,writer]);
|
|
188
|
+
const paths=git(['diff','--name-only','--no-renames','-z',engineer,writer]).toString('utf8').split('\0').filter(path=>/^(?:[^/]+\.mdx?|docs\/.+\.mdx?)$/u.test(path));
|
|
189
|
+
const documents:string[]=[];for(const path of paths){const entry=git(['ls-tree','-z',writer,'--',path]).toString('utf8');if(!entry)continue;assert.ok(/^100(?:644|755) blob [a-f0-9]{40}\t/u.test(entry),label+': Redirected reference page');documents.push(sdkDocumentationBody(git(['cat-file','blob',writer+':'+path])));}
|
|
190
|
+
verifySdkDocumentationExamples(documents);
|
|
191
|
+
assert.equal(git(['rev-parse',writer+'^{commit}']).toString().trim(),writer,label);
|
|
192
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
id: "@treeseed/sdk"
|
|
2
|
+
name: TreeSeed SDK
|
|
3
|
+
kind: node-typescript
|
|
4
|
+
type: node-library
|
|
5
|
+
repository: treeseed-ai/sdk
|
|
6
|
+
publishTarget: npm
|
|
7
|
+
capabilities: { save: true, verify: true, publish: true, deploy: false, localOnly: false }
|
|
8
|
+
workflowTemplateVersion: "1"
|
|
9
|
+
githubEnvironments:
|
|
10
|
+
- production
|
|
11
|
+
requiredSecrets:
|
|
12
|
+
- NPM_TOKEN
|
|
13
|
+
verify:
|
|
14
|
+
fast: npm run test:contracts
|
|
15
|
+
local: npm run verify:direct
|
|
16
|
+
release: npm run release:verify
|
|
17
|
+
artifacts:
|
|
18
|
+
- provider: npm
|
|
19
|
+
name: "@treeseed/sdk"
|
|
20
|
+
releaseGate:
|
|
21
|
+
workflow: verify.yml
|
|
22
|
+
development:
|
|
23
|
+
schemaVersion: treeseed.development-runtime/v1
|
|
24
|
+
project: { id: sdk, repository: treeseed-ai/sdk }
|
|
25
|
+
defaults: { leaseSeconds: 14400, restoreOnFailure: true }
|
|
26
|
+
targets:
|
|
27
|
+
- id: package
|
|
28
|
+
kind: package-watch
|
|
29
|
+
platforms: [linux-amd64, linux-arm64, darwin-arm64, darwin-amd64]
|
|
30
|
+
runtimeRequirements: [node>=22]
|
|
31
|
+
sourceRoots: [src, scripts/build, scripts/development]
|
|
32
|
+
ignoredPaths: [dist, node_modules]
|
|
33
|
+
operations:
|
|
34
|
+
watch: { command: node, args: [--watch-path=src, --watch-path=package.json, --import, tsx, scripts/development/build-watch.ts], environment: {}, timeoutSeconds: 86400 }
|
|
35
|
+
build: { command: node, args: [--import, tsx, scripts/development/build-watch.ts], environment: {}, timeoutSeconds: 900 }
|
|
36
|
+
verify: { command: npm, args: [run, test:contracts], environment: {}, timeoutSeconds: 900 }
|
|
37
|
+
ready: { kind: marker, path: dist/.treeseed-build-complete.json, timeoutSeconds: 120 }
|
|
38
|
+
outputs: [{ path: dist, mediaType: application/vnd.treeseed.node-package, completionMarker: dist/.treeseed-build-complete.json, digestAlgorithm: sha256 }]
|
|
39
|
+
endpoints: []
|
|
40
|
+
dependencies: []
|
|
41
|
+
statePolicy: stateless
|
|
42
|
+
migrationPolicy: none
|
|
43
|
+
secretRefs: {}
|
|
44
|
+
shutdown: { graceSeconds: 10, activeWorkPolicy: block }
|
|
45
|
+
resources: {}
|
|
46
|
+
logs: [.treeseed/development/package.log]
|
|
47
|
+
forbiddenOperations: [publish, production-tag]
|
|
48
|
+
freeze:
|
|
49
|
+
kind: npm-package
|
|
50
|
+
operation: { command: npm, args: [pack, --json], environment: {}, timeoutSeconds: 900 }
|
|
51
|
+
artifacts: [treeseed-sdk-*.tgz]
|
|
52
|
+
contractOperations:
|
|
53
|
+
- { command: npm, args: [run, standards:build], environment: {}, timeoutSeconds: 900 }
|
|
54
|
+
- { command: npm, args: [run, standards:compatibility], environment: {}, timeoutSeconds: 900 }
|
|
55
|
+
promotion: { liveAdmissible: false, candidateRequiresVerification: true }
|
|
56
|
+
standards:
|
|
57
|
+
schemaVersion: 1
|
|
58
|
+
workflow:
|
|
59
|
+
enabled: true
|
|
60
|
+
acceptedBaseline:
|
|
61
|
+
packageName: "@treeseed/sdk"
|
|
62
|
+
packageVersion: "0.12.62"
|
|
63
|
+
sourceCommit: "d12a97fdd3fdca1358895a7a64fa2012197b2942"
|
|
64
|
+
npmIntegrity: "sha512-wR5ukK2pqw0fUE9gJMYgJmIUlMTy4NoYKJrHEo6NAN/QFNrpru+9vilaS4kCPrcZQl/YAleuv962Z8c/pwwrBQ=="
|
|
65
|
+
artifactDigest: "sha256:9ccef82ccd452905e5a1733a5ced81d6d629b0c0f0d893cf19ea1a3ed53bc9f5"
|
|
66
|
+
openApiSourceDigest: "sha256:53b87f22ad3b3e4a24f4050f764e9f27081c3968130431909a366b16baa9bebd"
|
|
67
|
+
produced:
|
|
68
|
+
- id: "@treeseed/sdk/typescript-public-api"
|
|
69
|
+
family: typescript
|
|
70
|
+
version: "1.0.0"
|
|
71
|
+
semanticRange: "^1.0.0"
|
|
72
|
+
source: dist
|
|
73
|
+
artifact: .treeseed/standards/typescript-public-api.json
|
|
74
|
+
verifier: scripts/standards/compare-compatibility.ts
|
|
75
|
+
- id: "@treeseed/sdk/openapi"
|
|
76
|
+
family: openapi
|
|
77
|
+
version: "1.0.0"
|
|
78
|
+
semanticRange: "^1.0.0"
|
|
79
|
+
source: docs/api/openapi.json
|
|
80
|
+
artifact: .treeseed/standards/openapi.json
|
|
81
|
+
verifier: scripts/standards/compare-compatibility.ts
|
|
82
|
+
- id: "@treeseed/sdk/control-plane-catalog"
|
|
83
|
+
family: json-schema
|
|
84
|
+
version: "1.0.0"
|
|
85
|
+
semanticRange: "^1.0.0"
|
|
86
|
+
source: src/operator-contracts/control-plane-operations.ts
|
|
87
|
+
artifact: .treeseed/standards/control-plane-catalog.json
|
|
88
|
+
verifier: scripts/standards/compare-compatibility.ts
|
|
89
|
+
- id: "@treeseed/sdk/guarantee-verifier-contract"
|
|
90
|
+
family: behavioral
|
|
91
|
+
version: "1.0.0"
|
|
92
|
+
semanticRange: "^1.0.0"
|
|
93
|
+
source: src/guarantees
|
|
94
|
+
artifact: .treeseed/standards/guarantee-verifier-contract.json
|
|
95
|
+
verifier: runUiEvidenceTrustVerifier
|
|
96
|
+
- id: "@treeseed/sdk/mcp-catalog-input"
|
|
97
|
+
family: behavioral
|
|
98
|
+
version: "1.0.0"
|
|
99
|
+
semanticRange: "^1.0.0"
|
|
100
|
+
source: src/operator-contracts/mcp.ts
|
|
101
|
+
artifact: .treeseed/standards/mcp-catalog-input.json
|
|
102
|
+
verifier: scripts/standards/compare-compatibility.ts
|
|
103
|
+
- id: "@treeseed/sdk/treedx-service-contract"
|
|
104
|
+
family: behavioral
|
|
105
|
+
version: "1.0.0"
|
|
106
|
+
semanticRange: "^1.0.0"
|
|
107
|
+
source: src/treedx/contract.ts
|
|
108
|
+
artifact: .treeseed/standards/treedx-service-contract.json
|
|
109
|
+
verifier: scripts/standards/compare-compatibility.ts
|
|
110
|
+
- id: "@treeseed/sdk/treeai-service-contract"
|
|
111
|
+
family: behavioral
|
|
112
|
+
version: "1.0.0"
|
|
113
|
+
semanticRange: "^1.0.0"
|
|
114
|
+
source: src/treeai/contract.ts
|
|
115
|
+
artifact: .treeseed/standards/treeai-service-contract.json
|
|
116
|
+
verifier: scripts/standards/compare-compatibility.ts
|
|
117
|
+
consumed:
|
|
118
|
+
- id: "@treeseed/treeai/openapi"
|
|
119
|
+
family: openapi
|
|
120
|
+
version: "0.11.0-rc2"
|
|
121
|
+
semanticRange: "0.11.0-rc2"
|
|
122
|
+
source: contracts/services/treeai/treeai-contract-release.json
|
|
123
|
+
artifact: contracts/services/treeai-adoption.json
|
|
124
|
+
verifier: scripts/standards/build-contract-bundle.ts
|
|
125
|
+
- id: "@treeseed/treedx/openapi"
|
|
126
|
+
family: openapi
|
|
127
|
+
version: "0.11.0"
|
|
128
|
+
semanticRange: "0.11.0"
|
|
129
|
+
source: node_modules/@treeseed/treedx/openapi.yaml
|
|
130
|
+
artifact: contracts/services/treedx-adoption.json
|
|
131
|
+
verifier: scripts/standards/build-contract-bundle.ts
|
|
132
|
+
guarantees:
|
|
133
|
+
- deterministic-contract-bundle
|
|
134
|
+
- exact-artifact-and-source-binding
|
|
135
|
+
- semantic-version-sufficiency
|
|
136
|
+
- artifact-bound-guarantee-evidence
|
|
137
|
+
- authoritative-treedx-service-adoption
|
|
138
|
+
- authoritative-treeai-service-adoption
|
|
139
|
+
deprecations: []
|
|
140
|
+
runtimes:
|
|
141
|
+
- node>=22
|
|
142
|
+
rollbackOperations:
|
|
143
|
+
- remove-prerelease-dist-tag
|
|
144
|
+
- restore-accepted-composition
|
|
145
|
+
projectArchitecture:
|
|
146
|
+
topology: package_only
|
|
147
|
+
rootPath: .
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"completedAt":"2026-09-21T04:16:59.999Z"}
|