# Changelog

## 0.3.65 - 2026-09-17

- Generate the standard Account sample using the platform's canonical
  `objects/account/object.json` metadata-runtime shape (LYNC-224).
- Reject ambiguous object primary descriptors and detect case collisions at
  directory prefixes even when the conflicting paths contain different files.

## 0.3.64 - 2026-09-17

- Refresh and revalidate the authoring context when its path or signed digest
  changes before bundle plan/stage, so dry-run and real deployment use the same
  current context instead of sending stale cached stage input (LYNC-228).
- Add `--context <context-manifest.json>` to bundle lock/deploy and workforce
  stage-activation as an explicit recovery path.

## 0.3.63 - 2026-09-16

- Reject legacy `agents` projections consistently across directory, exact-path,
  full-pull and atomic-write paths. Explain the canonical `employees` recovery
  route; do not initialize or advance tracking for rejected source inventories.
- Detect legacy paths before change filtering, so historical tracking cannot
  make a full dry-run silently report clean while noncanonical files are absent.

## 0.3.62 - 2026-09-16

- Intent dispatch reports low-confidence, no-agent and permission failures as actionable domain errors.
- Video input explains the supported alternative: `workforce knowledge ingest-transcript` stores human-reviewed text with external original URI, video/transcript SHA-256 and explicit knowledge access scope (private by default). Original video is not uploaded or interpreted; original-owner permissions remain authoritative.
- `workforce knowledge chunk-get --ids` reads persisted provenance and access settings through the existing authorized API.


## 0.3.61 - 2026-09-15

- Fix doctor and workspace Core compatibility checks to compare semver ranges,
  including `0.1.x`, with explicit comparison basis (LYNC-216).
- Document knowledge access-level choices and server defaults; reject invalid
  values before file reads or network requests (LYNC-215).
- Diagnose conversation UUID, active-release and server failures with stable
  reason codes, session correlation and safe recovery commands; preserve
  governed publication and identity boundaries (LYNC-214).

## 0.3.59 - 2026-09-12

- Assign explicit ownership to CLI failures so customer-side configuration
  problems no longer read as platform faults: `createApiClient` fails fast
  with `CLI_TARGET_UNCONFIGURED` / `CLI_TOKEN_WITHOUT_BASE_URL` /
  `CLI_CREDENTIAL_NOT_FOUND` instead of silently dialing
  `http://localhost:8000`; a corrupt `~/.nexusclaw/config.json` warns once
  instead of being silently discarded; transport errors (401/403/5xx/
  timeout/network/parse) carry the endpoint, the ownership verdict and the
  next action.
- Add `nexus doctor`: one command summarizing CLI / config / credential /
  environment / workspace / connectivity / update state with structured
  findings (including credential files that no longer decrypt after a
  `.key` regeneration). Human-mode failure exits now ask for doctor output
  when reporting issues.
- Hand recovery handles to timed-out deploys: metadata deploy points at
  `nexus deployment history --changeset` (the deploy endpoint runs
  synchronously server-side; the previous "rerun with --wait" hint
  resubmitted the deployment), employee deploy points at
  `deployment employee-report-list` / `deployment employee-report`.
- Distinguish connection failures from missing OAuth endpoints during
  `org login-web`, and warn when `--instance-url` fell back to the local
  development default.
- Add a cached (24h) registry update check that warns when the installed
  CLI trails npm latest (silent under `--json`, CI and
  `NEXUS_DISABLE_UPDATE_CHECK=1`); `nexus doctor` additionally reports
  `UPDATE_AVAILABLE` and `CLI_CORE_VERSION_DRIFT` against the platform's
  published `cliCompatibilityVersion`.
- Machine results: warning/info diagnostics no longer drive the exit code;
  a command that succeeds with warnings exits 0 (missing severity stays
  fail-closed as error).


## 0.3.57 - 2026-09-08

- Preserve nested workspace-template assets during `nexus init`, including the
  executable-workforce bootstrap script, generic action/flow packages, and
  authoring context files. Generated Employee source now remains under
  `nexus-app/main/default/employees/<ApiName>/` without a scratch `bundle/`
  override.
- Reject populated `src/metadata/<kind>` and `metadata/<kind>` trees as legacy
  duplicate truth roots when a project declares the canonical source root.
  Validation remains read-only and reports `SOURCE_ROOT_DUPLICATE_TRUTH`.

## 0.3.56 - 2026-09-08

