@tiangong-ai/cli 0.0.59 → 0.0.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +2 -2
- package/README.md +287 -41
- package/dist/research/orchestration.js +209 -62
- package/dist/research/orchestration.js.map +1 -1
- package/dist/research/workspace/acquisition-forecast.d.ts +3 -0
- package/dist/research/workspace/acquisition-forecast.js +28 -3
- package/dist/research/workspace/acquisition-forecast.js.map +1 -1
- package/dist/research/workspace/acquisition-revision.d.ts +13 -0
- package/dist/research/workspace/acquisition-revision.js +142 -0
- package/dist/research/workspace/acquisition-revision.js.map +1 -0
- package/dist/research/workspace/acquisition-routes.d.ts +1 -1
- package/dist/research/workspace/acquisition-routes.js +2 -11
- package/dist/research/workspace/acquisition-routes.js.map +1 -1
- package/dist/research/workspace/acquisition.d.ts +3 -1
- package/dist/research/workspace/acquisition.js +67 -35
- package/dist/research/workspace/acquisition.js.map +1 -1
- package/dist/research/workspace/analysis-run.d.ts +2 -0
- package/dist/research/workspace/analysis-run.js +28 -0
- package/dist/research/workspace/analysis-run.js.map +1 -0
- package/dist/research/workspace/artifact-read-audit.d.ts +16 -0
- package/dist/research/workspace/artifact-read-audit.js +176 -0
- package/dist/research/workspace/artifact-read-audit.js.map +1 -0
- package/dist/research/workspace/artifact-trace.d.ts +12 -0
- package/dist/research/workspace/artifact-trace.js +109 -0
- package/dist/research/workspace/artifact-trace.js.map +1 -0
- package/dist/research/workspace/artifact-view-mcp.d.ts +75 -0
- package/dist/research/workspace/artifact-view-mcp.js +214 -0
- package/dist/research/workspace/artifact-view-mcp.js.map +1 -0
- package/dist/research/workspace/artifact-views.d.ts +100 -0
- package/dist/research/workspace/artifact-views.js +395 -0
- package/dist/research/workspace/artifact-views.js.map +1 -0
- package/dist/research/workspace/artifacts.d.ts +3 -0
- package/dist/research/workspace/artifacts.js +13 -0
- package/dist/research/workspace/artifacts.js.map +1 -1
- package/dist/research/workspace/audit-bundle.d.ts +9 -0
- package/dist/research/workspace/audit-bundle.js +124 -8
- package/dist/research/workspace/audit-bundle.js.map +1 -1
- package/dist/research/workspace/content-evidence.d.ts +3 -0
- package/dist/research/workspace/content-evidence.js +149 -22
- package/dist/research/workspace/content-evidence.js.map +1 -1
- package/dist/research/workspace/executor.d.ts +5 -1
- package/dist/research/workspace/executor.js +106 -22
- package/dist/research/workspace/executor.js.map +1 -1
- package/dist/research/workspace/native-run.d.ts +77 -0
- package/dist/research/workspace/native-run.js +637 -0
- package/dist/research/workspace/native-run.js.map +1 -0
- package/dist/research/workspace/preflight.d.ts +8 -2
- package/dist/research/workspace/preflight.js +17 -14
- package/dist/research/workspace/preflight.js.map +1 -1
- package/dist/research/workspace/project-authority.d.ts +21 -0
- package/dist/research/workspace/project-authority.js +186 -0
- package/dist/research/workspace/project-authority.js.map +1 -0
- package/dist/research/workspace/project-mutations.d.ts +26 -0
- package/dist/research/workspace/project-mutations.js +332 -0
- package/dist/research/workspace/project-mutations.js.map +1 -0
- package/dist/research/workspace/projects.d.ts +2 -1
- package/dist/research/workspace/projects.js +133 -91
- package/dist/research/workspace/projects.js.map +1 -1
- package/dist/research/workspace/publication-workflow.d.ts +3 -0
- package/dist/research/workspace/publication-workflow.js +15 -3
- package/dist/research/workspace/publication-workflow.js.map +1 -1
- package/dist/research/workspace/request-provenance.d.ts +67 -0
- package/dist/research/workspace/request-provenance.js +115 -0
- package/dist/research/workspace/request-provenance.js.map +1 -0
- package/dist/research/workspace/review-executor.js +22 -11
- package/dist/research/workspace/review-executor.js.map +1 -1
- package/dist/research/workspace/runtime.d.ts +57 -0
- package/dist/research/workspace/runtime.js +292 -140
- package/dist/research/workspace/runtime.js.map +1 -1
- package/dist/research/workspace/sanitization.js +1 -1
- package/dist/research/workspace/sanitization.js.map +1 -1
- package/dist/research/workspace/schema-compatibility.d.ts +5 -0
- package/dist/research/workspace/schema-compatibility.js +55 -0
- package/dist/research/workspace/schema-compatibility.js.map +1 -0
- package/dist/research/workspace/schemas.d.ts +6 -0
- package/dist/research/workspace/schemas.js +13 -2
- package/dist/research/workspace/schemas.js.map +1 -1
- package/dist/research/workspace/scientific-design.js +8 -17
- package/dist/research/workspace/scientific-design.js.map +1 -1
- package/dist/research/workspace/scientific-fulfillment-audit.d.ts +3 -0
- package/dist/research/workspace/scientific-fulfillment-audit.js +137 -0
- package/dist/research/workspace/scientific-fulfillment-audit.js.map +1 -0
- package/dist/research/workspace/scientific-fulfillment.d.ts +121 -0
- package/dist/research/workspace/scientific-fulfillment.js +539 -0
- package/dist/research/workspace/scientific-fulfillment.js.map +1 -0
- package/dist/research/workspace/scientific-review-execution.js +84 -61
- package/dist/research/workspace/scientific-review-execution.js.map +1 -1
- package/dist/research/workspace/scientific-review.d.ts +8 -2
- package/dist/research/workspace/scientific-review.js +205 -53
- package/dist/research/workspace/scientific-review.js.map +1 -1
- package/dist/research/workspace/setup-catalog.js +2 -2
- package/dist/research/workspace/task-acceptance.d.ts +134 -0
- package/dist/research/workspace/task-acceptance.js +544 -0
- package/dist/research/workspace/task-acceptance.js.map +1 -0
- package/dist/research/workspace/task-audit.d.ts +12 -0
- package/dist/research/workspace/task-audit.js +231 -0
- package/dist/research/workspace/task-audit.js.map +1 -0
- package/dist/research/workspace/task-contract.d.ts +142 -0
- package/dist/research/workspace/task-contract.js +506 -0
- package/dist/research/workspace/task-contract.js.map +1 -0
- package/dist/research/workspace/types.d.ts +6 -3
- package/dist/research/workspace/workspace.js +11 -8
- package/dist/research/workspace/workspace.js.map +1 -1
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -17,8 +17,8 @@ checkPaths:
|
|
|
17
17
|
- .docpact/config.yaml
|
|
18
18
|
- docs/agents/**
|
|
19
19
|
- src/**
|
|
20
|
-
lastReviewedAt: 2026-09-
|
|
21
|
-
lastReviewedCommit:
|
|
20
|
+
lastReviewedAt: 2026-09-04
|
|
21
|
+
lastReviewedCommit: 4cb45f23331677a7c713f20f3aa3cbb65afe9358
|
|
22
22
|
---
|
|
23
23
|
|
|
24
24
|
# Tiangong AI CLI Contract
|
package/README.md
CHANGED
|
@@ -12,8 +12,8 @@ checkPaths:
|
|
|
12
12
|
- package.json
|
|
13
13
|
- bin/**
|
|
14
14
|
- src/**
|
|
15
|
-
lastReviewedAt: 2026-09-
|
|
16
|
-
lastReviewedCommit:
|
|
15
|
+
lastReviewedAt: 2026-09-04
|
|
16
|
+
lastReviewedCommit: 25b236a15c846c0168ffb84f8afa390d71985f4b
|
|
17
17
|
---
|
|
18
18
|
|
|
19
19
|
# Tiangong AI CLI
|
|
@@ -607,8 +607,9 @@ owns the same due gate. Pending implementations use `null` for implementation
|
|
|
607
607
|
SHA-256, locator, and entrypoint; pending environments use `null` for lock
|
|
608
608
|
SHA-256 and locator. They are exposed in every earlier review packet as
|
|
609
609
|
`futureGateObligations` and become blocking mechanical errors at that gate.
|
|
610
|
-
|
|
611
|
-
|
|
610
|
+
Their predeclared slots may be fulfilled through the append-only same-project
|
|
611
|
+
command below. The original design bytes never change; a material assumption,
|
|
612
|
+
question, policy or already-frozen value still requires a reviewed successor.
|
|
612
613
|
|
|
613
614
|
Use the same Policy project ID and exact design when preflighting and admitting
|
|
614
615
|
the research project:
|
|
@@ -677,6 +678,16 @@ schema-valid, packet/session-bound review. A saved successful execution is
|
|
|
677
678
|
replayed without another model call after revalidating its immutable proof.
|
|
678
679
|
Failures require explicit `--retry` and remain bounded by the attempt budget;
|
|
679
680
|
unreported usage and interrupted wall time retain conservative reservations.
|
|
681
|
+
Failed processes return a bounded, sanitized exit diagnostic and record it in
|
|
682
|
+
the journal; no full prompt or raw authentication output is persisted. Automatic
|
|
683
|
+
Claude invocation uses the same dialect-annotation conversion as
|
|
684
|
+
`research schema show NAME --compatibility claude-code`; canonical controller
|
|
685
|
+
validation and its scientific constraints remain unchanged.
|
|
686
|
+
The provider view explicitly types scalar constants/enums; returned values are
|
|
687
|
+
never coerced to satisfy the canonical schema.
|
|
688
|
+
Claude's structured result is used instead of any accompanying narrative;
|
|
689
|
+
declared error results remain failures, with their safe diagnostic ahead of
|
|
690
|
+
incidental stderr warnings.
|
|
680
691
|
A nonpassing mechanical packet can receive an independent stop verdict, never
|
|
681
692
|
an override. The existing manual submit command remains available for an exact
|
|
682
693
|
independent review.
|
|
@@ -685,6 +696,8 @@ Reviewer status is read-only and transport-aware. Native-direct does not
|
|
|
685
696
|
require a bridge connection. Smoke configuration readiness is explicitly not
|
|
686
697
|
production readiness and does not demand an attestation that smoke mode never
|
|
687
698
|
writes. Production still requires its current reviewer doctor attestation.
|
|
699
|
+
Packet read responses carry their actual content and receipt together; a
|
|
700
|
+
receipt alone does not establish that the host displayed the content to its model.
|
|
688
701
|
|
|
689
702
|
Repeat the same prepare/execute route for `evidence-construct`, adding an
|
|
690
703
|
owner-reviewed JSON array of absolute canonical canary paths with
|
|
@@ -712,9 +725,15 @@ submission manifest must bind distinct absolute files for cover letter, title
|
|
|
712
725
|
page, reporting checklist, data availability, code availability, and source
|
|
713
726
|
data; figure/table index, extended data, and supplementary methods are optional.
|
|
714
727
|
`research publication freeze` then content-addresses the Policy, scientific
|
|
715
|
-
design and early reviews, acquisition/content/inference snapshots,
|
|
728
|
+
design and early reviews, acquisition/content/inference snapshots, mode-bound
|
|
716
729
|
analysis, Claim-Evidence Graph, base outputs, manuscript, assessment,
|
|
717
730
|
supplements, role-complete submission files, and reproducibility manifest.
|
|
731
|
+
Computational/mixed analysis still requires reproduced metadata with exact
|
|
732
|
+
implementation/environment bindings. Qualitative analysis uses
|
|
733
|
+
`status: not-applicable`, null command/seed and empty implementation/environment
|
|
734
|
+
lists; it must not invent a computation. Both paths retain the same evidence,
|
|
735
|
+
graph, Policy and independent-review checks. Metadata alone is not proof that
|
|
736
|
+
a computation was executed.
|
|
718
737
|
Exactly four fresh independent sessions review that frozen generation:
|
|
719
738
|
evidence, methods/reproducibility, domain/novelty, and journal-editor. A revised
|
|
720
739
|
manuscript invalidates prior reviews. Every reviewer must use the configured
|
|
@@ -753,6 +772,12 @@ derivatives. Credentials, setup
|
|
|
753
772
|
sources, browser profiles, native active state, capsules, unrelated projects,
|
|
754
773
|
and host-specific absolute paths are excluded.
|
|
755
774
|
|
|
775
|
+
Text inspection distinguishes internal identifiers such as `interruptedSessionId`
|
|
776
|
+
from credential fields. It checks raw text and read-only decoded JSON/JSONL,
|
|
777
|
+
including escaped keys and nested string payloads, while retaining the exact
|
|
778
|
+
evidence and ledger bytes. Authentication values remain blocked even when wrapped
|
|
779
|
+
in arrays or objects; an identifier's UUID shape is never a credential exemption.
|
|
780
|
+
|
|
756
781
|
```bash
|
|
757
782
|
tiangong-ai research project audit export top-journal-paper \
|
|
758
783
|
--output /absolute/path/to/new-audit-directory \
|
|
@@ -853,8 +878,10 @@ For large local sources, pass an immutable `--input-plan` to both preflight and
|
|
|
853
878
|
project initialization. Each plan entry may expose either a separate
|
|
854
879
|
`contextPath` or non-overlapping, one-based `contextRanges`; the producer sees
|
|
855
880
|
only that bounded context, while independent review receives the hash-verified
|
|
856
|
-
full source. Symlinks, duplicate content
|
|
857
|
-
|
|
881
|
+
full source. Symlinks, duplicate content and changed hashes are rejected.
|
|
882
|
+
There is no total stage-context length gate: large admitted objects remain complete
|
|
883
|
+
and are read through the packet's artifact directory instead of being forced into
|
|
884
|
+
the initial prompt. This does not expose files deliberately withheld by an input plan.
|
|
858
885
|
|
|
859
886
|
The workspace stores its current protocol state under `.tiangong-research/`.
|
|
860
887
|
Each project follows the evidence-first sequence: broad discovery, strict
|
|
@@ -865,6 +892,13 @@ CodeBuddy session. The CLI never launches a nested producer process. Independent
|
|
|
865
892
|
runs through the other configured agent family's CLI, and execution is blocked
|
|
866
893
|
when the two roles use the same family.
|
|
867
894
|
|
|
895
|
+
Native packets direct the host to save one new JSON submission file, not to write
|
|
896
|
+
admitted output paths. Acquire may retrieve files and readable derivatives for
|
|
897
|
+
provisionally admitted sources through the packet's binding/registration commands;
|
|
898
|
+
it may not reopen discovery. Analyze, synthesize and the isolated reviewer retain
|
|
899
|
+
their no-new-evidence boundary. Headless reviewer prompts remain capsule-scoped
|
|
900
|
+
and return JSON rather than saving native submission files.
|
|
901
|
+
|
|
868
902
|
Every workspace mutation is serialized by an owner-recorded directory lease
|
|
869
903
|
with a heartbeat. A later command immediately reclaims a lease whose same-host
|
|
870
904
|
owner process is definitely dead; an unverifiable cross-host lease is reclaimed
|
|
@@ -1016,6 +1050,14 @@ deficits; exit `0` means only potential eligibility, never successful atom
|
|
|
1016
1050
|
registration, content freeze, independence certification, or review. Pending
|
|
1017
1051
|
input materialization, decomposition, and exact atom assignments remain
|
|
1018
1052
|
explicit. Re-run after material acquisition changes, not after every atom.
|
|
1053
|
+
`submissionGate` separately reports deterministic acquire-submit blockers;
|
|
1054
|
+
`potentially-ready` is not an inference/content pass. An accepted binary without
|
|
1055
|
+
required readable content stops before submission, while an honest incomplete
|
|
1056
|
+
audit may still freeze its limitations and separate inference-stop decision.
|
|
1057
|
+
An admitted local PDF/Office file alone is not producer-readable. Forecast uses
|
|
1058
|
+
the same media rules as artifact registration and reports a missing readable
|
|
1059
|
+
derivative unless a verified readable artifact or admitted text/context input
|
|
1060
|
+
is available. This classification does not reread or decode the binary again.
|
|
1019
1061
|
Flat `sourceTypeRequirements` arrays mean **all-of**. A design may instead use
|
|
1020
1062
|
`{"allOf":["academic-paper"],"anyOf":["government","industry"],"atLeast":{"count":2,"from":["academic-paper","government","industry"]}}`;
|
|
1021
1063
|
every present group applies, and counts use distinct types. Forecast, typed
|
|
@@ -1151,7 +1193,8 @@ total tokens, USD 5,000, 30 days, and package ceilings of 12,000,000 for discove
|
|
|
1151
1193
|
acquisition, 1,500,000 each for analysis and synthesis, and 2,500,000 for
|
|
1152
1194
|
review. Primary output is bounded at 32,000 tokens and a separately invoked
|
|
1153
1195
|
repair at 16,000. The production broker hard ceiling is 256 bounded views with
|
|
1154
|
-
32,000 context tokens per view
|
|
1196
|
+
32,000 context tokens per broker view. The legacy `maxInputContextTokens` setting
|
|
1197
|
+
is an embedding/planning hint, not an input admission or artifact-read ceiling.
|
|
1155
1198
|
Top-journal admission additionally reserves three early scientific reviews at
|
|
1156
1199
|
500,000 tokens each, four final publication reviews at 750,000 each, and one
|
|
1157
1200
|
4,000,000-token revision cycle, including their finite wall-time allowances.
|
|
@@ -1160,7 +1203,7 @@ stop control ordinary use, while the finite ceilings, three attempts per
|
|
|
1160
1203
|
package, and explicit confirmation above the cost threshold stop runaway work.
|
|
1161
1204
|
Smoke-test workspaces retain their smaller low-cost defaults.
|
|
1162
1205
|
Before project initialization and every executable package, the control plane
|
|
1163
|
-
requires
|
|
1206
|
+
requires a token and conservative price estimate to fit the finite execution budget. Native
|
|
1164
1207
|
producer stages reserve prompt, schema, admitted context, bounded broker
|
|
1165
1208
|
context, and output allowance, but the host app does not expose trusted
|
|
1166
1209
|
per-stage usage telemetry to this CLI. A successful native submit therefore
|
|
@@ -1170,9 +1213,14 @@ output bytes/tokens, provenance, coverage, hashes, and remaining project budget.
|
|
|
1170
1213
|
It does not claim a provider-side turn or output-token cap for the host app.
|
|
1171
1214
|
|
|
1172
1215
|
Independent review uses the pre-call reservation calculator and the reviewer's
|
|
1173
|
-
provider-side structured-output/turn controls where available.
|
|
1174
|
-
|
|
1175
|
-
|
|
1216
|
+
provider-side structured-output/turn controls where available. Claude packet-only
|
|
1217
|
+
review has a 64-turn provider guard; Codex uses the existing finite wall-time and
|
|
1218
|
+
token/cost guards because its CLI has no equivalent turn flag. Planning uses a
|
|
1219
|
+
small initial-context estimate and expected reads, not the entire corpus or an
|
|
1220
|
+
unbounded legacy context hint. Preflight reports `inputContextTokenLimit=null`.
|
|
1221
|
+
These are approximate estimates, not precise billing; scientific review keeps
|
|
1222
|
+
the approved remaining cost ceiling separate from its rough read-cost estimate.
|
|
1223
|
+
Formatting repair remains one separately budgeted,
|
|
1176
1224
|
tool-free JSON correction. Production workspaces enforce a finite 256-view
|
|
1177
1225
|
broker ceiling mechanically, while each project derives a much smaller working
|
|
1178
1226
|
budget from its reviewed coverage requirements and stops early when they are
|
|
@@ -1197,8 +1245,9 @@ context, evidence objects, and registered local input hashes before recording
|
|
|
1197
1245
|
their safe locators. Capsule deletion therefore does not delete the durable
|
|
1198
1246
|
review chain.
|
|
1199
1247
|
|
|
1200
|
-
Native discovery preparation
|
|
1201
|
-
each external Skill's top-level `SKILL.md
|
|
1248
|
+
Native discovery preparation supplies the exact staged capability manifest and
|
|
1249
|
+
each external Skill's top-level `SKILL.md` inline or by an exact artifact reference.
|
|
1250
|
+
It also projects every built-in data
|
|
1202
1251
|
operation dynamically, with no per-provider Research adapter. The current host
|
|
1203
1252
|
may fetch generic broker evidence with `research project evidence fetch`, whose bounded request file
|
|
1204
1253
|
contains logical IDs but no credential values. The manifest includes the locked,
|
|
@@ -1226,19 +1275,37 @@ credentialed operation must resolve its namespaced logical credential from the
|
|
|
1226
1275
|
workspace's owner-only store or it is blocked before any provider request.
|
|
1227
1276
|
Standalone `tiangong-ai data run` keeps its separate manifest-declared
|
|
1228
1277
|
environment-variable policy. A blocked data result is not promoted to evidence.
|
|
1229
|
-
Analyze and synthesize packets contain
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1278
|
+
Analyze and synthesize packets contain hash-verified prior-stage artifacts and
|
|
1279
|
+
require no external evidence calls. Base and scientific review use only the
|
|
1280
|
+
packet-bound `research_list_artifacts` and `research_read_artifact` tools; shell,
|
|
1281
|
+
general filesystem, browser, broker and undeclared integrations remain disabled.
|
|
1282
|
+
The same surface works through native-direct and the signed sandbox-bridge.
|
|
1283
|
+
Small objects/excerpts are included initially; large objects are referenced without
|
|
1284
|
+
rejecting the stage. Broker excerpts prioritize deterministic, sanitized
|
|
1235
1285
|
projections of the exact raw-response items selected by admitted evidence JSON
|
|
1236
1286
|
Pointers; uncited receipts retain metadata-only bindings, and unresolved
|
|
1237
1287
|
pointers receive a bounded-context fallback. The packet hash is schema-bound, but complete packet
|
|
1238
1288
|
metadata is not redundantly copied into model context. Full local files,
|
|
1239
|
-
original per-receipt
|
|
1240
|
-
|
|
1241
|
-
|
|
1289
|
+
original per-receipt contexts, raw broker objects, checks and counterevidence stay
|
|
1290
|
+
discoverable in the exact directory. Reads use opaque object IDs and byte offsets;
|
|
1291
|
+
UTF-8 pages preserve character boundaries. Omit `length` for a 16 KiB page or use
|
|
1292
|
+
`length: null` for the whole object, without a CLI read-length ceiling. Objects
|
|
1293
|
+
actually read are preserved under `reads/objects/`, with exact directory and
|
|
1294
|
+
packet/object/view hash receipts. Receipts prove bytes delivered, not comprehension
|
|
1295
|
+
or scientific truth; actual provider/model capacity remains a limitation.
|
|
1296
|
+
|
|
1297
|
+
Native hosts can use the same primitives without adding an IDE integration:
|
|
1298
|
+
|
|
1299
|
+
```bash
|
|
1300
|
+
tiangong-ai research project stage artifacts PROJECT --session SESSION --workspace /absolute/workspace --json
|
|
1301
|
+
tiangong-ai research project stage read PROJECT --session SESSION --artifact OBJECT_ID --offset 0 --length 16384 --workspace /absolute/workspace --json
|
|
1302
|
+
tiangong-ai research project stage read PROJECT --session SESSION --artifact OBJECT_ID --length all --workspace /absolute/workspace --json
|
|
1303
|
+
```
|
|
1304
|
+
|
|
1305
|
+
Follow `nextOffset` for subsequent pages. `--encoding base64` explicitly requests
|
|
1306
|
+
binary bytes; prefer a registered text derivative for interpretation. The channel
|
|
1307
|
+
does not scan arbitrary host paths or discover files created after the snapshot.
|
|
1308
|
+
Stopped, changed or expired native sessions cannot read through it.
|
|
1242
1309
|
The CLI mechanically derives local full-text availability, source types,
|
|
1243
1310
|
counts, date coverage, source IDs, and the coverage decision. A `partial`
|
|
1244
1311
|
dimension is usable but incomplete; a missing dimension or unmet declared
|
|
@@ -1370,27 +1437,206 @@ read-only under `outputs/revisions/synthesize/<sha256>/report.md`; review and
|
|
|
1370
1437
|
closure are invalidated, while unchanged discovery, acquisition, content,
|
|
1371
1438
|
inference, analysis, and graph objects remain bound.
|
|
1372
1439
|
|
|
1373
|
-
Recovery
|
|
1374
|
-
|
|
1375
|
-
|
|
1440
|
+
Recovery forks have one journal commit point. Before `project.forked` commits,
|
|
1441
|
+
their target is staging, not an authoritative project; the original source
|
|
1442
|
+
remains authoritative. Status, run and native/reviewer admission share that
|
|
1443
|
+
same verified lineage view. A source typed-content snapshot is revalidated
|
|
1376
1444
|
and re-signed for the target generation instead of copying its project-bound
|
|
1377
1445
|
hash. Top-journal generations may resume only through `acquire`, because the
|
|
1378
1446
|
target-specific scientific design must complete fresh evidence-construct and
|
|
1379
|
-
pilot-methods reviews before analysis.
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
`
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1447
|
+
pilot-methods reviews before analysis.
|
|
1448
|
+
|
|
1449
|
+
After process interruption, repeat the same explicit fork request. The next
|
|
1450
|
+
lease holder settles only hash-bound CLI-owned pending operations: before
|
|
1451
|
+
commit it retains the interrupted target under
|
|
1452
|
+
`lineage/interrupted-project-mutations/<operation-id>/target`, outside the
|
|
1453
|
+
project namespace; after commit it finishes source/ledger projections. Exact
|
|
1454
|
+
committed replay returns the existing target without recopying evidence or
|
|
1455
|
+
repeating provider work. A different request for that target is a conflict.
|
|
1456
|
+
An unchanged completed retry request is likewise acknowledged without another
|
|
1457
|
+
revision or attempt. A subsequent real failure can still be retried normally.
|
|
1458
|
+
|
|
1459
|
+
Unknown targets, symlink replacements, modified source state and invalid
|
|
1460
|
+
recovery metadata are not overwritten or deleted. Resolve the reported
|
|
1461
|
+
`RESEARCH_PROJECT_RECOVERY_REQUIRED` conflict or restore a trusted backup before
|
|
1462
|
+
retrying; do not forge control files. Read-only status ignores never-committed
|
|
1463
|
+
directories without project state and reports existing uncommitted derived
|
|
1464
|
+
states as invalid. Missing state for a committed project is still an error.
|
|
1465
|
+
Recovery does not truncate a corrupt journal or claim power-loss durability.
|
|
1466
|
+
|
|
1467
|
+
To repair completed acquisition before any analysis attempt, prefer an explicit
|
|
1468
|
+
same-project revision when question, Policy, design, and requirements are unchanged:
|
|
1469
|
+
|
|
1470
|
+
```bash
|
|
1471
|
+
tiangong-ai research project evidence acquisition revise PROJECT \
|
|
1472
|
+
--expected-snapshot <current-acquisition-sha256> \
|
|
1473
|
+
--reason "Add the verified readable derivative before analysis" \
|
|
1474
|
+
--workspace /absolute/workspace --json
|
|
1475
|
+
```
|
|
1476
|
+
|
|
1477
|
+
This reopens acquire, preserves discovery, exact artifacts/receipts, historical
|
|
1478
|
+
snapshot bytes, budgets already spent, and the research-design approval. It
|
|
1479
|
+
invalidates evidence-construct and pilot-methods approvals because their evidence
|
|
1480
|
+
changed. Add `--include-discovery` only when new sources must be discovered or
|
|
1481
|
+
admitted; that explicitly reopens discover then acquire without a new project or
|
|
1482
|
+
automatic provider call. Prepare the returned stage, reuse unchanged objects,
|
|
1483
|
+
forecast once per meaningful batch, submit the complete revised audit, and rebuild
|
|
1484
|
+
typed content. Exact revision replay is idempotent. Stale snapshots, active native
|
|
1485
|
+
sessions, unresolved handoffs, inference freezes, and later attempts are refused.
|
|
1486
|
+
|
|
1487
|
+
Changed failed/limited decomposition records can be superseded under a descendant
|
|
1488
|
+
acquisition snapshot; unchanged records are reused. Single and batch intake share
|
|
1489
|
+
this rule. Historical records remain immutable, and atoms from deselected artifacts
|
|
1490
|
+
cannot fill current coverage. Same-snapshot conflicting extraction still fails.
|
|
1491
|
+
|
|
1492
|
+
Actual question/Policy/design changes or post-analysis work require the existing
|
|
1493
|
+
fork/addendum flow. Pre-feature snapshots without immutable evidence records cannot
|
|
1494
|
+
be repaired in place; use `research project fork SOURCE --to TARGET
|
|
1495
|
+
--resume-through discover` to reuse discovery/receipts/artifacts, or explicitly
|
|
1496
|
+
start a new generation. There is no automatic migration. A top-journal successor
|
|
1497
|
+
requires a Policy approved for TARGET and `--design`, `--design-producer-agent`,
|
|
1498
|
+
and `--design-producer-session`; it cannot inherit scientific approval.
|
|
1499
|
+
|
|
1500
|
+
### Fulfill predeclared scientific objects
|
|
1501
|
+
|
|
1502
|
+
At an idle boundary before analysis, register the exact code/environment files
|
|
1503
|
+
as scientific objects, then supply only the pending slots already named in the
|
|
1504
|
+
frozen design:
|
|
1505
|
+
|
|
1506
|
+
```bash
|
|
1507
|
+
tiangong-ai research schema show scientific-fulfillment --json
|
|
1508
|
+
tiangong-ai research scientific fulfillment status PROJECT --workspace /absolute/workspace --json
|
|
1509
|
+
tiangong-ai research scientific fulfillment record PROJECT \
|
|
1510
|
+
--input /absolute/fulfillment.json --workspace /absolute/workspace --json
|
|
1511
|
+
```
|
|
1512
|
+
|
|
1513
|
+
The closed input names `designSha256`, the exact `parentFulfillmentSha256`
|
|
1514
|
+
(`null` initially), a non-sensitive reason, and arrays `modelImplementations`,
|
|
1515
|
+
`environmentLocks`, and `parameterStates`. Model entries bind the registered
|
|
1516
|
+
`objectLocator`, raw `sha256`, registration `recordSha256`, and the declared
|
|
1517
|
+
`modelId`; implementations additionally supply `entrypoint`. Parameter entries
|
|
1518
|
+
name the existing `parameterId` and every exact `stateId`, its source-derived
|
|
1519
|
+
`value`, and admitted `evidenceAtomIds` from the frozen typed-content snapshot.
|
|
1520
|
+
Units, state sets, ranges, factors, composition, claims, thresholds and Policy
|
|
1521
|
+
cannot be changed through this intake. At least one pending slot is required.
|
|
1522
|
+
|
|
1523
|
+
Identical replay returns the same immutable record. Replacing an already-frozen
|
|
1524
|
+
slot, guessing a parent, an active native session, or analysis/inference already
|
|
1525
|
+
started is refused. The journal is the commit point; interrupted state projection
|
|
1526
|
+
uses the same narrow recovery mechanism as acquisition/scope revisions.
|
|
1527
|
+
|
|
1528
|
+
Only the fulfillment's due gate and later scientific gates are reset; earlier
|
|
1529
|
+
reviews remain bound to their unchanged deadline-specific design view. New review
|
|
1530
|
+
packets include the original design, the exact fulfillment chain, the effective
|
|
1531
|
+
view and registered code/environment bytes. Filing objects does **not** mark the
|
|
1532
|
+
original Policy rule scientifically satisfied or certify code execution. The
|
|
1533
|
+
existing independent reviewer must assess the actual objects and rule. Portable
|
|
1534
|
+
audits retain the raw objects and registration metadata and verify the committed
|
|
1535
|
+
fulfillment head, slot semantics and current review view after relocation.
|
|
1536
|
+
|
|
1537
|
+
### Original task, current scope, and actual checks
|
|
1538
|
+
|
|
1539
|
+
For a new research project, record a small original-requirement checklist after
|
|
1540
|
+
project initialization and before any producer execution or scientific review.
|
|
1541
|
+
The native host authors the content; the CLI owns its schema and hash bindings:
|
|
1542
|
+
|
|
1543
|
+
```bash
|
|
1544
|
+
tiangong-ai research schema show task-contract --json
|
|
1545
|
+
tiangong-ai research project task define PROJECT \
|
|
1546
|
+
--input /absolute/task.json --workspace /absolute/workspace --json
|
|
1547
|
+
tiangong-ai research project task status PROJECT --workspace /absolute/workspace --json
|
|
1548
|
+
```
|
|
1549
|
+
|
|
1550
|
+
Each requirement has a stable ID, acceptance condition, `checkKind` (`evidence`,
|
|
1551
|
+
`computation`, or `proof`), and optional bindings to existing design claims and
|
|
1552
|
+
coverage dimensions. Original wording cannot be overwritten. Old projects without
|
|
1553
|
+
a task remain explicitly unassessed rather than retrospectively accepted.
|
|
1554
|
+
|
|
1555
|
+
Optional `requestProvenance` supplies `mode` (`verbatim`, `interpreted`, or
|
|
1556
|
+
`reconstructed`), `source` (`kind: user-message|user-file`, exact `text`, `locator`
|
|
1557
|
+
or null), and `explanation`. A null source is valid only for reconstruction.
|
|
1558
|
+
Verbatim source text must equal `originalRequest` exactly, including BOM and line
|
|
1559
|
+
endings. Source bytes are immutable; locator values are retained only by hash.
|
|
1560
|
+
Missing provenance is explicitly `unrecorded`, never inferred retroactively.
|
|
1561
|
+
Scope changes and forks preserve it. Declared origin is not authenticated authorship;
|
|
1562
|
+
secrets are rejected before admission.
|
|
1563
|
+
Scientific review also stages the exact supplied request-source object, so its
|
|
1564
|
+
original bytes are available through the same packet-only read channel as its hash.
|
|
1565
|
+
|
|
1566
|
+
Before analysis, use `research schema show task-scope-change` and
|
|
1567
|
+
`project task scope propose PROJECT --input FILE --expected-contract SHA` to
|
|
1568
|
+
propose a change. Review the returned `changes.details` before/after values, then
|
|
1569
|
+
approve only with both `--proposal SHA` and `--confirm-change SHA` on
|
|
1570
|
+
`project task scope approve`. A generic continue instruction is not scope consent.
|
|
1571
|
+
The record is an **operator confirmation**, not authenticated proof of a human's
|
|
1572
|
+
identity. Scope approval does not rewrite scientific design or evidence floors;
|
|
1573
|
+
it invalidates prior scoped scientific reviews. Withdrawn original requirements
|
|
1574
|
+
remain visible and a fork/addendum retains original history without inheriting
|
|
1575
|
+
task completion.
|
|
1576
|
+
|
|
1577
|
+
Use `research schema show task-acceptance` and
|
|
1578
|
+
`project task acceptance record PROJECT --input FILE` after acquisition and
|
|
1579
|
+
between native stages. Records bind the exact requirement version, source/atom/
|
|
1580
|
+
finding IDs, and explicitly selected bounded UTF-8 result files. The declared
|
|
1581
|
+
command is stored only by hash and is **not executed by this command**. Raw result
|
|
1582
|
+
bytes are copied into immutable hash-addressed objects; secrets and control-store
|
|
1583
|
+
sources are rejected. A reported computation without an observed run remains
|
|
1584
|
+
`unverified-execution`, not an answered computational requirement. Failed,
|
|
1585
|
+
inconclusive and not-run checks remain honest without invented results. Evidence
|
|
1586
|
+
and proof checks need no fabricated computation. All records say
|
|
1587
|
+
`trust=native-observation`, `executionCertified=false`.
|
|
1588
|
+
|
|
1589
|
+
For an actual calculation, the native host authors and reviews one ordinary
|
|
1590
|
+
Node/Python program and explicitly requests observation:
|
|
1591
|
+
|
|
1592
|
+
```bash
|
|
1593
|
+
tiangong-ai research schema show task-native-run --json
|
|
1594
|
+
tiangong-ai research project task run observe PROJECT \
|
|
1595
|
+
--input /absolute/native-run.json --confirm-execution --workspace /absolute/workspace --json
|
|
1596
|
+
tiangong-ai research project task run inspect PROJECT --run RUN_ID \
|
|
1597
|
+
--workspace /absolute/workspace --json
|
|
1598
|
+
```
|
|
1599
|
+
|
|
1600
|
+
The closed request binds the computational requirement version, explicit
|
|
1601
|
+
interpreter, script, environment-lock declaration, current acquisition artifact
|
|
1602
|
+
IDs/hashes, unique output filenames, non-secret arguments and finite timeout.
|
|
1603
|
+
Use `{input:ID}` / `{output:ID}` placeholders rather than host paths in arguments,
|
|
1604
|
+
and name `nativeSessionId` when a producer stage is active. The CLI snapshots
|
|
1605
|
+
inputs and plans exact output paths before invoking the ordinary program. It
|
|
1606
|
+
adds no permission bypass or dependency installation, forwards no provider
|
|
1607
|
+
credentials and launches no reasoning agent. The workspace lease is released
|
|
1608
|
+
during computation. Program authoring and scientific decisions remain native.
|
|
1609
|
+
|
|
1610
|
+
The returned record binds runtime/code/input/output bytes, process exit/signal
|
|
1611
|
+
and time. Use `nativeRunSha256` at acceptance; those results come only from that
|
|
1612
|
+
run, not a directory scan or unrelated external files. Success requires a zero
|
|
1613
|
+
exit, stable inputs and every declared output; failure/timeout/cancellation and
|
|
1614
|
+
missing or changed outputs remain nonpassing records. Committed replay does not
|
|
1615
|
+
run again. An incomplete interrupted run requires inspection and an explicitly
|
|
1616
|
+
new run ID, not automatic retry. `stagingDirectoryName` is only a safe relative
|
|
1617
|
+
local-inspection hint; permanent hash-bound objects carry audit authority.
|
|
1618
|
+
`observation=cli-observed-native-process` is not mathematical correctness or an
|
|
1619
|
+
authenticated execution certificate. The dependency lock is explicitly
|
|
1620
|
+
`declared-lock-not-attested`; no hermetic-environment claim is inferred.
|
|
1621
|
+
|
|
1622
|
+
One unchanged result blob is stored once and appears once in the reviewer directory. The
|
|
1623
|
+
existing independent review receives the original request, original/current
|
|
1624
|
+
requirements, exact checks and results, and returns a bound `taskAssessment`;
|
|
1625
|
+
there is no additional default paid review round. Missing current checks stop
|
|
1626
|
+
before review, and stale/failed/inconclusive checks cannot be promoted to answered.
|
|
1627
|
+
Publication packets and portable audit verification retain these relationships;
|
|
1628
|
+
hash integrity does not prove execution, scientific validity, or editorial acceptance.
|
|
1629
|
+
Native and scientific packets stage observed programs, locks, inputs and outputs
|
|
1630
|
+
for exact on-demand inspection. Portable audit checks native start/completion
|
|
1631
|
+
events, requirement versions and all run objects. It also replays read selectors
|
|
1632
|
+
against the exact stored object, directory and packet/delivery records; a rehashed
|
|
1633
|
+
outer inventory cannot hide missing program bytes or a changed read receipt.
|
|
1634
|
+
|
|
1635
|
+
`project task status` and each `research run` project summary report original and
|
|
1636
|
+
current task completion separately from workflow completion and publication verdict.
|
|
1637
|
+
A completed workflow or approved reduced scope must not be described as satisfying
|
|
1638
|
+
unanswered original requirements. Use the selected runtime's help/schema discovery
|
|
1639
|
+
once before adopting these commands; they are not an implicit runtime upgrade.
|
|
1394
1640
|
|
|
1395
1641
|
## Research Search
|
|
1396
1642
|
|