@jinn-network/jinn-layer 0.1.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/dist/adapters/contribution-adapter.d.ts +18 -0
- package/dist/adapters/contribution-adapter.js +134 -0
- package/dist/adapters/corpus-adapter.d.ts +12 -0
- package/dist/adapters/corpus-adapter.js +212 -0
- package/dist/adapters/index.d.ts +17 -0
- package/dist/adapters/index.js +17 -0
- package/dist/adapters/json-map-store.d.ts +4 -0
- package/dist/adapters/json-map-store.js +31 -0
- package/dist/adapters/local-learning-adapter.d.ts +25 -0
- package/dist/adapters/local-learning-adapter.js +49 -0
- package/dist/adapters/skills-adapter.d.ts +8 -0
- package/dist/adapters/skills-adapter.js +55 -0
- package/dist/admission-policy.d.ts +38 -0
- package/dist/admission-policy.js +17 -0
- package/dist/bin/jinn-distill-mcp.d.ts +2 -0
- package/dist/bin/jinn-distill-mcp.js +10 -0
- package/dist/bin/jinn-layer.d.ts +7 -0
- package/dist/bin/jinn-layer.js +15 -0
- package/dist/bridge-fetch-evidence.d.ts +102 -0
- package/dist/bridge-fetch-evidence.js +677 -0
- package/dist/bridge-verdict-source.d.ts +47 -0
- package/dist/bridge-verdict-source.js +216 -0
- package/dist/bridge.d.ts +247 -0
- package/dist/bridge.js +439 -0
- package/dist/capture.d.ts +98 -0
- package/dist/capture.js +617 -0
- package/dist/cli.d.ts +148 -0
- package/dist/cli.js +2221 -0
- package/dist/cluster-selection.d.ts +34 -0
- package/dist/cluster-selection.js +135 -0
- package/dist/cluster.d.ts +89 -0
- package/dist/cluster.js +142 -0
- package/dist/consume.d.ts +139 -0
- package/dist/consume.js +280 -0
- package/dist/corpus-probes.d.ts +61 -0
- package/dist/corpus-probes.js +120 -0
- package/dist/corpus-store.d.ts +16 -0
- package/dist/corpus-store.js +101 -0
- package/dist/distill-captures.d.ts +56 -0
- package/dist/distill-captures.js +283 -0
- package/dist/distill-feedback.d.ts +20 -0
- package/dist/distill-feedback.js +30 -0
- package/dist/distill-llm.d.ts +138 -0
- package/dist/distill-llm.js +438 -0
- package/dist/distill-mcp-server.d.ts +30 -0
- package/dist/distill-mcp-server.js +281 -0
- package/dist/distill-mode.d.ts +62 -0
- package/dist/distill-mode.js +107 -0
- package/dist/distill-progress.d.ts +78 -0
- package/dist/distill-progress.js +69 -0
- package/dist/distill-prompt.d.ts +34 -0
- package/dist/distill-prompt.js +85 -0
- package/dist/distill-render.d.ts +123 -0
- package/dist/distill-render.js +303 -0
- package/dist/distill-runs.d.ts +28 -0
- package/dist/distill-runs.js +39 -0
- package/dist/distill-traces.d.ts +67 -0
- package/dist/distill-traces.js +211 -0
- package/dist/distill.d.ts +180 -0
- package/dist/distill.js +337 -0
- package/dist/distiller.d.ts +118 -0
- package/dist/distiller.js +142 -0
- package/dist/envelope.d.ts +9 -0
- package/dist/envelope.js +9 -0
- package/dist/eval-prep.d.ts +129 -0
- package/dist/eval-prep.js +523 -0
- package/dist/execution-publish.d.ts +62 -0
- package/dist/execution-publish.js +72 -0
- package/dist/gate.d.ts +39 -0
- package/dist/gate.js +106 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.js +50 -0
- package/dist/ipfs-cid.d.ts +18 -0
- package/dist/ipfs-cid.js +149 -0
- package/dist/layer-default.d.ts +3 -0
- package/dist/layer-default.js +10 -0
- package/dist/ledger.d.ts +62 -0
- package/dist/ledger.js +104 -0
- package/dist/measurement.d.ts +90 -0
- package/dist/measurement.js +134 -0
- package/dist/path-safety.d.ts +19 -0
- package/dist/path-safety.js +303 -0
- package/dist/pipeline.d.ts +94 -0
- package/dist/pipeline.js +124 -0
- package/dist/plugin-wiring.d.ts +4 -0
- package/dist/plugin-wiring.js +54 -0
- package/dist/preview.d.ts +31 -0
- package/dist/preview.js +28 -0
- package/dist/process-contract.d.ts +303 -0
- package/dist/process-contract.js +118 -0
- package/dist/publish-skill.d.ts +86 -0
- package/dist/publish-skill.js +116 -0
- package/dist/publish.d.ts +294 -0
- package/dist/publish.js +1090 -0
- package/dist/scripts/scan-skills-registry.d.ts +24 -0
- package/dist/scripts/scan-skills-registry.js +207 -0
- package/dist/seed-import/curated-batch.d.ts +36 -0
- package/dist/seed-import/curated-batch.js +103 -0
- package/dist/seed-import/episode-execute.d.ts +50 -0
- package/dist/seed-import/episode-execute.js +235 -0
- package/dist/seed-import/episode-fetch.d.ts +119 -0
- package/dist/seed-import/episode-fetch.js +137 -0
- package/dist/seed-import/episode-plan.d.ts +11 -0
- package/dist/seed-import/episode-plan.js +27 -0
- package/dist/seed-import/episode-report.d.ts +39 -0
- package/dist/seed-import/episode-report.js +36 -0
- package/dist/seed-import/execute.d.ts +61 -0
- package/dist/seed-import/execute.js +245 -0
- package/dist/seed-import/fetch.d.ts +62 -0
- package/dist/seed-import/fetch.js +82 -0
- package/dist/seed-import/licence.d.ts +17 -0
- package/dist/seed-import/licence.js +36 -0
- package/dist/seed-import/plan.d.ts +10 -0
- package/dist/seed-import/plan.js +21 -0
- package/dist/seed-import/report.d.ts +34 -0
- package/dist/seed-import/report.js +31 -0
- package/dist/seed-import/state.d.ts +72 -0
- package/dist/seed-import/state.js +120 -0
- package/dist/signal.d.ts +36 -0
- package/dist/signal.js +48 -0
- package/dist/signing.d.ts +8 -0
- package/dist/signing.js +21 -0
- package/dist/skill-package.d.ts +70 -0
- package/dist/skill-package.js +141 -0
- package/dist/skill.d.ts +21 -0
- package/dist/skill.js +77 -0
- package/dist/snapshot-transcript.d.ts +54 -0
- package/dist/snapshot-transcript.js +117 -0
- package/dist/three-arm-run.d.ts +27 -0
- package/dist/three-arm-run.js +41 -0
- package/package.json +60 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* jinn-layer CLI entry. Delegates to cli.ts.
|
|
4
|
+
*
|
|
5
|
+
* Run from an installed package: `jinn-layer corpus search "<query>"`.
|
|
6
|
+
*/
|
|
7
|
+
import { runJinnLayerCli } from '../cli.js';
|
|
8
|
+
runJinnLayerCli(process.argv.slice(2))
|
|
9
|
+
.then((code) => {
|
|
10
|
+
process.exitCode = code;
|
|
11
|
+
})
|
|
12
|
+
.catch((err) => {
|
|
13
|
+
console.error(`[jinn-layer] ${err instanceof Error ? err.message : String(err)}`);
|
|
14
|
+
process.exitCode = 1;
|
|
15
|
+
});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bridge's `fetchEvidence` adapter (spec/2026-07-06-distillation-v1.md §8, D5).
|
|
3
|
+
*
|
|
4
|
+
* Implements the VERIFIED verdict→solution join that reaches
|
|
5
|
+
* the SOLVER's coding patch — the reference implementation is `fetchEvidence` in
|
|
6
|
+
* client/scripts/distill-run-live.ts:
|
|
7
|
+
*
|
|
8
|
+
* verdict(ref.requestId, ref.chainId) → authoritative (taskId, attemptIndex, evaluator)
|
|
9
|
+
* + bounded verdictEnvelopeMeta candidates → historical publisher,
|
|
10
|
+
* participant, signed-hash, request, and polarity binding
|
|
11
|
+
* → authenticated evaluation wrapper → signed original task CID
|
|
12
|
+
* → TaskCreated task-CID / creator / manifest commitments
|
|
13
|
+
* → authenticated original task (description + verifier facts)
|
|
14
|
+
* → attempt(taskId, attemptIndex, chainId) → the SOLVE request
|
|
15
|
+
* → bounded attemptEnvelopeMeta candidates → publisher + signed-hash binding
|
|
16
|
+
* → authenticated solution envelope (IPFS) → .payload.patch (the coding diff)
|
|
17
|
+
* problem statement = authenticated original task description
|
|
18
|
+
* typed history (hop 4, best-effort, #1472/#1473) = the solution's system_snapshot
|
|
19
|
+
* artifact → donation unwrap → gunzip+untar → the harness stdout
|
|
20
|
+
* transcript → canonical core stream parser → typed trajectory spans
|
|
21
|
+
*
|
|
22
|
+
* The predecessor selected the solution with the task document's mutable
|
|
23
|
+
* `restorationRequestId`. That allowed an otherwise-valid signed task to be
|
|
24
|
+
* relabelled onto another solution. The selection path now comes exclusively
|
|
25
|
+
* from chain-indexed verdict + attempt rows. Any outer task copy is only a
|
|
26
|
+
* consistency assertion and can never select the patch.
|
|
27
|
+
*
|
|
28
|
+
* All I/O and authentication boundaries are injected ports so this stays
|
|
29
|
+
* unit-testable. Production uses the Autonolas gateway, Ponder GraphQL,
|
|
30
|
+
* canonical envelope verification, and an IdentityRegistry wallet read; tests
|
|
31
|
+
* inject fakes. The returned function is directly usable as
|
|
32
|
+
* `BridgeDeps.fetchEvidence`.
|
|
33
|
+
*/
|
|
34
|
+
import { type AttemptRef, type BridgeEvidence } from './bridge.js';
|
|
35
|
+
export interface AuthenticatedExecutionEnvelope {
|
|
36
|
+
solverType: string;
|
|
37
|
+
role: 'solution' | 'verdict' | 'capture' | 'restoration';
|
|
38
|
+
task?: unknown;
|
|
39
|
+
participant: {
|
|
40
|
+
safeAddress: string;
|
|
41
|
+
agentEoa: string;
|
|
42
|
+
};
|
|
43
|
+
signature: {
|
|
44
|
+
hash: string;
|
|
45
|
+
signer: string;
|
|
46
|
+
sig: string;
|
|
47
|
+
algo: string;
|
|
48
|
+
};
|
|
49
|
+
payload: Record<string, unknown>;
|
|
50
|
+
executor?: unknown;
|
|
51
|
+
artifacts?: unknown[];
|
|
52
|
+
distributionClass?: 'open' | 'restricted-tos' | 'unknown';
|
|
53
|
+
}
|
|
54
|
+
export type ExecutionEnvelopeAuthenticator = (value: unknown, sourceName: string) => Promise<AuthenticatedExecutionEnvelope>;
|
|
55
|
+
export type PublisherSafeResolver = (chainId: number, publisherAgentId: string, publishedAtBlock: bigint) => Promise<string>;
|
|
56
|
+
export interface AuthenticatedTaskProvenance {
|
|
57
|
+
solverType: string;
|
|
58
|
+
instanceId: string;
|
|
59
|
+
repo: string;
|
|
60
|
+
baseCommit: string;
|
|
61
|
+
createdAt: number;
|
|
62
|
+
originalTaskCid: string;
|
|
63
|
+
creatorSafe: string;
|
|
64
|
+
manifestDigest: string;
|
|
65
|
+
description: string;
|
|
66
|
+
}
|
|
67
|
+
export interface AuthoritativeTaskBinding {
|
|
68
|
+
taskId: string;
|
|
69
|
+
chainId: number;
|
|
70
|
+
taskCidDigest: string;
|
|
71
|
+
manifestDigest: string;
|
|
72
|
+
creatorSafe: string;
|
|
73
|
+
evaluatorSafe: string;
|
|
74
|
+
}
|
|
75
|
+
export interface VerifierFacts {
|
|
76
|
+
failToPass: string[];
|
|
77
|
+
passToPass: string[];
|
|
78
|
+
evalSemanticsVersion: string;
|
|
79
|
+
task: AuthenticatedTaskProvenance;
|
|
80
|
+
}
|
|
81
|
+
export type VerifierFactsResolver = (taskDoc: unknown, expectedInstanceId: string, authority: AuthoritativeTaskBinding) => Promise<unknown>;
|
|
82
|
+
export interface EvidenceFetcherPorts {
|
|
83
|
+
/**
|
|
84
|
+
* Fetch + JSON-parse an IPFS object by CID (autonolas gateway in production).
|
|
85
|
+
* Callers that authenticate smaller artifacts may request a tighter ceiling.
|
|
86
|
+
*/
|
|
87
|
+
ipfs: (cid: string, maxBytes?: number) => Promise<any>;
|
|
88
|
+
/** Run a GraphQL query against the Ponder indexer, returning `data`. */
|
|
89
|
+
gql: (query: string, variables?: Record<string, unknown>) => Promise<any>;
|
|
90
|
+
/** Parse and cryptographically authenticate one raw execution envelope. */
|
|
91
|
+
authenticateEnvelope: ExecutionEnvelopeAuthenticator;
|
|
92
|
+
/** Resolve the Safe owned by an ERC-8004 publisher agent at the event block. */
|
|
93
|
+
resolvePublisherSafe: PublisherSafeResolver;
|
|
94
|
+
/** Resolve one atomic, authenticated verifier proof for an identified SWE task. */
|
|
95
|
+
resolveVerifierFacts?: VerifierFactsResolver;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Build the bridge's `fetchEvidence`. Consumes injected `ipfs` / `gql` ports
|
|
99
|
+
* (fakes in tests; a gateway + indexer in production). Throws a clear error at
|
|
100
|
+
* each missing hop so a per-instance miss is diagnosable and skipped, not silent.
|
|
101
|
+
*/
|
|
102
|
+
export declare function createEvidenceFetcher(ports: EvidenceFetcherPorts): (ref: AttemptRef) => Promise<BridgeEvidence>;
|