- Enforce the canonical `nexus-app/main/default` DX source layout, including
  complete Employee bundles under `employees/<ApiName>/`, shared taxonomy
  validation, canonical generators, and digest-bound legacy migration.
- Make source retrieval explicitly selective through path, metadata, directory,
  or manifest selectors; authorization remains credential-only and never
  downloads the workspace implicitly. Full retrieval requires explicit `--all`.
- Register `project migrate` in the machine-readable command policy and matrix,
  preserve canonical Page JSON/schema authoring files, and align release
  fixtures plus the Core evaluation compatibility version with `0.3.56`.

## 0.3.52 - 2026-08-28

- Wait for governed ContentDocument malware scanning to complete before using newly uploaded image/audio files in `workforce task converse`.

## 0.3.51 - 2026-08-28

- Align `workforce constitution get`, `versions`, `publish`, and `rollback`
  with the current workspace-constitution GraphQL schema (LYNC-184). Current
  values now request `version/updatedBy/updatedAt`; historical values request
  `versionNumber/changeSummary/createdAt`, removing validation failures caused
  by the retired `isActive/publishedAt/publishedBy` selection.

## 0.3.46 - 2026-08-18

- New `workforce task conversation end --session-id` command (LYNC-154/168):
  closes a persisted converse/rehearsal session server-side. The server loads
  the caller-owned turns and distills a versioned, redacted session-summary
  memory artifact through the proposal-gated controlled-memory owner
  (human-review activation, never a direct `account.aiMemory` write).
  Readback stays on `workforce observe cognition memory`. The backend also
  auto-fires the summary artifact at each 20-round threshold (40 persisted
  messages) during converse; deployments must set `MEMORY_KEY_HMAC_SECRET`
  (docker/lan.env) or every proposal fails closed with
  `MEMORY_KEY_HMAC_SECRET_UNAVAILABLE`.

## 0.3.45 - 2026-08-18

- Fix machine-mode (`--json`) commands that read the raw subcommand
  `options.json` flag pretty-printing human output and then being wrapped as
  `CLI_TERMINAL_RESULT_NOT_EMITTED` exit-1 failures (LYNC-175 round 2). The
  root program also declares `--json` (for `--build-info`), and Commander
  attributes that spelling to the root option, leaving subcommand
  `options.json` undefined even when `--json` was passed. Affected surfaces
  included `workforce feedback submit`, all `workforce approval *` verbs,
  `workforce observe *`, `workforce execution cancel`, and the employee/ai
  emit helpers. Machine mode is now resolved from the output coordinator
  (the same authority as the terminal-result guard), so every such command
  emits one `ok=true` envelope with `exitCode=0` on success.
- `workforce feedback submit` now reports the mutation boolean (`true`) as
  `data` instead of the whole GraphQL response object.

## 0.3.44 - 2026-08-18

- Guarantee a terminal JSON result in machine mode: a command that resolves
  without emitting any result now synthesizes a failed envelope
  (`CLI_TERMINAL_RESULT_NOT_EMITTED`, exit 1) instead of the indeterminate
  "exit 0 + empty stdout" state (LYNC-175). SSE transport explicitly rejects
  empty and non-SSE 2xx responses; converse failures carry `sessionId`.
- `workforce observe cognition execution` reads the curated-exemplar selected
  audit decisions (LYNC-173). CLI publications readback schema fields for
  LYNC-176.

## 0.3.40 - 2026-08-18

- Fix `CLI_TERMINAL_RESULT_COMMAND_MISMATCH` on the `employee bundle`
  gated-release commands in `--json` mode (LYNC-167). The six dashed
  subcommands (`approval-status`, `approval-request`, `activation-readiness`,
  `replacement-stage`, `replacement-status`, `revoke-action`) emitted
  underscore-spelled command ids, which the output coordinator rejected
  against the argv-derived id, wrapping successful reads as exit-2 failures.
  Machine-result command ids now mirror commander names, and the coordinator
  treats dash/underscore spellings of the same id as equivalent while still
  rejecting genuinely different commands.

## 0.3.39 - 2026-08-13

- Ship the `workforce curated-exemplar ingest|list` commands (LYNC-145 Path D
  Phase 1) so admins can curate admin-authored scenario exemplars from the
  CLI. The commands were present in source since Phase 1 but had not been
  built into a published CLI artifact nor registered in the command-policy
  registry; this release closes that delivery gap. `ingest` is a
  `knowledge.curate`-gated remote write (idempotent on scenario + content);
  `list` is read-only. Both are now covered by the command-contract gate.

