deepseek-harness/apps/cli/tests
Yichen Jiang 0512b12714 feat(config)!: one ordering for configuration sources, and a bootstrap deny rule
$DSH_HOME/.env had just become an ordinary environment layer, which left the
harness resolving user-facing values from a flattened process.env that could
no longer say where a value came from. A key stored through the web page
stayed shadowed by an older key in the user's own .env. An endpoint could be
redirected by the project: the invoking directory's .env is materialized like
every other layer, and a base URL decides where a resolved API key is sent, so
a DEEPSEEK_BASE_URL written into a model-editable workspace would send the
user's credential — and the prompts carrying their code — to whatever host
that file named.

Give every user-facing value one ordering, with four kinds of source:

  explicit for this run     per-operation override, CLI argument
  > authored by deployment  --config / --config-replace
  > this launch's shell     inherited process environment
  > product-managed store   settings.yaml, .credentials.yaml
  > discovered file         $DSH_HOME/.env
  > defaults                schema default, shipped base, public default

The domains differ only in which tiers exist. The earlier split — credentials
ranking the environment over the managed file while settings ranked over the
environment — was inconsistent: the distinguishing fact is who authored the
source, not the domain.

packages/util/environment owns an immutable snapshot with per-layer
provenance. getFrom(name, sources) searches only the layers a caller names,
and omitting one is a refusal rather than a demotion: the adapters ask for
['process', 'user-env'], so no reordering can let a project file back into a
decision it was excluded from.

isBootstrapOnly rejects, before anything is materialized, any .env setting a
variable that governs how a process launches (PATH, SHELL, NODE_OPTIONS,
LD_PRELOAD), where code or model-visible instructions load from (the whole
DSH_* namespace, HOME, XDG_*), or how the network is reached (proxy and CA
variables). The namespace is denied wholesale so a switch added later cannot
become settable by being forgotten, and there is no opt-out.

verify-config-source-ownership keeps both rules: no unregistered process.env
read under packages/*/*/src (26 allowlisted with reasons), and no apiKey,
baseURL, or headers inlined from the environment in shipped Cordis config —
removing those inlines is what makes the deployment tier meaningful.
2026-08-04 16:17:32 +08:00
..
fixtures Merge remote-tracking branch 'origin/master' into worktree/fix-multi-select-custom-answer 2026-08-03 16:09:17 +08:00
snapshots test(tui): refresh queued compaction help snapshot 2026-08-03 16:06:51 +08:00
tui-first-run-snapshots fix(tui): address onboarding review feedback 2026-07-31 17:47:07 +08:00
args.spec.ts feat(cli)!: complete --config on every surface and delete the personal overlay 2026-08-04 15:25:04 +08:00
built-bin.e2e.ts feat(cli)!: complete --config on every surface and delete the personal overlay 2026-08-04 15:25:04 +08:00
install-script.spec.ts Merge remote-tracking branch 'origin/master' into feature/installer-adopt-checkout 2026-08-01 19:44:12 +08:00
lazy-search-startup.compat.spec.ts Merge remote-tracking branch 'origin/master' into mergebot/pr711 2026-07-31 01:28:15 +08:00
memory-mcp-configs.spec.ts fix(examples): keep memory configs provider-owned 2026-07-31 02:34:52 -07:00
pty-harness.ts fix(tui): address onboarding review feedback 2026-07-31 17:47:07 +08:00
shipped-composition.e2e.ts test(cli): include list_agents in shipped catalog 2026-08-02 12:51:09 +08:00
source-launch.compat.spec.ts feat(cli): launch dsh source through the tsx ESM hook 2026-07-29 13:15:24 +08:00
telemetry-switch.spec.ts fix(web): review round 1 — loud opt-out, headless drain, scaffold isolation, docs 2026-07-31 01:34:42 +08:00
trusted-hosts.spec.ts fix(cli): sample LAN addresses once — trust and the printed LAN URL share the snapshot 2026-07-28 17:47:56 +08:00
tui-first-run-welcome.spec.ts fix(tui): address onboarding review feedback 2026-07-31 17:47:07 +08:00
tui-keyless-smoke.e2e.ts feat(config)!: one ordering for configuration sources, and a bootstrap deny rule 2026-08-04 16:17:32 +08:00
tui.snapshot.ts Merge remote-tracking branch 'origin/master' into fix/checkout-workdir-prompt 2026-08-01 00:04:49 +08:00
web-prompt-context.spec.ts Merge remote-tracking branch 'origin/fix/web-agent-runtime-context' into worktree/pr830-retarget-review-20260801 2026-08-02 00:56:14 +08:00