@inflexa-ai/harness 0.1.1 → 0.3.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/README.md +48 -0
- package/dist/agents/conversation-agent.d.ts +15 -11
- package/dist/agents/conversation-agent.js +31 -34
- package/dist/agents/report-builder.js +2 -1
- package/dist/agents/sandbox/bulk-transcriptomics-agent.js +1 -1
- package/dist/agents/sandbox/cheminformatics-agent.js +1 -19
- package/dist/agents/sandbox/chromatin-agent.js +1 -10
- package/dist/agents/sandbox/dna-methylation-agent.js +1 -10
- package/dist/agents/sandbox/drug-repurposing-agent.js +4 -14
- package/dist/agents/sandbox/enrichment-agent.js +1 -10
- package/dist/agents/sandbox/ephemeral-executor.js +1 -10
- package/dist/agents/sandbox/genomic-variant-agent.js +1 -3
- package/dist/agents/sandbox/immune-profiling-agent.js +1 -13
- package/dist/agents/sandbox/metabolomics-agent.js +1 -1
- package/dist/agents/sandbox/microbiome-agent.js +1 -1
- package/dist/agents/sandbox/multi-omics-integration-agent.js +1 -12
- package/dist/agents/sandbox/multimodal-sc-agent.js +1 -1
- package/dist/agents/sandbox/network-agent.js +1 -10
- package/dist/agents/sandbox/pkpd-clinical-response-agent.js +2 -8
- package/dist/agents/sandbox/proteomics-agent.js +1 -1
- package/dist/agents/sandbox/scientific-executor.js +1 -10
- package/dist/agents/sandbox/shared.d.ts +20 -6
- package/dist/agents/sandbox/shared.js +50 -39
- package/dist/agents/sandbox/single-cell-agent.js +1 -1
- package/dist/agents/sandbox/spatial-omics-agent.js +1 -1
- package/dist/agents/sandbox/statistical-modeling-agent.js +1 -1
- package/dist/agents/sandbox/translational-safety-agent.js +3 -9
- package/dist/agents/sandbox/types.d.ts +1 -1
- package/dist/agents/system-prompt.d.ts +37 -11
- package/dist/agents/system-prompt.js +35 -12
- package/dist/app/chat-turn.d.ts +3 -0
- package/dist/app/chat-turn.js +3 -1
- package/dist/app/data-profile-orientation.d.ts +34 -0
- package/dist/app/data-profile-orientation.js +117 -0
- package/dist/app/synthesize-run.d.ts +3 -0
- package/dist/app/synthesize-run.js +3 -1
- package/dist/contracts/schemas/chat-parts.d.ts +9 -9
- package/dist/execution/artifact-metadata.d.ts +3 -0
- package/dist/execution/artifact-metadata.js +10 -3
- package/dist/execution/artifact-registration.d.ts +2 -1
- package/dist/execution/artifact-registration.js +8 -2
- package/dist/execution/ephemeral-runner.d.ts +16 -0
- package/dist/execution/ephemeral-runner.js +31 -5
- package/dist/execution/post-step-pipeline.d.ts +3 -0
- package/dist/execution/post-step-pipeline.js +24 -4
- package/dist/execution/reconcile-manifest.d.ts +7 -0
- package/dist/execution/reconcile-manifest.js +19 -5
- package/dist/execution/report-runner.d.ts +3 -0
- package/dist/execution/report-runner.js +4 -4
- package/dist/execution/run-synthesis.js +20 -19
- package/dist/execution/step-summary.d.ts +3 -0
- package/dist/execution/step-summary.js +6 -3
- package/dist/index.d.ts +9 -2
- package/dist/index.js +24 -5
- package/dist/lib/chrome.d.ts +4 -1
- package/dist/lib/chrome.js +10 -7
- package/dist/lib/console-logger.d.ts +19 -0
- package/dist/lib/console-logger.js +62 -0
- package/dist/lib/logger.d.ts +88 -0
- package/dist/lib/logger.js +37 -0
- package/dist/lib/otel.d.ts +2 -1
- package/dist/lib/otel.js +8 -3
- package/dist/loop/__fixtures__/scripted-provider.d.ts +2 -2
- package/dist/loop/__fixtures__/scripted-provider.js +2 -1
- package/dist/loop/metrics.d.ts +33 -1
- package/dist/loop/metrics.js +56 -2
- package/dist/loop/run-agent.d.ts +13 -1
- package/dist/loop/run-agent.js +19 -4
- package/dist/memory/card-builders.d.ts +8 -1
- package/dist/memory/card-builders.js +20 -3
- package/dist/memory/reconstruct-cards.js +4 -3
- package/dist/memory/thread-history.d.ts +27 -2
- package/dist/memory/thread-history.js +45 -5
- package/dist/memory/working-memory.d.ts +93 -10
- package/dist/memory/working-memory.js +220 -84
- package/dist/prompts/SOUL.d.ts +22 -9
- package/dist/prompts/SOUL.js +56 -37
- package/dist/prompts/analogical-reasoner.d.ts +1 -1
- package/dist/prompts/analogical-reasoner.js +2 -2
- package/dist/prompts/briefing.d.ts +100 -0
- package/dist/prompts/briefing.js +166 -0
- package/dist/prompts/conversation.d.ts +1 -1
- package/dist/prompts/conversation.js +94 -440
- package/dist/prompts/literature-reviewer.d.ts +1 -1
- package/dist/prompts/literature-reviewer.js +10 -10
- package/dist/prompts/planner.js +28 -59
- package/dist/prompts/report-builder.d.ts +1 -1
- package/dist/prompts/report-builder.js +71 -24
- package/dist/prompts/sandbox/bulk-transcriptomics-agent.d.ts +1 -1
- package/dist/prompts/sandbox/bulk-transcriptomics-agent.js +2 -7
- package/dist/prompts/sandbox/cheminformatics-agent.d.ts +1 -1
- package/dist/prompts/sandbox/cheminformatics-agent.js +11 -15
- package/dist/prompts/sandbox/chromatin-agent.d.ts +1 -1
- package/dist/prompts/sandbox/chromatin-agent.js +3 -7
- package/dist/prompts/sandbox/data-profiler.d.ts +1 -1
- package/dist/prompts/sandbox/data-profiler.js +13 -8
- package/dist/prompts/sandbox/dna-methylation-agent.d.ts +1 -1
- package/dist/prompts/sandbox/dna-methylation-agent.js +2 -7
- package/dist/prompts/sandbox/drug-repurposing-agent.d.ts +1 -1
- package/dist/prompts/sandbox/drug-repurposing-agent.js +15 -16
- package/dist/prompts/sandbox/enrichment-agent.d.ts +1 -1
- package/dist/prompts/sandbox/enrichment-agent.js +2 -9
- package/dist/prompts/sandbox/genomic-variant-agent.d.ts +1 -1
- package/dist/prompts/sandbox/genomic-variant-agent.js +2 -6
- package/dist/prompts/sandbox/immune-profiling-agent.d.ts +1 -1
- package/dist/prompts/sandbox/immune-profiling-agent.js +3 -8
- package/dist/prompts/sandbox/metabolomics-agent.d.ts +1 -1
- package/dist/prompts/sandbox/metabolomics-agent.js +1 -7
- package/dist/prompts/sandbox/microbiome-agent.d.ts +1 -1
- package/dist/prompts/sandbox/microbiome-agent.js +2 -7
- package/dist/prompts/sandbox/multi-omics-integration-agent.d.ts +1 -1
- package/dist/prompts/sandbox/multi-omics-integration-agent.js +2 -8
- package/dist/prompts/sandbox/multimodal-sc-agent.d.ts +1 -1
- package/dist/prompts/sandbox/multimodal-sc-agent.js +2 -7
- package/dist/prompts/sandbox/network-agent.d.ts +1 -1
- package/dist/prompts/sandbox/network-agent.js +2 -7
- package/dist/prompts/sandbox/proteomics-agent.d.ts +1 -1
- package/dist/prompts/sandbox/proteomics-agent.js +2 -9
- package/dist/prompts/sandbox/single-cell-agent.d.ts +1 -1
- package/dist/prompts/sandbox/single-cell-agent.js +2 -9
- package/dist/prompts/sandbox/spatial-omics-agent.d.ts +1 -1
- package/dist/prompts/sandbox/spatial-omics-agent.js +3 -6
- package/dist/prompts/sandbox/statistical-modeling-agent.d.ts +1 -1
- package/dist/prompts/sandbox/statistical-modeling-agent.js +2 -7
- package/dist/prompts/sandbox/translational-safety-agent.d.ts +1 -1
- package/dist/prompts/sandbox/translational-safety-agent.js +13 -14
- package/dist/prompts/sandbox-standards.d.ts +22 -14
- package/dist/prompts/sandbox-standards.js +91 -71
- package/dist/prompts/synthesis-agent.d.ts +1 -1
- package/dist/prompts/synthesis-agent.js +33 -131
- package/dist/provenance/collector.js +1 -1
- package/dist/providers/ai-sdk.js +31 -4
- package/dist/providers/prompt-cache.d.ts +74 -0
- package/dist/providers/prompt-cache.js +77 -0
- package/dist/providers/types.d.ts +33 -0
- package/dist/reference-data/catalog.d.ts +131 -0
- package/dist/reference-data/catalog.js +348 -0
- package/dist/reference-data/receipt.d.ts +41 -0
- package/dist/reference-data/receipt.js +40 -0
- package/dist/runtime/boot.d.ts +2 -2
- package/dist/runtime/boot.js +1 -1
- package/dist/runtime/connection-budget.d.ts +2 -2
- package/dist/runtime/connection-budget.js +5 -3
- package/dist/runtime/dbos.d.ts +7 -7
- package/dist/runtime/dbos.js +14 -11
- package/dist/runtime/shutdown.d.ts +2 -2
- package/dist/runtime/shutdown.js +4 -3
- package/dist/sandbox/create-sandbox.d.ts +2 -2
- package/dist/sandbox/docker-client.d.ts +2 -2
- package/dist/sandbox/docker-client.js +4 -1
- package/dist/sandbox/k8s-client.d.ts +3 -0
- package/dist/sandbox/k8s-client.js +5 -4
- package/dist/sandbox/notification-sweep.d.ts +3 -3
- package/dist/sandbox/notification-sweep.js +4 -2
- package/dist/sandbox/reaper.d.ts +3 -3
- package/dist/sandbox/reaper.js +7 -4
- package/dist/sandbox/watchdog.d.ts +3 -3
- package/dist/sandbox/watchdog.js +8 -2
- package/dist/schemas/data-profile-schemas.js +5 -3
- package/dist/schemas/plan-schemas.d.ts +21 -21
- package/dist/schemas/plan-schemas.js +9 -3
- package/dist/schemas/run-synthesis.d.ts +8 -4
- package/dist/schemas/run-synthesis.js +92 -56
- package/dist/schemas/validate-plan.js +1 -1
- package/dist/schemas/workflow-state.d.ts +7 -1
- package/dist/schemas/workflow-state.js +33 -19
- package/dist/state/artifacts.d.ts +13 -0
- package/dist/state/artifacts.js +27 -0
- package/dist/state/data-profile.d.ts +64 -5
- package/dist/state/index.d.ts +3 -3
- package/dist/state/index.js +1 -1
- package/dist/state/init.d.ts +2 -1
- package/dist/state/init.js +5 -6
- package/dist/tasks/data-profile.d.ts +25 -2
- package/dist/tasks/data-profile.js +95 -39
- package/dist/tools/bio/chembl.d.ts +38 -0
- package/dist/tools/bio/chembl.js +138 -0
- package/dist/tools/bio/comptox.d.ts +50 -0
- package/dist/tools/bio/comptox.js +149 -0
- package/dist/tools/bio/get-impc-ko-profile.js +9 -6
- package/dist/tools/bio/index.d.ts +5 -17
- package/dist/tools/bio/index.js +5 -17
- package/dist/tools/bio/keys.d.ts +14 -9
- package/dist/tools/bio/keys.js +16 -16
- package/dist/tools/bio/opentargets.d.ts +38 -0
- package/dist/tools/bio/opentargets.js +89 -0
- package/dist/tools/bio/pubchem.d.ts +29 -0
- package/dist/tools/bio/pubchem.js +92 -0
- package/dist/tools/bio/pubmed.d.ts +51 -0
- package/dist/tools/bio/pubmed.js +100 -0
- package/dist/tools/bio/search-bgee-expression.js +12 -6
- package/dist/tools/bio/search-clinical-trials.js +16 -5
- package/dist/tools/bio/search-dgidb.d.ts +11 -1
- package/dist/tools/bio/search-dgidb.js +92 -78
- package/dist/tools/bio/search-faers.js +8 -4
- package/dist/tools/bio/search-geo-datasets.js +20 -6
- package/dist/tools/bio/search-gwas-catalog.d.ts +1 -1
- package/dist/tools/bio/search-pharmgkb.js +10 -4
- package/dist/tools/display/index.d.ts +1 -0
- package/dist/tools/display/index.js +1 -0
- package/dist/tools/display/normalize-echart-spec.d.ts +61 -0
- package/dist/tools/display/normalize-echart-spec.js +211 -0
- package/dist/tools/display/show-user.d.ts +6 -1
- package/dist/tools/display/show-user.js +25 -12
- package/dist/tools/execute-plan.js +5 -2
- package/dist/tools/iterate-report.d.ts +171 -118
- package/dist/tools/iterate-report.js +336 -96
- package/dist/tools/lib/chembl-client.d.ts +12 -0
- package/dist/tools/lib/chembl-client.js +127 -0
- package/dist/tools/lib/ctx-ops.d.ts +224 -0
- package/dist/tools/lib/ctx-ops.js +450 -0
- package/dist/tools/lib/iuphar-client.js +10 -1
- package/dist/tools/lib/openfda-client.js +11 -3
- package/dist/tools/lib/pathway-client.js +10 -4
- package/dist/tools/lib/pubchem-ops.d.ts +74 -0
- package/dist/tools/lib/pubchem-ops.js +224 -0
- package/dist/tools/memory/update-working-memory.d.ts +45 -7
- package/dist/tools/memory/update-working-memory.js +111 -41
- package/dist/tools/report/index.d.ts +3 -2
- package/dist/tools/report/index.js +3 -2
- package/dist/tools/research/generate-analogy-report.js +25 -12
- package/dist/tools/research/generate-plan.d.ts +12 -5
- package/dist/tools/research/generate-plan.js +168 -37
- package/dist/tools/research/index.d.ts +1 -0
- package/dist/tools/research/index.js +1 -0
- package/dist/tools/research/inspect-data-profile.d.ts +85 -0
- package/dist/tools/research/inspect-data-profile.js +161 -0
- package/dist/tools/research/literature-reviewer.d.ts +3 -0
- package/dist/tools/research/literature-reviewer.js +5 -6
- package/dist/tools/sandbox/list-available-packages.d.ts +79 -5
- package/dist/tools/sandbox/list-available-packages.js +152 -10
- package/dist/tools/sandbox/list-available-refs.d.ts +141 -5
- package/dist/tools/sandbox/list-available-refs.js +647 -134
- package/dist/tools/sandbox/report-blocker.d.ts +39 -9
- package/dist/tools/sandbox/report-blocker.js +43 -20
- package/dist/tools/workspace/execute-command.d.ts +3 -0
- package/dist/tools/workspace/execute-command.js +3 -1
- package/dist/tools/workspace/read-file.js +4 -5
- package/dist/tools/workspace/run-exec.d.ts +4 -4
- package/dist/tools/workspace/run-exec.js +4 -4
- package/dist/tools/workspace/show-file.js +10 -6
- package/dist/tools/workspace/show-plan.js +12 -6
- package/dist/tools/workspace/workspace-search.d.ts +1 -1
- package/dist/tools/workspace/workspace-search.js +11 -5
- package/dist/workflows/execute-analysis.d.ts +46 -4
- package/dist/workflows/execute-analysis.js +118 -13
- package/dist/workflows/execute-target-assessment.d.ts +3 -0
- package/dist/workflows/execute-target-assessment.js +19 -15
- package/dist/workflows/sandbox-step.d.ts +9 -0
- package/dist/workflows/sandbox-step.js +39 -17
- package/dist/workflows/target-assessment/lib/citation-validator.js +2 -2
- package/dist/workflows/target-assessment/lib/clinical-consequence-annotator.js +2 -1
- package/dist/workflows/target-assessment/lib/llm-step.d.ts +3 -0
- package/dist/workflows/target-assessment/lib/llm-step.js +3 -1
- package/dist/workflows/target-assessment/lib/structured-llm.d.ts +3 -0
- package/dist/workflows/target-assessment/lib/structured-llm.js +1 -0
- package/dist/workflows/target-assessment/phase5-persist.d.ts +3 -0
- package/dist/workflows/target-assessment/phase5-persist.js +8 -3
- package/dist/workflows/target-assessment/progress.d.ts +2 -1
- package/dist/workflows/target-assessment/progress.js +4 -3
- package/dist/workspace/filesystem.js +163 -74
- package/dist/workspace/paths.d.ts +2 -2
- package/dist/workspace/paths.js +2 -2
- package/package.json +95 -96
- package/dist/execution/filesystem-artifact-registry.d.ts +0 -57
- package/dist/execution/filesystem-artifact-registry.js +0 -92
- package/dist/lib/identifiers.d.ts +0 -8
- package/dist/lib/identifiers.js +0 -10
- package/dist/lib/mime-detect.d.ts +0 -17
- package/dist/lib/mime-detect.js +0 -29
- package/dist/lib/streamed-download.d.ts +0 -28
- package/dist/lib/streamed-download.js +0 -111
- package/dist/lib/trace-context.d.ts +0 -11
- package/dist/lib/trace-context.js +0 -49
- package/dist/providers/llm-capabilities.d.ts +0 -33
- package/dist/providers/llm-capabilities.js +0 -58
- package/dist/schemas/render-step-prompt.d.ts +0 -32
- package/dist/schemas/render-step-prompt.js +0 -76
- package/dist/tools/bio/find-approval-precedent.d.ts +0 -32
- package/dist/tools/bio/find-approval-precedent.js +0 -72
- package/dist/tools/bio/get-article-details.d.ts +0 -11
- package/dist/tools/bio/get-article-details.js +0 -20
- package/dist/tools/bio/get-article-full-text.d.ts +0 -19
- package/dist/tools/bio/get-article-full-text.js +0 -32
- package/dist/tools/bio/get-bioactivity.d.ts +0 -11
- package/dist/tools/bio/get-bioactivity.js +0 -23
- package/dist/tools/bio/get-drug-info.d.ts +0 -9
- package/dist/tools/bio/get-drug-info.js +0 -22
- package/dist/tools/bio/get-mechanism.d.ts +0 -8
- package/dist/tools/bio/get-mechanism.js +0 -18
- package/dist/tools/bio/get-pubchem-assays.d.ts +0 -22
- package/dist/tools/bio/get-pubchem-assays.js +0 -107
- package/dist/tools/bio/get-pubchem-cross-refs.d.ts +0 -15
- package/dist/tools/bio/get-pubchem-cross-refs.js +0 -68
- package/dist/tools/bio/get-target-safety.d.ts +0 -18
- package/dist/tools/bio/get-target-safety.js +0 -26
- package/dist/tools/bio/search-compounds.d.ts +0 -22
- package/dist/tools/bio/search-compounds.js +0 -160
- package/dist/tools/bio/search-ctx-chemical.d.ts +0 -50
- package/dist/tools/bio/search-ctx-chemical.js +0 -130
- package/dist/tools/bio/search-ctx-exposure.d.ts +0 -55
- package/dist/tools/bio/search-ctx-exposure.js +0 -176
- package/dist/tools/bio/search-ctx-hazard.d.ts +0 -111
- package/dist/tools/bio/search-ctx-hazard.js +0 -178
- package/dist/tools/bio/search-opentargets.d.ts +0 -11
- package/dist/tools/bio/search-opentargets.js +0 -25
- package/dist/tools/bio/search-pubchem-compound.d.ts +0 -26
- package/dist/tools/bio/search-pubchem-compound.js +0 -110
- package/dist/tools/bio/search-pubmed.d.ts +0 -17
- package/dist/tools/bio/search-pubmed.js +0 -31
- package/dist/tools/bio/search-targets.d.ts +0 -9
- package/dist/tools/bio/search-targets.js +0 -20
- package/dist/tools/bio/search-toxcast.d.ts +0 -36
- package/dist/tools/bio/search-toxcast.js +0 -141
- package/dist/workflows/register-workflows.d.ts +0 -51
- package/dist/workflows/register-workflows.js +0 -48
- package/dist/workflows/resume-execute-analysis.d.ts +0 -70
- package/dist/workflows/resume-execute-analysis.js +0 -80
- package/dist/workflows/target-assessment/correction-loop.d.ts +0 -45
- package/dist/workflows/target-assessment/correction-loop.js +0 -62
- package/dist/workflows/target-assessment/steps/phase0-resolve.d.ts +0 -71
- package/dist/workflows/target-assessment/steps/phase0-resolve.js +0 -21
- package/dist/workflows/target-assessment/steps/phase1-aggregate.d.ts +0 -1018
- package/dist/workflows/target-assessment/steps/phase1-aggregate.js +0 -25
- package/dist/workspace/mount-strategy.d.ts +0 -50
- package/dist/workspace/mount-strategy.js +0 -67
- package/dist/workspace/provenance-collector.d.ts +0 -34
- package/dist/workspace/provenance-collector.js +0 -16
- package/dist/workspace/workspace-paths.d.ts +0 -26
- package/dist/workspace/workspace-paths.js +0 -31
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Phase 1 aggregator — schema definitions retained for downstream
|
|
3
|
-
* type-checking. The DBOS workflow assembles the Phase-1 bundle inline.
|
|
4
|
-
*/
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
import { Phase1BundleSchema } from "../schemas.js";
|
|
7
|
-
import { withCoverage } from "../coverage.js";
|
|
8
|
-
import { OpenTargetsBundleSchema, ChemblModulatorsBundleSchema, CtgovBundleSchema, FaersByTargetBundleSchema, ExpressionHumanBundleSchema, ExpressionMultiSpeciesBundleSchema, ClinvarBundleSchema, CbioportalBundleSchema, ImpcBundleSchema, PubmedIndexBundleSchema, PathwaysBundleSchema, StringPpiBundleSchema, FamilyComplexesBundleSchema, TherapeuticProgramsBundleSchema, } from "../schemas.js";
|
|
9
|
-
export const Phase1AggregateInputSchema = z.object({
|
|
10
|
-
"collector-opentargets": withCoverage(OpenTargetsBundleSchema),
|
|
11
|
-
"collector-chembl-modulators": withCoverage(ChemblModulatorsBundleSchema),
|
|
12
|
-
"collector-ctgov": withCoverage(CtgovBundleSchema),
|
|
13
|
-
"collector-faers-by-target": withCoverage(FaersByTargetBundleSchema),
|
|
14
|
-
"collector-expression-human": withCoverage(ExpressionHumanBundleSchema),
|
|
15
|
-
"collector-expression-multi-species": withCoverage(ExpressionMultiSpeciesBundleSchema),
|
|
16
|
-
"collector-clinvar": withCoverage(ClinvarBundleSchema),
|
|
17
|
-
"collector-cbioportal": withCoverage(CbioportalBundleSchema),
|
|
18
|
-
"collector-impc": withCoverage(ImpcBundleSchema),
|
|
19
|
-
"collector-pubmed-index": withCoverage(PubmedIndexBundleSchema),
|
|
20
|
-
"collector-pathways": withCoverage(PathwaysBundleSchema),
|
|
21
|
-
"collector-string-ppi": withCoverage(StringPpiBundleSchema),
|
|
22
|
-
"collector-family-complexes": withCoverage(FamilyComplexesBundleSchema),
|
|
23
|
-
"collector-therapeutic-programs": withCoverage(TherapeuticProgramsBundleSchema),
|
|
24
|
-
});
|
|
25
|
-
export const phase1OutputSchema = Phase1BundleSchema;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mount strategy — single source of truth for workspace/pod mount paths.
|
|
3
|
-
*
|
|
4
|
-
* Single-mount model: one workspace mount covers the full analysis tree.
|
|
5
|
-
* Write protection is enforced via K8s RO volumeMount (execute_command) and
|
|
6
|
-
* by the harness write guard at the workspace-filesystem layer. Pod mounts
|
|
7
|
-
* are nested (K8s handles this fine — most-specific path wins).
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Canonical paths for a step.
|
|
11
|
-
*
|
|
12
|
-
* ANALYSIS is the single workspace mount (covers the full analysis tree).
|
|
13
|
-
* ARTIFACTS is a subpath within that mount (the step's writable area, used as CWD).
|
|
14
|
-
*/
|
|
15
|
-
export declare function buildMountPaths(resourceId: string, runId: string, stepId: string): {
|
|
16
|
-
/** Full analysis tree — single workspace mount. */
|
|
17
|
-
readonly ANALYSIS: `/${string}`;
|
|
18
|
-
/** Step's writable area — subpath within ANALYSIS, used as CWD. */
|
|
19
|
-
readonly ARTIFACTS: `/${string}`;
|
|
20
|
-
};
|
|
21
|
-
export interface PodMount {
|
|
22
|
-
mountPath: string;
|
|
23
|
-
subPath: string;
|
|
24
|
-
readOnly: boolean;
|
|
25
|
-
}
|
|
26
|
-
export interface DockerMount {
|
|
27
|
-
hostPath: string;
|
|
28
|
-
containerPath: string;
|
|
29
|
-
readOnly: boolean;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Build pod volumeMount specs — nested: full analysis (RO) + step area (RW).
|
|
33
|
-
* K8s handles nested mounts — the most-specific path wins.
|
|
34
|
-
*/
|
|
35
|
-
export declare function buildPodMounts(opts: {
|
|
36
|
-
resourceId: string;
|
|
37
|
-
runId: string;
|
|
38
|
-
stepId: string;
|
|
39
|
-
}): PodMount[];
|
|
40
|
-
/**
|
|
41
|
-
* Build Docker bind mount specs — same nesting logic as buildPodMounts,
|
|
42
|
-
* but with host paths derived from sessionPath.
|
|
43
|
-
* Docker handles nested mounts — the most-specific path wins.
|
|
44
|
-
*/
|
|
45
|
-
export declare function buildDockerMounts(opts: {
|
|
46
|
-
resourceId: string;
|
|
47
|
-
runId: string;
|
|
48
|
-
stepId: string;
|
|
49
|
-
sessionPath: string;
|
|
50
|
-
}): DockerMount[];
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mount strategy — single source of truth for workspace/pod mount paths.
|
|
3
|
-
*
|
|
4
|
-
* Single-mount model: one workspace mount covers the full analysis tree.
|
|
5
|
-
* Write protection is enforced via K8s RO volumeMount (execute_command) and
|
|
6
|
-
* by the harness write guard at the workspace-filesystem layer. Pod mounts
|
|
7
|
-
* are nested (K8s handles this fine — most-specific path wins).
|
|
8
|
-
*/
|
|
9
|
-
import { runStepDir } from "./paths.js";
|
|
10
|
-
import { join } from "node:path";
|
|
11
|
-
// ── Mount Path Builders ──────────────────────────────────────────────────
|
|
12
|
-
/**
|
|
13
|
-
* Canonical paths for a step.
|
|
14
|
-
*
|
|
15
|
-
* ANALYSIS is the single workspace mount (covers the full analysis tree).
|
|
16
|
-
* ARTIFACTS is a subpath within that mount (the step's writable area, used as CWD).
|
|
17
|
-
*/
|
|
18
|
-
export function buildMountPaths(resourceId, runId, stepId) {
|
|
19
|
-
return {
|
|
20
|
-
/** Full analysis tree — single workspace mount. */
|
|
21
|
-
ANALYSIS: `/${resourceId}`,
|
|
22
|
-
/** Step's writable area — subpath within ANALYSIS, used as CWD. */
|
|
23
|
-
ARTIFACTS: `/${runStepDir(resourceId, runId, stepId)}`,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
// ── Pod mounts ──────────────────────────────────────────────────────────
|
|
27
|
-
/**
|
|
28
|
-
* Build pod volumeMount specs — nested: full analysis (RO) + step area (RW).
|
|
29
|
-
* K8s handles nested mounts — the most-specific path wins.
|
|
30
|
-
*/
|
|
31
|
-
export function buildPodMounts(opts) {
|
|
32
|
-
const mp = buildMountPaths(opts.resourceId, opts.runId, opts.stepId);
|
|
33
|
-
return [
|
|
34
|
-
{
|
|
35
|
-
mountPath: mp.ANALYSIS,
|
|
36
|
-
subPath: opts.resourceId,
|
|
37
|
-
readOnly: true,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
mountPath: mp.ARTIFACTS,
|
|
41
|
-
subPath: runStepDir(opts.resourceId, opts.runId, opts.stepId),
|
|
42
|
-
readOnly: false,
|
|
43
|
-
},
|
|
44
|
-
];
|
|
45
|
-
}
|
|
46
|
-
// ── Docker bind mounts ─────────────────────────────────────────────────
|
|
47
|
-
/**
|
|
48
|
-
* Build Docker bind mount specs — same nesting logic as buildPodMounts,
|
|
49
|
-
* but with host paths derived from sessionPath.
|
|
50
|
-
* Docker handles nested mounts — the most-specific path wins.
|
|
51
|
-
*/
|
|
52
|
-
export function buildDockerMounts(opts) {
|
|
53
|
-
const mp = buildMountPaths(opts.resourceId, opts.runId, opts.stepId);
|
|
54
|
-
const stepRelPath = runStepDir(opts.resourceId, opts.runId, opts.stepId);
|
|
55
|
-
return [
|
|
56
|
-
{
|
|
57
|
-
hostPath: join(opts.sessionPath, opts.resourceId),
|
|
58
|
-
containerPath: mp.ANALYSIS,
|
|
59
|
-
readOnly: true,
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
hostPath: join(opts.sessionPath, stepRelPath),
|
|
63
|
-
containerPath: mp.ARTIFACTS,
|
|
64
|
-
readOnly: false,
|
|
65
|
-
},
|
|
66
|
-
];
|
|
67
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Provenance collector seam — the mutate surface records a SHA-256 content
|
|
3
|
-
* snapshot at each write. Construction-time dependency (see the harness-durable-runtime spec): the
|
|
4
|
-
* composition root builds a `ProvenanceCollector` and passes it to the
|
|
5
|
-
* mutate tool factories.
|
|
6
|
-
*
|
|
7
|
-
* Captured here are *harness-side* writes (`write_file`, `edit_file`). The
|
|
8
|
-
* harness does NOT hash in-sandbox writes produced by `execute_command`'s
|
|
9
|
-
* arbitrary commands — sandbox-server emits its own provenance frames per
|
|
10
|
-
* `sandbox-provenance-tracking` and artifact registration reconciles them.
|
|
11
|
-
*
|
|
12
|
-
* `recordSnapshot` is best-effort metadata: collector failures SHALL NOT
|
|
13
|
-
* fail the write. The mutate tools catch and log internally; this contract
|
|
14
|
-
* does not require the collector to be non-throwing.
|
|
15
|
-
*/
|
|
16
|
-
export interface ProvenanceSnapshot {
|
|
17
|
-
readonly analysisId: string;
|
|
18
|
-
readonly runId: string;
|
|
19
|
-
readonly stepId: string;
|
|
20
|
-
/**
|
|
21
|
-
* The resolved workspace path of the written file — the sandbox-visible
|
|
22
|
-
* path (e.g. `/{analysisId}/runs/{runId}/{stepId}/output/x.csv`), which is
|
|
23
|
-
* the same path the read surface uses.
|
|
24
|
-
*/
|
|
25
|
-
readonly path: string;
|
|
26
|
-
/** Lowercase hex SHA-256 of the *written* content (post-edit for edit_file). */
|
|
27
|
-
readonly sha256: string;
|
|
28
|
-
readonly bytes: number;
|
|
29
|
-
/** Unix milliseconds at the time of recording. */
|
|
30
|
-
readonly timestamp: number;
|
|
31
|
-
}
|
|
32
|
-
export interface ProvenanceCollector {
|
|
33
|
-
recordSnapshot(snapshot: ProvenanceSnapshot): Promise<void>;
|
|
34
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Provenance collector seam — the mutate surface records a SHA-256 content
|
|
3
|
-
* snapshot at each write. Construction-time dependency (see the harness-durable-runtime spec): the
|
|
4
|
-
* composition root builds a `ProvenanceCollector` and passes it to the
|
|
5
|
-
* mutate tool factories.
|
|
6
|
-
*
|
|
7
|
-
* Captured here are *harness-side* writes (`write_file`, `edit_file`). The
|
|
8
|
-
* harness does NOT hash in-sandbox writes produced by `execute_command`'s
|
|
9
|
-
* arbitrary commands — sandbox-server emits its own provenance frames per
|
|
10
|
-
* `sandbox-provenance-tracking` and artifact registration reconciles them.
|
|
11
|
-
*
|
|
12
|
-
* `recordSnapshot` is best-effort metadata: collector failures SHALL NOT
|
|
13
|
-
* fail the write. The mutate tools catch and log internally; this contract
|
|
14
|
-
* does not require the collector to be non-throwing.
|
|
15
|
-
*/
|
|
16
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workspace paths — single source of truth for all agent-visible paths.
|
|
3
|
-
*
|
|
4
|
-
* Composes mount points (buildMountPaths()) with step subdirectory types
|
|
5
|
-
* (STEP_SUBDIRS) into the full paths that agents use in workspace tools.
|
|
6
|
-
*
|
|
7
|
-
* Import from here — not from mount-strategy or paths directly — when
|
|
8
|
-
* you need paths that agents will see.
|
|
9
|
-
*/
|
|
10
|
-
import { buildMountPaths } from "./mount-strategy.js";
|
|
11
|
-
import { STEP_SUBDIRS, type StepSubdirType } from "./paths.js";
|
|
12
|
-
export { buildMountPaths };
|
|
13
|
-
export { STEP_SUBDIRS, type StepSubdirType };
|
|
14
|
-
/**
|
|
15
|
-
* Build artifact subdirectory paths for a step using canonical mount paths.
|
|
16
|
-
* Agents see these paths in workspace tools and prompts.
|
|
17
|
-
*/
|
|
18
|
-
export declare function buildArtifactDirs(resourceId: string, runId: string, stepId: string): {
|
|
19
|
-
readonly OUTPUT: `/${string}/output`;
|
|
20
|
-
readonly SCRIPTS: `/${string}/scripts`;
|
|
21
|
-
readonly FIGURES: `/${string}/figures`;
|
|
22
|
-
readonly LOGS: `/${string}/logs`;
|
|
23
|
-
readonly NOTEBOOKS: `/${string}/notebooks`;
|
|
24
|
-
};
|
|
25
|
-
/** Resolved sessions base path. */
|
|
26
|
-
export declare function sessionsBasePath(sessionsBasePath: string): string;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workspace paths — single source of truth for all agent-visible paths.
|
|
3
|
-
*
|
|
4
|
-
* Composes mount points (buildMountPaths()) with step subdirectory types
|
|
5
|
-
* (STEP_SUBDIRS) into the full paths that agents use in workspace tools.
|
|
6
|
-
*
|
|
7
|
-
* Import from here — not from mount-strategy or paths directly — when
|
|
8
|
-
* you need paths that agents will see.
|
|
9
|
-
*/
|
|
10
|
-
import { buildMountPaths } from "./mount-strategy.js";
|
|
11
|
-
import { STEP_SUBDIRS } from "./paths.js";
|
|
12
|
-
export { buildMountPaths };
|
|
13
|
-
export { STEP_SUBDIRS };
|
|
14
|
-
/**
|
|
15
|
-
* Build artifact subdirectory paths for a step using canonical mount paths.
|
|
16
|
-
* Agents see these paths in workspace tools and prompts.
|
|
17
|
-
*/
|
|
18
|
-
export function buildArtifactDirs(resourceId, runId, stepId) {
|
|
19
|
-
const mp = buildMountPaths(resourceId, runId, stepId);
|
|
20
|
-
return {
|
|
21
|
-
OUTPUT: `${mp.ARTIFACTS}/output`,
|
|
22
|
-
SCRIPTS: `${mp.ARTIFACTS}/scripts`,
|
|
23
|
-
FIGURES: `${mp.ARTIFACTS}/figures`,
|
|
24
|
-
LOGS: `${mp.ARTIFACTS}/logs`,
|
|
25
|
-
NOTEBOOKS: `${mp.ARTIFACTS}/notebooks`,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
/** Resolved sessions base path. */
|
|
29
|
-
export function sessionsBasePath(sessionsBasePath) {
|
|
30
|
-
return sessionsBasePath;
|
|
31
|
-
}
|