## 0.3.36 - 2026-08-05

- `metadata import` now unwraps the backend REST response envelope
  (`{ data, meta }`) exactly like `validate-source`, so an invalid dry-run
  plan (for example system-app write-protected diagnostics) is rendered as a
  structured `ok:false + data.plan` result instead of crashing with
  "Cannot read properties of undefined (reading 'validation')".

## 0.3.35 - 2026-08-05

- Keep `metadata import --source <directory>` inside the explicitly selected
  directory, matching `validate-source`, while preserving manifest-wide
  collection for `--source .` workspace operations.
- Reject employee bundle remote validation before any network/upload work when
  the context is not the frozen `--surface all --caller-preview` stage input,
  and return the exact recovery command instead of failing later as a stale
  lock/context hash.

## 0.3.28 - 2026-08-03

- Keep `nexus validate --json` attributed to the invoked `validate` command
  when the compatibility command also owns deployment-validation subcommands.
- Resolve omitted package-plan Core versions from the target service's
  `NEXUS_CORE_VERSION` and fail actionably when the service publishes none.
- Align Workforce regression reads and TypeScript result types with the Core
  GraphQL contract: `suiteRunId`, `current`, nullable `baseline`, and nullable
  `deltas`.

## 0.3.27 - 2026-08-03

- Introduce the complete v2 CLI command-contract inventory for every executable
  leaf and mode, with one canonical machine-result envelope and outermost error
  boundary across legacy and current command families.
- Add registry-derived success, empty, failure, and dry-run contract coverage,
  including exit-code equality, stdout/stderr isolation, redaction, resource
  hygiene, and persistent side-effect checks.
- Make the focused CLI command-contract gate release-blocking and expose the
  complete implemented inventory through machine-readable AI help.

## 0.3.26 - 2026-08-02

- Keep `workspace health` JSON envelope and process exit semantics aligned for
  non-healthy reports in both machine-readable and human-readable modes.

## 0.3.23 - 2026-08-02

- Make top-level `install`, `pack`, and `publish` honor local or global
  `--json` consistently and emit one `nexusclaw.cli-result/v1` document.
- Add mutation-free `--dry-run` previews with canonical JSON output to
  `sandbox create`, `package promote`, and `metadata deploy`.
- Keep metadata deployment preview on validation only and prove that it never
  calls the deployment endpoint.

## 0.3.22 - 2026-08-02

- Expand machine-readable DX workflows, environment promotion, deployment
  history/report/resume, source baselines, metadata validation, and workspace
  health while preserving server-owned release and authorization boundaries.
- Add AI-workforce conversation, notification, escalation, knowledge, and
  orchestration command surfaces over the existing authenticated Core APIs.
- Harden JSON output, authentication storage, API error handling, package
  manifest validation, log output, and data query parsing for automation use.
- Bundle and validate the workspace-template release input and revision ledger
  required by the published CLI artifact.

## 0.3.21 - 2026-07-31

- Add a governed `user service-account enable` command that reuses workspace
  authorization, service-account eligibility checks, and setup audit.
- Add `workforce agent` commands for service-account identity binding,
  assistant identity, publish, archive, and version rollback.
- Keep role and organization derivation on the backend instead of accepting
  client-provided identity authority as the write source of truth.

## 0.3.20 - 2026-07-31

- Return durable `jobId` and `deploymentReportId` evidence as soon as an
  employee deployment is accepted.
- Converge `employee deploy --json` from the persisted deployment report even
  when the asynchronous job projection remains temporarily non-terminal.
- Bound terminal-state polling and include an exact report read-back command
  when the wait times out.

## 0.3.19 - 2026-07-30

- Add the machine-readable `employee skill list|describe` developer skill
  interface for governed code-action and Flow authoring.
- Register developer skill discovery in the canonical `ai help` command
  contract while preserving existing package and bundle release-gate owners.
- Include the authenticated, step-up-protected Recycle Bin soft-delete command
  prepared for the preceding local release candidate.

## 0.3.18 - 2026-07-30

- Add the authenticated, step-up-protected single-record Recycle Bin
  soft-delete command for DX administrators, with exact object, record ID, and
  external-key matching plus an auditable receipt.

## 0.3.17 - 2026-07-30

- Surface the formal rollback re-promote audit contract, including activation
  kind, reused approval/envelope, prior promotion receipt, and rollback receipt.

## 0.3.16 - 2026-07-30

- Add the read-only `employee bundle activation-readiness` command for release
  head, immutable AgentVersion/code-action materialization, transition outbox,
  and runtime-dispatch lineage inspection.

