Skip to content

macOS engine and secret wrapper: "nothing was entered" must rest on the engine's positive record that nothing was posted, not on a missing startedAt #602

Done

Description

@SSFSKIM

Problem

When a concealed request (a {{secret:KEY}} substituted by trusted code) fails, cua's secret wrapper tells the model either "nothing was entered" or "it may have been entered". The "nothing" answer currently rests on absent evidence: src/services/sky.mjs:244–245 treats error.meta.startedAt === null as proof that no key or paste was posted, for every error name:

const unentered = error?.name === 'SkyComputerUseError' && Boolean(error.meta) && error.meta.startedAt === null;

Two branches rely on it:

  • inputFailedUnentered (src/services/secret-input.mjs:103), which says NOTHING_ENTERED for an ordinary error;
  • userIntervened's branch without an account (sky.mjs:251, unentered passed through).

startedAt is NSNull until the engine's first posting (native/engine/Sources/Engine/Input.swift ~L221). But a null value is the absence of a record, not a record that nothing was posted. An error raised on a path that never set the input meta, or raised before the meta was attached, or coming from an older engine, reads the same. This errs in the unsafe direction: the model is told a secret went nowhere when it may have gone in, and may then type it again or skip warning the person. Ruling 1260 set the rule: "nothing entered" comes only from the engine positively recording that no key or paste was posted. Missing, unparsed or older accounts stay "may have been entered".

A related over-cautious case was found in the review of #601's merge into feat (ruling 1258's review, P2; ruling 1262):

  • An intervention caught by keyText's guard before its first key (Input.swift ~L487–488, checkIntervention() before the first post at ~L491) throws userChanged(app, phase: .inFlight).
  • That is the same phase as a stop between keys. The only phases are beforeAction and inFlight (Intervention.swift ~L117–118). The wire account is exactly {phase, effects} (Intervention.swift ~L177), and readInterruption (src/services/engine/interruption.mjs ~L21–26) keeps only those two fields.
  • So the wrapper can't tell "stopped before any key" from "stopped part-way". Under 1260 it answers "may have been entered", and for a password field it adds "ask the person to check where it went and clear it if it shows" for a field cua never typed into.
  • This is safe, but untrue.

Both need the same thing: a positive engine record of "nothing was posted".

Wanted

  1. Engine, the positive record. On every path that throws before its first key or ⌘V, the engine records that nothing was posted. Suggested (M5's design): Interruption gains beforeInput, sent as "beforeInput": true only when set. keyText tracks whether a key has posted. A checkIntervention() throw while nothing has posted is rethrown with beforeInput = true, and the paste route does the same before its first ⌘V. Ordinary (non-intervention) errors get an equivalent positive field on the input meta (for example posted: 0, or beforeInput: true), set only where the engine knows it has posted nothing. A new phase value is an alternative, but it would touch every phase === 'inFlight' check. Older engines omit the field.
  2. Wrapper, keyed on it.
    • "Nothing was entered" (with getAXState advice allowed) only when the engine's positive record says nothing was posted, and the account names no input or value effect.
    • sky.mjs:244–245's startedAt === null inference is demoted: alone it means "may have been entered", for every error.
    • inputFailedUnentered and the account-less userIntervened branch move to the positive record.
    • readInterruption keeps the new field.
  3. Unchanged:

Tests

  • Swift: the flag is set on the keyed and paste throw paths before the first post, and absent after a post.
  • Node:
    • a pre-key stop with the record answers "nothing entered";
    • an account without the record, startedAt: null alone, an unparsed meta, or an older engine's reply each answer "may have been entered", with no advice to observe;
    • an explicit input or value effect answers "entered".
  • The 1247(d) every-branch sweep in services-sky gains the new cases.

Scope and process

One PR from main, after #601 (#587/#590) lands. Reviewed by reviewer-high, since it is the secret path. Then merged into feat/117-m5 before the flip's full sitting, if that hasn't run yet.

Board

Bug, P2. Blocks #506. Parent #117. Relates to #587, #212 and #601.

Sminos-Session: cursor235#b93055dd (cua on macbook)

Activity

  1. added
    bug
    status:ready-for-implementer
    priority:P2
    on Nov 28, 2026
  2. added
    status:in-progress
    and removed
    status:ready-for-implementer
    on Nov 28, 2026
  3. SSFSKIM commented on Nov 28, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-progress: cursor235 taking under ruling 1263; branched from #601 head, main merged in after #601 lands

  4. added
    status:in-review
    and removed
    status:in-progress
    on Nov 28, 2026
  5. SSFSKIM commented on Nov 28, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-review: PR #607 (draft, stacked on #601); review converged round 2

  6. removed
    status:in-review
    on Nov 28, 2026
  7. SSFSKIM commented on Nov 28, 2026

    @SSFSKIM
    OwnerAuthor

    [board] done: Landed via PR #607 (cua 0.30.4, engine 0.2.3)

  8. SSFSKIM commented on Nov 28, 2026

    @SSFSKIM
    OwnerAuthor

    [board] done: merged in #607

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions