feat(cli): prepare and validate application documents offline

This commit is contained in:
Codex
2026-09-28 16:33:07 +02:00
parent 64e6b9664a
commit b9c3369e7b
20 changed files with 1164 additions and 49 deletions
+34
View File
@@ -41,6 +41,40 @@ THT_WORKSPACE_TEST_CLI=/absolute/path/dist/workspace-tools/darwin-arm64/tht \
npx vitest run test/workspace-documents-cli.test.ts
```
## Application document preparation (issue #44)
Before installation, use `tht installation prepare --directory NEW_PATH`, then
`tht installation credentials --directory PATH` to explicitly create technical
credentials in the default protected layout. The latter preserves existing files.
Edit the documents and external credentials, then repeat:
```sh
tht --installation /absolute/path/thothii-installation.yaml \
installation validate --workspaces /absolute/path/workspaces --json
```
`database-bootstrap.yaml` beside the descriptor is a schemaVersion-1 bootstrap
input, not a runtime Catalog. Its database entries use the exact Catalog API
configuration schema plus private `secretFiles` and optional `evidenceSecretFiles`
references. `--bootstrap` selects another document. The helper validates workspace
membership, uniqueness, supported transports and required credential references;
Go checks protected files, the canonical Installation Model Catalog, environment
and local administrator. No process contacts a service or creates projections.
Only missing standard release Compose assets are deferred by `config.LoadPrepared`;
normal runtime `config.Load` retains all existing checks. Custom overrides must exist.
The native integration test is opt-in because it requires the built pair:
```sh
THT_INSTALLATION_TEST_CLI=/absolute/path/dist/workspace-tools/darwin-arm64/tht \
npx vitest run test/installation-documents-cli.test.ts
```
Run it from `backend/`, following the bundle build above. It supplies prepared
fixtures and removes host tools from the subprocess PATH. Platform acceptance and
real external credentials remain separate gates. See the IT/EN guides for the
complete parameter collection procedure, default `admin` account and local-auth scope.
## Shell configuration
The schema-v2 `thothii-installation.yaml` accepts this optional section: