@tiangong-ai/cli 0.0.58 → 0.0.60

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 (64) hide show
  1. package/AGENTS.md +8 -2
  2. package/CONTRIBUTING.md +79 -0
  3. package/README.md +136 -21
  4. package/dist/cli.js +5 -0
  5. package/dist/cli.js.map +1 -1
  6. package/dist/research/orchestration.js +101 -44
  7. package/dist/research/orchestration.js.map +1 -1
  8. package/dist/research/workspace/acquisition-forecast.d.ts +3 -0
  9. package/dist/research/workspace/acquisition-forecast.js +28 -3
  10. package/dist/research/workspace/acquisition-forecast.js.map +1 -1
  11. package/dist/research/workspace/acquisition-revision.d.ts +13 -0
  12. package/dist/research/workspace/acquisition-revision.js +142 -0
  13. package/dist/research/workspace/acquisition-revision.js.map +1 -0
  14. package/dist/research/workspace/acquisition.d.ts +3 -1
  15. package/dist/research/workspace/acquisition.js +67 -35
  16. package/dist/research/workspace/acquisition.js.map +1 -1
  17. package/dist/research/workspace/analysis-run.d.ts +2 -0
  18. package/dist/research/workspace/analysis-run.js +28 -0
  19. package/dist/research/workspace/analysis-run.js.map +1 -0
  20. package/dist/research/workspace/artifacts.d.ts +3 -0
  21. package/dist/research/workspace/artifacts.js +13 -0
  22. package/dist/research/workspace/artifacts.js.map +1 -1
  23. package/dist/research/workspace/audit-bundle.d.ts +5 -0
  24. package/dist/research/workspace/audit-bundle.js +17 -0
  25. package/dist/research/workspace/audit-bundle.js.map +1 -1
  26. package/dist/research/workspace/content-evidence.d.ts +3 -0
  27. package/dist/research/workspace/content-evidence.js +149 -22
  28. package/dist/research/workspace/content-evidence.js.map +1 -1
  29. package/dist/research/workspace/project-authority.d.ts +21 -0
  30. package/dist/research/workspace/project-authority.js +186 -0
  31. package/dist/research/workspace/project-authority.js.map +1 -0
  32. package/dist/research/workspace/project-mutations.d.ts +26 -0
  33. package/dist/research/workspace/project-mutations.js +330 -0
  34. package/dist/research/workspace/project-mutations.js.map +1 -0
  35. package/dist/research/workspace/projects.d.ts +2 -1
  36. package/dist/research/workspace/projects.js +132 -91
  37. package/dist/research/workspace/projects.js.map +1 -1
  38. package/dist/research/workspace/publication-workflow.d.ts +3 -0
  39. package/dist/research/workspace/publication-workflow.js +15 -3
  40. package/dist/research/workspace/publication-workflow.js.map +1 -1
  41. package/dist/research/workspace/runtime.d.ts +5 -0
  42. package/dist/research/workspace/runtime.js +83 -54
  43. package/dist/research/workspace/runtime.js.map +1 -1
  44. package/dist/research/workspace/schemas.d.ts +6 -0
  45. package/dist/research/workspace/schemas.js +13 -2
  46. package/dist/research/workspace/schemas.js.map +1 -1
  47. package/dist/research/workspace/scientific-review-execution.js +2 -0
  48. package/dist/research/workspace/scientific-review-execution.js.map +1 -1
  49. package/dist/research/workspace/scientific-review.d.ts +3 -1
  50. package/dist/research/workspace/scientific-review.js +9 -2
  51. package/dist/research/workspace/scientific-review.js.map +1 -1
  52. package/dist/research/workspace/setup-catalog.js +3 -3
  53. package/dist/research/workspace/task-acceptance.d.ts +126 -0
  54. package/dist/research/workspace/task-acceptance.js +480 -0
  55. package/dist/research/workspace/task-acceptance.js.map +1 -0
  56. package/dist/research/workspace/task-audit.d.ts +12 -0
  57. package/dist/research/workspace/task-audit.js +181 -0
  58. package/dist/research/workspace/task-audit.js.map +1 -0
  59. package/dist/research/workspace/task-contract.d.ts +139 -0
  60. package/dist/research/workspace/task-contract.js +485 -0
  61. package/dist/research/workspace/task-contract.js.map +1 -0
  62. package/dist/research/workspace/workspace.js +11 -8
  63. package/dist/research/workspace/workspace.js.map +1 -1
  64. package/package.json +2 -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-02
21
- lastReviewedCommit: 8a18ba69f432d2c639517549157ef29545722cff
20
+ lastReviewedAt: 2026-09-03
21
+ lastReviewedCommit: 06dadef170ab79c19eef9a35663e86fdee22479b
22
22
  ---
23
23
 
24
24
  # Tiangong AI CLI Contract
@@ -126,3 +126,9 @@ test, coverage, and pack checks before publishing.
126
126
  the Skills/Research data boundary.
127
127
  - Read `docs/agents/data-runtime-implementation-plan.md` before starting or
128
128
  sequencing the TypeScript 7 and atomic data migration work packages.
129
+
130
+ ## User Feedback
131
+
132
+ `CONTRIBUTING.md` implements the shared workspace reporting policy. Keep the
133
+ core form fields aligned with Skills and preserve offline help and packaged
134
+ reporting guidance. User reports do not require a root-cause diagnosis.
@@ -0,0 +1,79 @@
1
+ ---
2
+ docType: guide
3
+ scope: repo
4
+ status: current
5
+ authoritative: true
6
+ owner: cli
7
+ language: en
8
+ whenToUse: "When reporting bugs or requesting capabilities in cli."
9
+ whenToUpdate: "When reporting forms, feedback entrypoints, or the shared reporting contract change."
10
+ checkPaths:
11
+ - CONTRIBUTING.md
12
+ - .github/ISSUE_TEMPLATE/**
13
+ - README.md
14
+ lastReviewedAt: 2026-09-02
15
+ lastReviewedCommit: 4472738acc78eab396fb1f4c7f5e76af9ac703be
16
+ ---
17
+
18
+ # Contributing Feedback / 提交反馈
19
+
20
+ Chinese and English reports are welcome. Start with the
21
+ [Bug report](https://github.com/tiangong-ai/cli/issues/new?template=bug_report.yml)
22
+ or [Feature request](https://github.com/tiangong-ai/cli/issues/new?template=feature_request.yml).
23
+ These implement the shared [reporting contract v1](https://github.com/tiangong-ai/workspace/blob/main/_docs/contracts/issue-reporting-policy.md).
24
+ 本仓库与另一个项目使用同一套核心字段;可以用中文或英文填写。
25
+
26
+ ## Where To Report / 提交到哪里
27
+
28
+ - Skill instructions, prompt orchestration, references, and agent routing:
29
+ [Skills](https://github.com/tiangong-ai/skills/issues/new/choose).
30
+ - Commands, setup/install failures, runtime errors, locks, and package issues:
31
+ [CLI](https://github.com/tiangong-ai/cli/issues/new/choose).
32
+ - Uncertain or cross-component problems: use CLI and select `Unsure / 不确定`
33
+ when the component is unknown. Maintainers handle transfers or linked tasks.
34
+ 无法判断归属时提交到 CLI;不需要在两个仓库重复提交。
35
+
36
+ ## Useful Reports / 填写原则
37
+
38
+ Search existing issues first. Report one problem or capability at a time.
39
+ Describe what you wanted to do, what you expected, and what actually happened.
40
+ A root-cause diagnosis or implementation plan is optional. Unknown versions and
41
+ unreproducible failures are accepted: explain what is known and what is missing.
42
+ 先查重复,聚焦一个问题;无需先找出根因,无法复现也可提交已有证据。
43
+
44
+ For bugs, fill Summary, Goal, Component, Versions, Environment, Stage,
45
+ Reproduction, Expected result, and Actual result. Evidence is optional. Include
46
+ the actual CLI and Skill versions used by the failing run, native host/model,
47
+ OS, and installation method when known. A managed workspace's locked CLI can
48
+ differ from `tiangong-ai --version` in a global shell; use existing run records
49
+ or read-only lock inspection and label the source. Do not update the workspace
50
+ just to obtain a version. 填写出错时使用的实际版本,不要用升级后的版本替代。
51
+
52
+ For features, fill Summary, Component, Use case, Current limitation, Proposed
53
+ capability, and Success criteria; Alternatives is optional. No fault logs are
54
+ required. 功能建议说明场景、障碍、期望能力和成功示例即可。
55
+
56
+ Share only minimal sanitized logs, commands, or prompt excerpts. Remove keys,
57
+ tokens, authorization headers, private paths, private research data, and
58
+ unrelated conversation text. Do not attach an entire research directory or
59
+ environment dump. Optional audit exports require review before sharing; do not
60
+ run paid provider/model checks or repeat research solely to file an issue.
61
+ 仅提供最少量脱敏证据,不要上传密钥、整个工作区或完整私有对话。
62
+
63
+ ## Agent-Assisted Reports / 让 Agent 协助
64
+
65
+ Ask the installed Auto Research Skill to prepare an issue report. It carries a
66
+ local reporting reference and Markdown templates; a workspace source checkout
67
+ is unnecessary. Preserve the same English section labels as the form while
68
+ writing the content in either language. State `Unknown` or `Not applicable`
69
+ with a reason instead of inventing details. An agent may draft locally; it posts
70
+ or uploads only with user authorization, including authorization already given
71
+ in the session. 可以先生成草稿;实际提交遵循用户已给出的授权。
72
+
73
+ ## Maintainer Handoff / 维护者接手
74
+
75
+ Maintainers preserve the original report, verify component ownership, link
76
+ duplicates, and add development scope, TODOs, acceptance criteria, validation,
77
+ and integration requirements before starting implementation. Reporters do not
78
+ need Project access or knowledge of internal delivery rules.
79
+ 维护者负责把反馈整理为可执行任务,不把内部交付要求转嫁给反馈者。
package/README.md CHANGED
@@ -12,14 +12,24 @@ checkPaths:
12
12
  - package.json
13
13
  - bin/**
14
14
  - src/**
15
- lastReviewedAt: 2026-09-02
16
- lastReviewedCommit: 8a18ba69f432d2c639517549157ef29545722cff
15
+ lastReviewedAt: 2026-09-03
16
+ lastReviewedCommit: 06dadef170ab79c19eef9a35663e86fdee22479b
17
17
  ---
18
18
 
19
19
  # Tiangong AI CLI
20
20
 
21
21
  Package: `@tiangong-ai/cli` Executable: `tiangong-ai` Node: `>=24`
22
22
 
23
+ ## Feedback
24
+
25
+ Use the [Bug and feature forms](https://github.com/tiangong-ai/cli/issues/new/choose)
26
+ and [reporting guide](https://github.com/tiangong-ai/cli/blob/main/CONTRIBUTING.md).
27
+ Chinese and English reports are welcome; unknown versions or incomplete
28
+ reproduction are accepted with an explanation. CLI help exposes these links,
29
+ and the npm package includes `CONTRIBUTING.md`. For Skill instructions and
30
+ orchestration, use the [Skills forms](https://github.com/tiangong-ai/skills/issues/new/choose);
31
+ uncertain ownership can be reported here for maintainer triage.
32
+
23
33
  ## Run From This Repository
24
34
 
25
35
  ```bash
@@ -702,9 +712,15 @@ submission manifest must bind distinct absolute files for cover letter, title
702
712
  page, reporting checklist, data availability, code availability, and source
703
713
  data; figure/table index, extended data, and supplementary methods are optional.
704
714
  `research publication freeze` then content-addresses the Policy, scientific
705
- design and early reviews, acquisition/content/inference snapshots, reproduced
715
+ design and early reviews, acquisition/content/inference snapshots, mode-bound
706
716
  analysis, Claim-Evidence Graph, base outputs, manuscript, assessment,
707
717
  supplements, role-complete submission files, and reproducibility manifest.
718
+ Computational/mixed analysis still requires reproduced metadata with exact
719
+ implementation/environment bindings. Qualitative analysis uses
720
+ `status: not-applicable`, null command/seed and empty implementation/environment
721
+ lists; it must not invent a computation. Both paths retain the same evidence,
722
+ graph, Policy and independent-review checks. Metadata alone is not proof that
723
+ a computation was executed.
708
724
  Exactly four fresh independent sessions review that frozen generation:
709
725
  evidence, methods/reproducibility, domain/novelty, and journal-editor. A revised
710
726
  manuscript invalidates prior reviews. Every reviewer must use the configured
@@ -1006,6 +1022,14 @@ deficits; exit `0` means only potential eligibility, never successful atom
1006
1022
  registration, content freeze, independence certification, or review. Pending
1007
1023
  input materialization, decomposition, and exact atom assignments remain
1008
1024
  explicit. Re-run after material acquisition changes, not after every atom.
1025
+ `submissionGate` separately reports deterministic acquire-submit blockers;
1026
+ `potentially-ready` is not an inference/content pass. An accepted binary without
1027
+ required readable content stops before submission, while an honest incomplete
1028
+ audit may still freeze its limitations and separate inference-stop decision.
1029
+ An admitted local PDF/Office file alone is not producer-readable. Forecast uses
1030
+ the same media rules as artifact registration and reports a missing readable
1031
+ derivative unless a verified readable artifact or admitted text/context input
1032
+ is available. This classification does not reread or decode the binary again.
1009
1033
  Flat `sourceTypeRequirements` arrays mean **all-of**. A design may instead use
1010
1034
  `{"allOf":["academic-paper"],"anyOf":["government","industry"],"atLeast":{"count":2,"from":["academic-paper","government","industry"]}}`;
1011
1035
  every present group applies, and counts use distinct types. Forecast, typed
@@ -1360,27 +1384,118 @@ read-only under `outputs/revisions/synthesize/<sha256>/report.md`; review and
1360
1384
  closure are invalidated, while unchanged discovery, acquisition, content,
1361
1385
  inference, analysis, and graph objects remain bound.
1362
1386
 
1363
- Recovery fork writes are rollback-protected. If inherited output, content,
1364
- inference, or graph validation fails, the target directory is removed and
1365
- source authority is restored. A source typed-content snapshot is revalidated
1387
+ Recovery forks have one journal commit point. Before `project.forked` commits,
1388
+ their target is staging, not an authoritative project; the original source
1389
+ remains authoritative. Status, run and native/reviewer admission share that
1390
+ same verified lineage view. A source typed-content snapshot is revalidated
1366
1391
  and re-signed for the target generation instead of copying its project-bound
1367
1392
  hash. Top-journal generations may resume only through `acquire`, because the
1368
1393
  target-specific scientific design must complete fresh evidence-construct and
1369
- pilot-methods reviews before analysis. `research status --all` marks any legacy
1370
- fork directory without a `project.forked` commit marker as
1371
- `authority.state = "invalid"` rather than authoritative.
1372
-
1373
- To repair completed acquisition before analysis, use
1374
- `research project fork SOURCE --to TARGET --resume-through discover`. This
1375
- preserves the original frozen audit, inherits verified discovery/receipts and
1376
- exact acquired artifacts, and opens TARGET's acquire stage. Reuse the returned
1377
- artifact IDs from the source acquisition audit, run
1378
- `project evidence content forecast TARGET --input AUDIT`,
1379
- then prepare/submit TARGET's acquire stage and rebuild typed content. There is
1380
- no need to repeat paid searches or download unchanged files. Top-journal
1381
- recovery additionally requires a Policy approved for TARGET and `--design`,
1382
- `--design-producer-agent`, and `--design-producer-session`; new generation
1383
- reviews cannot inherit the source generation's scientific approval.
1394
+ pilot-methods reviews before analysis.
1395
+
1396
+ After process interruption, repeat the same explicit fork request. The next
1397
+ lease holder settles only hash-bound CLI-owned pending operations: before
1398
+ commit it retains the interrupted target under
1399
+ `lineage/interrupted-project-mutations/<operation-id>/target`, outside the
1400
+ project namespace; after commit it finishes source/ledger projections. Exact
1401
+ committed replay returns the existing target without recopying evidence or
1402
+ repeating provider work. A different request for that target is a conflict.
1403
+ An unchanged completed retry request is likewise acknowledged without another
1404
+ revision or attempt. A subsequent real failure can still be retried normally.
1405
+
1406
+ Unknown targets, symlink replacements, modified source state and invalid
1407
+ recovery metadata are not overwritten or deleted. Resolve the reported
1408
+ `RESEARCH_PROJECT_RECOVERY_REQUIRED` conflict or restore a trusted backup before
1409
+ retrying; do not forge control files. Read-only status ignores never-committed
1410
+ directories without project state and reports existing uncommitted derived
1411
+ states as invalid. Missing state for a committed project is still an error.
1412
+ Recovery does not truncate a corrupt journal or claim power-loss durability.
1413
+
1414
+ To repair completed acquisition before any analysis attempt, prefer an explicit
1415
+ same-project revision when question, Policy, design, and requirements are unchanged:
1416
+
1417
+ ```bash
1418
+ tiangong-ai research project evidence acquisition revise PROJECT \
1419
+ --expected-snapshot <current-acquisition-sha256> \
1420
+ --reason "Add the verified readable derivative before analysis" \
1421
+ --workspace /absolute/workspace --json
1422
+ ```
1423
+
1424
+ This reopens acquire, preserves discovery, exact artifacts/receipts, historical
1425
+ snapshot bytes, budgets already spent, and the research-design approval. It
1426
+ invalidates evidence-construct and pilot-methods approvals because their evidence
1427
+ changed. Add `--include-discovery` only when new sources must be discovered or
1428
+ admitted; that explicitly reopens discover then acquire without a new project or
1429
+ automatic provider call. Prepare the returned stage, reuse unchanged objects,
1430
+ forecast once per meaningful batch, submit the complete revised audit, and rebuild
1431
+ typed content. Exact revision replay is idempotent. Stale snapshots, active native
1432
+ sessions, unresolved handoffs, inference freezes, and later attempts are refused.
1433
+
1434
+ Changed failed/limited decomposition records can be superseded under a descendant
1435
+ acquisition snapshot; unchanged records are reused. Single and batch intake share
1436
+ this rule. Historical records remain immutable, and atoms from deselected artifacts
1437
+ cannot fill current coverage. Same-snapshot conflicting extraction still fails.
1438
+
1439
+ Actual question/Policy/design changes or post-analysis work require the existing
1440
+ fork/addendum flow. Pre-feature snapshots without immutable evidence records cannot
1441
+ be repaired in place; use `research project fork SOURCE --to TARGET
1442
+ --resume-through discover` to reuse discovery/receipts/artifacts, or explicitly
1443
+ start a new generation. There is no automatic migration. A top-journal successor
1444
+ requires a Policy approved for TARGET and `--design`, `--design-producer-agent`,
1445
+ and `--design-producer-session`; it cannot inherit scientific approval.
1446
+
1447
+ ### Original task, current scope, and actual checks
1448
+
1449
+ For a new research project, record a small original-requirement checklist after
1450
+ project initialization and before any producer execution or scientific review.
1451
+ The native host authors the content; the CLI owns its schema and hash bindings:
1452
+
1453
+ ```bash
1454
+ tiangong-ai research schema show task-contract --json
1455
+ tiangong-ai research project task define PROJECT \
1456
+ --input /absolute/task.json --workspace /absolute/workspace --json
1457
+ tiangong-ai research project task status PROJECT --workspace /absolute/workspace --json
1458
+ ```
1459
+
1460
+ Each requirement has a stable ID, acceptance condition, `checkKind` (`evidence`,
1461
+ `computation`, or `proof`), and optional bindings to existing design claims and
1462
+ coverage dimensions. Original wording cannot be overwritten. Old projects without
1463
+ a task remain explicitly unassessed rather than retrospectively accepted.
1464
+
1465
+ Before analysis, use `research schema show task-scope-change` and
1466
+ `project task scope propose PROJECT --input FILE --expected-contract SHA` to
1467
+ propose a change. Review the returned `changes.details` before/after values, then
1468
+ approve only with both `--proposal SHA` and `--confirm-change SHA` on
1469
+ `project task scope approve`. A generic continue instruction is not scope consent.
1470
+ The record is an **operator confirmation**, not authenticated proof of a human's
1471
+ identity. Scope approval does not rewrite scientific design or evidence floors;
1472
+ it invalidates prior scoped scientific reviews. Withdrawn original requirements
1473
+ remain visible and a fork/addendum retains original history without inheriting
1474
+ task completion.
1475
+
1476
+ Use `research schema show task-acceptance` and
1477
+ `project task acceptance record PROJECT --input FILE` after acquisition and
1478
+ between native stages. Records bind the exact requirement version, source/atom/
1479
+ finding IDs, and explicitly selected bounded UTF-8 result files. The declared
1480
+ command is stored only by hash and is **not executed by this command**. Raw result
1481
+ bytes are copied into immutable hash-addressed objects; secrets and control-store
1482
+ sources are rejected. Positive/negative computational outcomes need a command and
1483
+ results; failed, inconclusive, and not-run checks remain honest without invented
1484
+ results. All records say `trust=native-observation`, `executionCertified=false`.
1485
+
1486
+ One unchanged result blob is stored and included once per reviewer context. The
1487
+ existing independent review receives the original request, original/current
1488
+ requirements, exact checks and results, and returns a bound `taskAssessment`;
1489
+ there is no additional default paid review round. Missing current checks stop
1490
+ before review, and stale/failed/inconclusive checks cannot be promoted to answered.
1491
+ Publication packets and portable audit verification retain these relationships;
1492
+ hash integrity does not prove execution, scientific validity, or editorial acceptance.
1493
+
1494
+ `project task status` and each `research run` project summary report original and
1495
+ current task completion separately from workflow completion and publication verdict.
1496
+ A completed workflow or approved reduced scope must not be described as satisfying
1497
+ unanswered original requirements. Use the selected runtime's help/schema discovery
1498
+ once before adopting these commands; they are not an implicit runtime upgrade.
1384
1499
 
1385
1500
  ## Research Search
1386
1501
 
package/dist/cli.js CHANGED
@@ -2733,6 +2733,11 @@ Run "tiangong-ai kb --help" for KB options.
2733
2733
  Run "tiangong-ai data --help" for atomic data options.
2734
2734
  Run "tiangong-ai research --help" for research options.
2735
2735
  Run "tiangong-ai education --help" for education options.
2736
+
2737
+ Report a problem or suggest a capability:
2738
+ https://github.com/tiangong-ai/cli/issues/new/choose
2739
+ Reporting guide:
2740
+ https://github.com/tiangong-ai/cli/blob/main/CONTRIBUTING.md
2736
2741
  `;
2737
2742
  }
2738
2743
  function kbHelp() {