## 0.3.15 - 2026-07-30

- Normalize wrapped MFA factor-list entries returned as
  `{ factor, recoveryCodesRemaining }` before selecting verified factors for
  step-up, preventing false `STEP_UP_NO_VERIFIED_FACTOR` failures.

## 0.3.14 - 2026-07-30

- Bootstrap workforce promote/rollback step-up challenges automatically when
  the transition input omits a challenge ID, then bind the verified challenge
  to the exact retried mutation.

## 0.3.13 - 2026-07-30

- Recover an existing replacement candidate as the authoritative immutable
  stage receipt, including when an earlier transport idempotency row was left
  pending.
- Add read-only `employee bundle replacement-status` lookup by source
  candidate ID.

## 0.3.12 - 2026-07-29

- Add customer-managed `employee bundle replacement-stage`, which creates a
  fresh staged candidate from Core-owned immutable release material and returns
  an auditable machine receipt without approval, gate, promote, or activation.

## 0.3.11 - 2026-07-29

- Align `workforce test-case run` with the emitted Core GraphQL contract:
  request `[ID!]!` case IDs and select only the suite summary fields that
  actually exist.
- Fail evaluation preflight when Core does not publish the exact compatible
  CLI version, preventing the stale `0.3.10` artifact from reaching GraphQL.
- Compress large GraphQL request bodies so package deployment submission does
  not depend on an ingress buffering window.

## 0.3.10 - 2026-07-28

- Make `package validate`, `package format`, `package pack`, and
  `package publish` self-contained in the npm CLI artifact; they no longer
  locate or execute `packages/backend/scripts/package-payload.ts` from a Core
  source checkout.
- Share the pure `payload/v1` contract with backend installer validation and
  vendor its runtime implementation in the CLI tarball.

## 0.3.9 - 2026-07-28

- Supersede 0.3.8 so the immutable npm artifact records the exact Core Git
  SHA in `nexus --build-info --json`.

## 0.3.8 - 2026-07-28

- Treat fixture call-order mismatch as a candidate assertion failure while
  still completing workspace cleanup and regenerating READY capacity.
- Return dimension, ordinal, expected/actual digests, JSON Pointer and
  unconsumed-tail count in redacted candidate diagnostics.
- Separate sandbox lifecycle into six product stages and make failed sandbox
  runs emit one non-success CLI JSON document containing observability.

## 0.3.7 - 2026-07-28

- Return product-level candidate sandbox lifecycle, capacity, lease release,
  cleanup/reset, production-mutation and workspace-isolation evidence.
- Add read-only `employee candidate status` and `employee candidate diagnostics`
  commands so DX acceptance does not require Docker, `kubectl`, cluster
  credentials or Kubernetes white-box access.
- Attach the same redacted observability snapshot to remote sandbox suite
  results and preserve stable machine JSON for candidate failures.

## 0.3.6 - 2026-07-28

- Supersede 0.3.5 so published build provenance records the exact immutable
  Core commit rather than an invalid release-time SHA.

## 0.3.5 - 2026-07-28

- Group object source paths by one case-insensitive identity without silently
  overwriting aliases, and align local/backend semantic hashes for object API-name casing.
- Make source status and both pull/push dry-runs free of ledger, tracking,
  sync-state, audit, source-tree, baseline, and remote-revision writes.
- Emit the affected org/workspace/source/AI-context failures through the single
  `nexusclaw.cli-result/v1` machine envelope without stacks or mixed prose.
- Preserve still-valid historical AI-context public keys across online refresh.
- Export hydrated relation metadata instead of overwriting it with the raw relation record.
- Report required skipped workspace checks as `PARTIAL` with explicit candidate blocking.
- Surface immutable Core/CLI compatibility build identifiers in backend health and context.

## 0.3.4 - 2026-07-28

- Make `source pull --dry-run` strictly read-only, including revision-ledger initialization and legacy migration.
- Reconcile object source paths case-insensitively to prevent false delete/new pairs.
- Add single-document JSON output and structured errors to the affected source/workspace/org commands.
- Degrade workspace health when core drift checks are skipped.
- Cache authenticated AI-context public signing keys during online describe for later offline verification.
- Return actionable, stack-free local Docker runtime diagnostics.

## 0.3.2 - 2026-07-25

