Skip to content

Wraps a nested secret question in the editor - #261

Merged
johnnyt merged 1 commit into
mainfrom
se-3sjb-nested-secret-draft
Nov 19, 2026
Merged

johnnyt merged 1 commit into
mainfrom
se-3sjb-nested-secret-draft

Conversation

@johnnyt

@johnnyt johnnyt commented Nov 19, 2026

Copy link
Copy Markdown
Member

What

The screen editor page held a secret question's typed text wrapped in
StatifierExamplesWeb.SecretResponse only when the question was one of the
view's top-level nodes: typed/2 built its type map from the top-level nodes
alone. A secret question inside a container would have sat in the page's
draft as plain text, where a crash report could print it. No screen riddler
presents today keeps a container (a variant resolves to the candidate that
wins), so the gap was latent.

typed/2 now finds secret questions with Journey.secret_keys/1, the walk
Journey.resolve/2 already uses to keep them out of the view's responses. It
recurses into a container's nodes at any depth. The function was private;
it is now public with a doc, so both readers share one walk.

Test

A new test in ScreenEditorLiveTest ("a PIN typed on the page inside a
container is held wrapped and is in no line of the crash report") tries the
PIN screen, moves its secret question inside a variant in the page's own
state, types a test-only sentinel, and asserts:

  • the draft holds the response as a SecretResponse;
  • the inspected page state does not contain the sentinel;
  • the crash report of a press whose sealer raises does not contain it.

Sabotage: typed/2 reverted to the type lookup over the top-level nodes
alone. The new test failed on its SecretResponse assertion. The file was
then restored from a copy, byte-equal.

Provenance

  • Shared the walk by making Journey.secret_keys/1 public rather than
    extracting a helper module: it is the smaller change, and the app never
    ships as a package.
  • The test puts the container into the page's state with
    :sys.replace_state/2. The page's only source of view nodes is a resolved
    screen, and none of those keeps a container today.

Gate

mix quality green on this head: format, compile with warnings as errors,
credo, dialyzer, dependencies, and the full suite (916 of 916, 87.7 percent
coverage).

The screen editor page typed each posted response by a type map built
from the top-level nodes alone, so a secret question inside a container
would sit in the page's draft as plain text and a crash report could
print it. typed/2 now finds secret questions by Journey.secret_keys/1,
made public for it, which walks a container's nodes at any depth.

A test moves the tried PIN screen's secret question inside a variant in
the page's state, types a sentinel, and asserts the draft holds it as a
SecretResponse and neither the inspected state nor the crash report of
a failed press carries it.

Refs: se-3sjb
@johnnyt
johnnyt merged commit 0831aa3 into main Nov 19, 2026
4 checks passed
@johnnyt
johnnyt deleted the se-3sjb-nested-secret-draft branch November 19, 2026 22:08
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