Skip to content

SP-1173: reuse the CUI cover answer within a shell session - #415

Closed
Dennis Woditsch (dwoditsch) wants to merge 2 commits into
feat/SP-1173-cui-cover-response-semanticsfrom
feat/SP-1173-cui-marking-session-cache
Closed

SP-1173: reuse the CUI cover answer within a shell session#415
Dennis Woditsch (dwoditsch) wants to merge 2 commits into
feat/SP-1173-cui-cover-response-semanticsfrom
feat/SP-1173-cui-marking-session-cache

Conversation

@dwoditsch

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

Copy link
Copy Markdown
Contributor

Description

Stacked on #414.

Every file the CLI writes gets checked against the CUI cover endpoint, and until now that check ran once per file. A command writing several files asked several times, and each new command asked again. The first successful answer is now reused, both by the rest of that command and by later commands in the same shell session.

What changes for users:

  • Repeated exports stop re-asking. The endpoint is contacted once per shell session instead of once per file.
  • A single command can no longer produce a mixed result. Either everything it writes is marked, or nothing is.
  • Previously a command could write its first file, then fail the check for the second and error out, leaving half an export behind. That can no longer happen.
Aspect Behaviour
Lifetime Until the shell session ends or the machine restarts. No time limit within a session.
Scope Per profile and team, so switching either asks again.
Failures Never reused. The command errors and writes nothing, and the next one asks again.
Damaged entry Discarded and refetched. It is never read as "not classified".

The answer is kept in a file in the system temp directory that only the current user can read. CONTENT_CLI_CUI_CACHE_DIR points it elsewhere, which is useful for giving a CI job its own.

One consequence worth knowing: because an answer lasts for the session, turning the team's CUI setting on or off reaches an open terminal only once that answer is dropped. A new terminal, or deleting the file, picks it up straight away.

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

The cover call ran once per written artifact, so a command producing
several files asked several times and could write the first one before a
later call failed, leaving half an export behind. The decision is now
memoized on the per-run context and shared by every write. Failures are
not memoized: the command still aborts without output, and the next
attempt asks again.

Includes-AI-Code: true
Co-authored-by: Cursor <cursoragent@cursor.com>
Each command still asked the endpoint once, which is a call per command
for anyone exporting repeatedly. The first successful answer is now kept
in a temp-dir file keyed by profile, team and parent shell, so later
commands in the same session reuse it and a reboot or a new terminal
starts over.

Every cache problem degrades to fetching again rather than to a wrong
outcome: failures are never stored, and an entry that cannot be parsed
or is missing its cover is discarded.

Includes-AI-Code: true
Co-authored-by: Cursor <cursoragent@cursor.com>
@dwoditsch Dennis Woditsch (dwoditsch) changed the title SP-1173: check the CUI cover once per command run SP-1173: reuse the CUI cover answer within a shell session Aug 13, 2026
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
83.2% Coverage on New Code (required ≥ 85%)

See analysis details on SonarQube Cloud

@dwoditsch
Dennis Woditsch (dwoditsch) deleted the feat/SP-1173-cui-marking-session-cache branch August 13, 2026 08:39
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.

1 participant