Skip to content

SP-1173: extend CUI marking to every --json command - #407

Merged
Dennis Woditsch (dwoditsch) merged 4 commits into
feat/SP-1173-cui-marking-datafrom
feat/SP-1173-cui-marking-json-commands
Aug 13, 2026
Merged

SP-1173: extend CUI marking to every --json command#407
Dennis Woditsch (dwoditsch) merged 4 commits into
feat/SP-1173-cui-marking-datafrom
feat/SP-1173-cui-marking-json-commands

Conversation

@dwoditsch

@dwoditsch Dennis Woditsch (dwoditsch) commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Description

Stacked on #405, which added the marking mechanism and the first two commands. This PR finishes the --json row: every remaining --json listing and report is now marked.

Scope: how the write is triggered

Trigger Commands CUI marking
--json listings and reports list spaces, list packages Done in #405, together with the marking mechanism
--json listings and reports list assets/assignments/data-pools, config *, t2tc package list/diff, deployment *, asset-registry * This PR
-o, --outputToJsonFile reports analyze/import action-flows, export data-pool, import data-pools, t2tc package import report To follow in #410
artifact is already an archive config package export --zip, config branch export --zip, t2tc package export, export action-flows, pull package To follow in #411
single non-archive export pull asset/skill/data-pool/view-bookmarks/bookmarks, export bookmarks To follow in #412
output is a directory config package export, config branch export, t2tc package export --unzip To follow in #413: cover sheet into the directory, prefix the directory name
--gitBranch variants config package export, config branch export, t2tc package export Out of scope, nothing reaches local disk
no output flag console-only listings, profile/git-profile/log files Out of scope

Both open questions from #405 are unaffected: how to mark an artifact that is already a zip, and what to do for directory output.

Relevant links

Checklist

  • I have self-reviewed this PR
  • I have tested the change and proved that it works in different scenarios
  • I have updated docs if needed

Note

Medium Risk
Broad, mechanical change to how JSON artifacts are written on disk; behavior shifts from raw .json files to prefixed names or zip archives when CUI applies, which could break scripts that expect a specific filename or extension.

Overview
Completes CUI marking for every CLI command that writes listings or reports via --json, building on the mechanism introduced in the base PR.

CuiFileService is wired into configuration management (nodes, branches, variables, validation, metadata, imports, staging packages, etc.), deployment, asset-registry, studio asset exports, t2tc package list/diff, and data-pool list exports. Plain fileService.writeToFileWithGivenName calls for those JSON paths are replaced with await cuiFileService.writeToFileWithGivenName, which may rename the file (unclassified prefix) or emit a CUI - … .zip containing the JSON plus a cover sheet when the team is classified.

Related helpers (writeJson, outputResponse, exportToJson, etc.) are made async and callers await them. --outputToJsonFile, zip/directory exports, and console-only output are unchanged in this PR.

Adds cui-marking-json-commands.spec.ts integration tests across representative commands and refactors list-assignments.spec.ts to use mockAxiosGet helpers.

Reviewed by Cursor Bugbot for commit 9e2a096. Bugbot is set up for automated code reviews on this repo. Configure here.

Sixteen write sites whose enclosing method is already async and awaited
to the Commander action, so this is call-site substitution only: no
signature changes. Each now logs the returned filename, since marking
renames the file to "CUI - <name>.zip".

Includes-AI-Code: true
Co-authored-by: Cursor <cursoragent@cursor.com>
Ten private write helpers were synchronous, so they could not await the
CUI cover probe. Each becomes async and every caller awaits it.

list-assignments used a blanket axios mock that shadowed the shared
cover-endpoint default and left the probe without a status; it now goes
through mockAxiosGet like the other specs.

Includes-AI-Code: true
Co-authored-by: Cursor <cursoragent@cursor.com>
Both were private static, so they could not reach an instance field to
get at the CuiFileService. Nine call sites move from the static form to
await this.writeJson(...).

Includes-AI-Code: true
Co-authored-by: Cursor <cursoragent@cursor.com>
One classified-outcome test per family, asserting the command produces
"CUI - <name>.zip" with the cover sheet inside and logs that name. The
marking logic itself stays covered by the CuiFileService unit tests.

Includes-AI-Code: true
Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud

Copy link
Copy Markdown

@dwoditsch
Dennis Woditsch (dwoditsch) merged commit 99076f5 into main Aug 13, 2026
8 checks passed
@dwoditsch
Dennis Woditsch (dwoditsch) deleted the feat/SP-1173-cui-marking-json-commands branch August 13, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants