Skip to content

Dev - #153

Merged
Brad-Edwards merged 8 commits into
mainfrom
dev
May 23, 2026
Merged

Dev#153
Brad-Edwards merged 8 commits into
mainfrom
dev

Conversation

@Brad-Edwards

Copy link
Copy Markdown
Contributor

No description provided.

Updated comment passages in src/main.ts, src/runtime/{audio,presenter,
prompter,scene-loader,timeline}.ts, and src/system/presenter/prompter-
window.ts that described already-landed work as future or placeholder:
the GSAP composition timeline (PUL-F022), the cue gate (PUL-F017), the
presenter command controller (PUL-F020 / PUL-F021), and the L2
createChromePrompterRenderer. Optional-API doc strings reworded from
'workbench bootstrap that has not yet wired' to factual 'callers that
don't supply X omit the field'. Source-policy comments, biome-ignore
rationales, runtime behavior, exported types, error strings, DOM
attributes, validation, and tests are unchanged.

The architecture-preflight binding note lives at
docs/design/issue-100-runtime-comment-audit-preflight.md and is
registered in docs/design/README.md.

Closes #100
…gitignore

terminal L2 template:
  - New optional content field `audio: { src, soundId, volume, rate,
    fadeOutMs }` on TerminalContent.
  - Template declares the source in scene.assets + scene.audio for the
    preloader / audio-source allowlist.
  - Session tracks an `audioFadeOut` closure that loadAndPlayCue +
    fadeAndStop wire up when the script starts; sessionTeardown fires
    it on scene exit.

vite dev/preview servers bound to 0.0.0.0:5173 / 0.0.0.0:4173 so the
workbench is reachable over local network (e.g. Tailscale) for review
on other devices.

.gitignore: cg2-*.png joins the existing scratch-screenshot allowlist
(local cold-open verification screenshots, never check in).
The terminal template's audio block was inside playScript, which
requires a real DOM (document.body, mounted <pre>) and is not
reachable from the Node-environment vitest harness. SonarCloud
flagged the resulting new-code coverage gap.

Refactor:
  - Extract the load + play + fade-out-closure shape into the new
    standalone helper startTerminalAudio(audio, config). playScript
    keeps a 3-line call site that assigns the returned closure to the
    session's audioFadeOut field.
  - Drop the TerminalSession.audioFadeOut = null initializer; the
    field is now an optional property the helper sets when the scene
    declares audio, and sessionTeardown already uses optional-chain
    invocation (s.audioFadeOut?.()).
  - Export startTerminalAudio + TerminalAudio from the templates
    barrel so consuming decks (and the test) can drive the same
    contract from outside terminal.ts.

Add tests/system/terminal-audio.test.ts (8 cases): defaults,
volume + rate overrides, fadeOut closure (with fake timers proving
the scheduled stop fires at fadeOutMs + 50), default fade duration,
undefined-audio no-op, disposed-service no-op, factory declares src
in scene.assets + scene.audio, factory leaves them empty when audio
is omitted.

Side housekeeping:
  - .gc/sonar/ added to .gitignore (workflow-tool server-side
    analytical reports; .gc/scheduled_tasks.lock already gitignored,
    parallel intent for .gc/sonar/).
feat: terminal soundtrack support and runtime comment audit
Add docs/asset-url-policy.md as the deployment-facing policy for the
asset preloader: required baseUrl, https:-only allowlist for hardened
public production, per-origin credentialed fetch binding, post-redirect
scheme re-validation, the SSRF caveat, and validation parity with the
boot pass. ADR-012 gains a Production profile cross-reference; the
preloader's existing knobs (baseUrl, allowedSchemes, fetch, init) cover
the policy with no new runtime enforcement.

The policy is composed from existing seams; structural gates already
shipped in tests/runtime/asset-preloader.test.ts and validation.test.ts
catch regressions in the runtime behavior the policy describes.
docs: define production asset URL and credential policy
Add docs/scene-trust-model.md as the canonical user-facing statement
of how Pulsar treats scene module code: trusted, repo-owned
application code; runtime validation is shape-only; there is no
sandbox. Cross-link asset URL policy and PUL-Q007 source policy as
narrower-scope guardrails, not as code sandboxes. Name the future
sandbox seam at the runtime entrypoint / capability-reduced context
boundary so a future ADR is not foreclosed.

Cross-link from docs/asset-url-policy.md (Related section) and from
README.md so the position surfaces from both adjacent policy reading
and top-level repo orientation.

Add a structural drift gate at
tests/runtime/policy-scene-trust-model-doc.test.ts that parses
src/runtime/scene-loader.ts for WorkbenchSceneCtx fields and
src/runtime/scene.ts for SceneLifecycleFn-typed SceneModule members,
then asserts each appears in the trust-model doc. The lifecycle hook
list is derived from the live interface so a fourth hook added to
SceneModule cannot ship undocumented.

The architecture preflight design note for issue #102 lands alongside
the doc.

Closes #102
docs: document scene module trust boundary
@Brad-Edwards
Brad-Edwards merged commit cf7f1b7 into main May 23, 2026
15 checks passed
@sonarqubecloud

Copy link
Copy Markdown

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