- Refresh vendored `@nexusclaw/shared` runtime dependency to pick up new locale keys (`assistantIdentityBanner`, `independentIdentityBanner`, `assistantIdentityEditorHint`, `assistantPermissionNotice`, `assistantAccessNotice`, `assistantAudienceNotice`) added by the agent identity-kind (独立员工 vs 助理) UI work. No CLI source changes; the CLI never reads these keys — they are a transitive artifact of vendoring the latest shared dist. CLI runtime behavior is unchanged. Rebuild produces a new content hash for the vendored bundle.

## 0.3.1 - 2026-07-24

- Fix `nexus workforce test-case results`, `nexus workforce observe executions list/detail/steps/tool-calls`, and the `dispatchAgentTask`/`testAgentRun` mutations: their GraphQL queries drifted from the backend's emitted schema and failed with `GRAPHQL_VALIDATION_FAILED` on every call. Aligned field selections and variable types with the current schema — `AgentTestResult` (`score`→`scores`, `latencyMs`→`durationMs`, `errorMessage`→`failureReason`; added `output`/`assertionResults`/`executionId` so assertion-level failure detail is readable), `AgentExecution` (dropped non-selectable `traceId`/`correlationId`/`actorType`/`actorId`/`intentSummary`/`errorMessage`; fixed `$workspaceId: ID!` and `$actorId: String`; selects real `intent`/`outputSummary`/`durationMs`/`cost`/`tokens`), `ReactStep` (`stepType`→`actionType`, `thought`→`thoughtReasoning`/`Plan`/`Confidence`, `observation`→`observationSuccess`/`Output`/`Error`), and `ToolCallRecord` (`arguments`→`input`, `result`→`output`). No behavior change; all command handlers are field-agnostic pass-throughs.

## 0.3.0 - 2026-07-24

- Add `nexus workforce *` — a full AI-workforce training/governance command plane (18 sub-groups, 111 commands) that drives the digital-employee lifecycle from the CLI without the UI: learning loops (A + B), cognition mutate, config writes (constitution / prompt / guardrail / knowledge / provider / permission), eval, ops, orchestration, and observation. Every command is a thin authenticated GraphQL client over existing backend mutations; no write path bypasses the release gate or `BehaviorLearningCaptureService`.
- Add transparent step-up (MFA) bootstrap: step-up-gated mutations (provider CUD, etc.) auto-extract the `STEP_UP_REQUIRED` challenge, complete `POST /mfa/step-up/verify`, and retry with the `x-step-up-token` header. New `nexus org step-up` command lists factors and issues a token explicitly.
- Add `getCurrentUser` GraphQL wrapper so `dispatchAgentTask` resolves the caller's own userId (backend enforces `userId === caller`).
- Register all 111 workforce commands in the machine-contract registry with four new permission profiles (`WORKFORCE_READ` / `WORKFORCE_EXECUTE` / `WORKFORCE_WRITE` / `WORKFORCE_PUBLISH`), exempt from `requiresCanDevelop` since they are a training/governance plane, not a code-authoring surface. Requires `@nexusclaw/shared` ≥ 0.1.1.

## 0.2.4 - 2026-07-22

- Keep the active `org login-web` callback listener alive when a stale browser tab, favicon, empty callback, missing state, or mismatched state reaches `localhost:1717`; all such requests remain fail-closed and cannot exchange a code or save credentials.

## 0.2.3 - 2026-07-22

- Add a bounded `--timeout-seconds` option to `org login-web` (default 300, allowed 60-1800) so slower LAN and interactive browser authorization flows do not lose their localhost callback listener.

## 0.2.2 - 2026-07-22

- Accept metadata-runtime `object.json`, `object.yaml`, and `object.yml` as valid object descriptors alongside canonical XML source.
- Report mixed XML/runtime descriptors as an explicit source-layout warning so diff/merge remains the content authority.
- Protect registry channel-entitlement REST writes with Platform Administrator and fresh step-up guards.

## 0.2.1 - 2026-07-22

- Publish the official package under the available organization scope `@nexusclawhq/cli`; the executable remains `nexus`.
- Add one auditable, fail-closed `TargetContext` resolver for remote DX workflows.
- Resolve `defaultEnvironment` descriptors automatically and keep `defaultOrg` alias-only.
- Bind workspace UUID, org credential, and instance URL to the same target; reject mismatches before network I/O.
- Add target flags and redacted target summaries to pull, diff, install, workspace pull/push, promote, rollback, and replay paths.
- Ensure pull dry-run writes no source files or page baselines and preserve push conflict safeguards.
- Ship build provenance metadata and clean-machine package safeguards.
