@tiangong-ai/cli 0.0.35 → 0.0.36

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.
Files changed (32) hide show
  1. package/AGENTS.md +15 -5
  2. package/README.md +90 -8
  3. package/dist/research/orchestration.js +298 -28
  4. package/dist/research/orchestration.js.map +1 -1
  5. package/dist/research/workspace/audit-bundle.d.ts +44 -0
  6. package/dist/research/workspace/audit-bundle.js +357 -0
  7. package/dist/research/workspace/audit-bundle.js.map +1 -0
  8. package/dist/research/workspace/preflight.d.ts +34 -2
  9. package/dist/research/workspace/preflight.js +145 -1
  10. package/dist/research/workspace/preflight.js.map +1 -1
  11. package/dist/research/workspace/projects.d.ts +28 -4
  12. package/dist/research/workspace/projects.js +249 -12
  13. package/dist/research/workspace/projects.js.map +1 -1
  14. package/dist/research/workspace/publication-workflow.js +2 -0
  15. package/dist/research/workspace/publication-workflow.js.map +1 -1
  16. package/dist/research/workspace/runtime.js +4 -1
  17. package/dist/research/workspace/runtime.js.map +1 -1
  18. package/dist/research/workspace/sanitization.js +9 -3
  19. package/dist/research/workspace/sanitization.js.map +1 -1
  20. package/dist/research/workspace/scientific-design.d.ts +336 -0
  21. package/dist/research/workspace/scientific-design.js +1845 -0
  22. package/dist/research/workspace/scientific-design.js.map +1 -0
  23. package/dist/research/workspace/scientific-review.d.ts +101 -0
  24. package/dist/research/workspace/scientific-review.js +1167 -0
  25. package/dist/research/workspace/scientific-review.js.map +1 -0
  26. package/dist/research/workspace/setup-catalog.js +2 -2
  27. package/dist/research/workspace/setup.js +12 -3
  28. package/dist/research/workspace/setup.js.map +1 -1
  29. package/dist/research/workspace/types.d.ts +27 -0
  30. package/dist/research/workspace/workspace.js +25 -7
  31. package/dist/research/workspace/workspace.js.map +1 -1
  32. package/package.json +2 -1
package/AGENTS.md CHANGED
@@ -11,11 +11,13 @@ checkPaths:
11
11
  - AGENTS.md
12
12
  - README.md
13
13
  - package.json
14
+ - .dockerignore
15
+ - Dockerfile.clean-test
14
16
  - .github/workflows/**
15
17
  - .docpact/config.yaml
16
18
  - docs/agents/**
17
19
  - src/**
18
- lastReviewedAt: 2026-08-13
20
+ lastReviewedAt: 2026-08-15
19
21
  lastReviewedCommit: df263405bccb21cd5838d92d82dccf80ca01acb1
20
22
  ---
21
23
 
@@ -62,7 +64,7 @@ This repository owns the Tiangong AI command-line interface.
62
64
  Run before delivery:
63
65
 
64
66
  ```bash
65
- npm run test:clean
67
+ npm run test:clean:cold
66
68
  npm run lint
67
69
  npm run build
68
70
  npm test
@@ -71,9 +73,17 @@ docpact validate-config --root . --strict
71
73
  docpact lint --root . --worktree --mode enforce
72
74
  ```
73
75
 
74
- For Auto Research changes, `npm run test:clean` is the authoritative TDD gate.
75
- Write the regression first, observe it fail in that clean container, then make
76
- it pass there. Host-only results are supplemental.
76
+ For Auto Research changes, `npm run test:clean` is the iterative authoritative
77
+ TDD gate. It may reuse input-valid Docker build layers, but every invocation
78
+ runs the tests in a separately created offline container with isolated HOME and
79
+ temporary filesystems. Write the regression first, observe it fail there, then
80
+ make it pass in another fresh container. Host-only results are supplemental.
81
+
82
+ Run `npm run test:clean:cold` after changing `.dockerignore`, the clean-test
83
+ Dockerfile, a dependency manifest or lockfile, and before delivery. Hosted PR
84
+ and publish workflows use this cold mode explicitly; it adds `--no-cache` but
85
+ does not use `--pull`, because base versions change only through reviewed digest
86
+ updates.
77
87
 
78
88
  Use `npm run typecheck` for a faster TypeScript-only check.
79
89
  Use `npm run prepush:gate` when `docpact` is installed and you want the
package/README.md CHANGED
@@ -269,7 +269,7 @@ regular non-symlink `runtime-lock.json` exact stable CLI version. Setup and
269
269
  release CI reject a missing resolver or any stale exact CLI version in the
270
270
  orchestrator's `SKILL.md` or `references/*.md`.
271
271
 
272
- ### Top-journal Research Policy and final publication gate
272
+ ### Top-journal Policy, scientific design, and publication gates
273
273
 
274
274
  A `top-journal` project starts with a human-reviewed Markdown Policy, not with
275
275
  model execution. After project-scoped setup reaches `READY`, use the guided
@@ -292,22 +292,86 @@ binds the manifest and every document by SHA-256; edits, manifest tampering, or
292
292
  expiry block preflight and all later stages until the Policy is reviewed and
293
293
  approved again.
294
294
 
295
- Use the Policy project ID when admitting the research project:
295
+ Before search, the current native Codex or Claude host must author a
296
+ project-specific scientific design. The CLI owns the closed schema and rejects
297
+ designs that confuse model-to-model disagreement with observed truth, inflate
298
+ independent sample size through resampling, omit quantity/threshold semantics,
299
+ leave blocking gaps unresolved, or cannot fit the complete review lifecycle.
300
+ The CLI validates, freezes, hashes, and routes this design; it does not author
301
+ the design or launch a nested producer.
302
+
303
+ Hash binding alone does not make a model executable. Each model declares raw
304
+ implementation bytes, a retrievable safe locator and entrypoint, exact
305
+ environment-lock bytes, implementation/environment status, and a freeze gate.
306
+ Source-derived uncertainty states also declare whether their values are frozen
307
+ or pending, and every joint state maps exact parameter-state IDs. Pending model,
308
+ environment, or uncertainty objects are allowed only when a planned Policy rule
309
+ owns the same due gate. They are exposed in every earlier review packet as
310
+ `futureGateObligations` and become blocking mechanical errors at that gate.
311
+ Freezing them requires a new authoritative generation; it never upgrades the
312
+ old object in place.
313
+
314
+ Use the same Policy project ID and exact design when preflighting and admitting
315
+ the research project:
296
316
 
297
317
  ```bash
318
+ tiangong-ai research schema show scientific-design --json
298
319
  tiangong-ai research project preflight \
299
320
  --question "A specific, testable research question" \
300
321
  --goal top-journal --policy-project top-journal-paper \
301
322
  --requirements /absolute/path/to/evidence-requirements.json \
323
+ --design /absolute/path/to/scientific-design.json \
324
+ --workspace /absolute/path/to/workspace --json
325
+ tiangong-ai research project init top-journal-paper \
326
+ --question "A specific, testable research question" \
327
+ --goal top-journal \
328
+ --requirements /absolute/path/to/evidence-requirements.json \
329
+ --design /absolute/path/to/scientific-design.json \
330
+ --design-producer-agent codex \
331
+ --design-producer-session OPAQUE_NATIVE_SESSION \
332
+ --confirm-budget \
302
333
  --workspace /absolute/path/to/workspace --json
303
334
  ```
304
335
 
305
336
  The base evidence lifecycle remains
306
337
  `discover -> acquire -> analyze -> synthesize -> review -> close`, authored in
307
- the current interactive Codex or Claude Code host. After base closure, the
308
- current native host writes a final manuscript and schema-valid publication
309
- assessment. `research publication freeze` then content-addresses the Policy,
310
- evidence snapshot, base outputs, manuscript, assessment, and supplements.
338
+ the current interactive Codex or Claude Code host. A fresh independent reviewer
339
+ must first pass three hash-bound scientific gates: `research-design` before
340
+ discovery, a real-record and outcome-blind `evidence-construct` canary after
341
+ discovery and before acquisition, and `pilot-methods` after acquisition and
342
+ before analysis. Reviewer prose cannot override a mechanical failure.
343
+
344
+ ```bash
345
+ tiangong-ai research schema show scientific-assessment-research-design --json
346
+ tiangong-ai research project scientific review prepare top-journal-paper \
347
+ --role research-design \
348
+ --assessment /absolute/path/to/research-design-assessment.json \
349
+ --reviewer-agent claude \
350
+ --reviewer-session FRESH_OPAQUE_REVIEW_SESSION \
351
+ --workspace /absolute/path/to/workspace --json
352
+ tiangong-ai research schema show scientific-review-research-design --json
353
+ tiangong-ai research project scientific review submit top-journal-paper \
354
+ --role research-design --review /absolute/path/to/review.json \
355
+ --workspace /absolute/path/to/workspace --json
356
+ ```
357
+
358
+ Repeat the same prepare/submit route for `evidence-construct` and
359
+ `pilot-methods` at their stage boundaries. A top-journal fork or addendum is a
360
+ new authoritative generation and therefore requires a target-specific approved
361
+ Policy, design, and fresh native producer session; it cannot inherit scientific
362
+ approval from a superseded generation.
363
+
364
+ Review packet `stageInputs` identify promoted portable objects by purpose,
365
+ owner, source locator, and SHA-256 over raw file bytes. `packetSha256` is the
366
+ logical packet identity that excludes its own identity field; the portable
367
+ audit manifest separately records the raw stored packet-file digest. This keeps
368
+ packet identity and byte-level transfer verification explicit rather than
369
+ overloading one hash with both meanings.
370
+
371
+ After base closure, the current native host writes a final manuscript and
372
+ schema-valid publication assessment. `research publication freeze` then
373
+ content-addresses the Policy, scientific design and early reviews, evidence
374
+ snapshot, base outputs, manuscript, assessment, and supplements.
311
375
  Exactly four fresh independent sessions review that frozen generation:
312
376
  evidence, methods/reproducibility, domain/novelty, and journal-editor. A revised
313
377
  manuscript invalidates prior reviews; reviewer-session reuse is rejected from
@@ -332,6 +396,21 @@ The CLI returns a mechanically bounded ceiling:
332
396
  `target-journal-submission-ready`. Evidence and review failures can only lower
333
397
  it. None of these states predicts or guarantees editorial acceptance.
334
398
 
399
+ Before external handoff or archival, export and independently verify a portable
400
+ audit directory. It contains the selected project, portable copies of admitted
401
+ inputs, formal evidence and artifact bytes, Policy/design/review objects,
402
+ outputs, environment fingerprints, and journal proofs. Credentials, setup
403
+ sources, browser profiles, native active state, capsules, unrelated projects,
404
+ and host-specific absolute paths are excluded.
405
+
406
+ ```bash
407
+ tiangong-ai research project audit export top-journal-paper \
408
+ --output /absolute/path/to/new-audit-directory \
409
+ --workspace /absolute/path/to/workspace --json
410
+ tiangong-ai research project audit verify \
411
+ --bundle /absolute/path/to/new-audit-directory --json
412
+ ```
413
+
335
414
  `research setup status --json` reports credential persistence separately from
336
415
  readiness. It also reports the effective exact-npx CLI package/version/root,
337
416
  the selected project orchestrator, any temporary recovery shim, ignored global
@@ -527,12 +606,15 @@ repair with no research tools.
527
606
  Total, per-package, output, repair, broker-response bytes, estimated broker
528
607
  context tokens, context items, wall-time, output-count, output-size, and attempt
529
608
  limits live in `.tiangong-research/config.json`.
530
- New production workspaces use generous but finite runaway ceilings: 20,000,000
531
- total tokens and package ceilings of 12,000,000 for discovery, 2,000,000 for
609
+ New production workspaces use generous but finite runaway ceilings: 50,000,000
610
+ total tokens, USD 5,000, 30 days, and package ceilings of 12,000,000 for discovery, 2,000,000 for
532
611
  acquisition, 1,500,000 each for analysis and synthesis, and 2,500,000 for
533
612
  review. Primary output is bounded at 32,000 tokens and a separately invoked
534
613
  repair at 16,000. The production broker hard ceiling is 256 bounded views with
535
614
  32,000 context tokens per view; input context is bounded at 128,000 tokens.
615
+ Top-journal admission additionally reserves three early scientific reviews at
616
+ 500,000 tokens each, four final publication reviews at 750,000 each, and one
617
+ 4,000,000-token revision cycle, including their finite wall-time allowances.
536
618
  These values are not a target spend. Coverage-derived working plans and early
537
619
  stop control ordinary use, while the finite ceilings, three attempts per
538
620
  package, and explicit confirmation above the cost threshold stop runaway work.