Skip to content

docs: document scene module trust boundary - #146

Merged
Brad-Edwards merged 1 commit into
devfrom
102-scene-module-trust
May 23, 2026
Merged

docs: document scene module trust boundary#146
Brad-Edwards merged 1 commit into
devfrom
102-scene-module-trust

Conversation

@Brad-Edwards

Copy link
Copy Markdown
Contributor

Summary

Documents the scene module trust boundary. Pulsar scene modules are trusted, repo-owned application code; lifecycle hooks execute with application privileges, runtime validation is shape-only, and there is no sandbox. The canonical position is now stated in docs/scene-trust-model.md, cross-linked from docs/asset-url-policy.md and README.md. A structural drift gate pins the documented capability surface to the live WorkbenchSceneCtx and SceneModule TypeScript interfaces so a future ctx field or lifecycle hook cannot ship undocumented. No runtime behavior or contract changes.

Requirement UIDs

  • (none — bug/refactor/maintenance run; see Traceability section below)

Related Issues

Closes #102

ADR Impact

  • ADR-021
  • ADR-029

Changes

  • Add docs/scene-trust-model.md — canonical trust-boundary policy doc. Sections: scope, trust position, what runtime validation does and does not cover, capability surface (lifecycle hooks + every WorkbenchSceneCtx field), related guardrails (PUL-Q007 source policy, asset URL policy, ADR-028 reliability boundary — each framed as narrower scope, not a sandbox), third-party/user-submitted scenes non-goal, future sandbox seam.
  • Cross-link the new doc from docs/asset-url-policy.md Related section and from README.md top-level orientation so the position is reachable from both adjacent policy reading and repo entry point.
  • Add tests/runtime/policy-scene-trust-model-doc.test.ts — structural drift gate. Parses src/runtime/scene-loader.ts for WorkbenchSceneCtx fields and src/runtime/scene.ts for SceneLifecycleFn-typed SceneModule members; asserts each appears in the trust-model doc as ctx.<field> / <hook>(ctx). Lifecycle hooks are derived from the live interface rather than a hardcoded list so a fourth hook added to SceneModule cannot ship undocumented.
  • Land the architecture preflight design note for issue Document scene module trust boundary and sandboxing non-goals #102 at docs/design/issue-102-scene-module-trust-boundary-preflight.md and register it in the design index.

Test Plan

  • make check passes (Spotless, SpotBugs, Error Prone, Checkstyle, JaCoCo)
  • make policy passes (documentation/workflow guardrails)
  • Unit tests / integration tests: N/A — docs-only change

No new runtime behavior; the new structural test (pnpm vitest run tests/runtime/policy-scene-trust-model-doc.test.ts) pins the doc to the live TypeScript types via parseSource from the shared source-policy.ts seam. Full pnpm lint && pnpm typecheck && pnpm test (2596 tests) passes locally. No src/ change, so no changelog.d/ fragment is required per .gc/plan-rules.md ("Pure-housekeeping diffs ... do not require a fragment. The line is 'did user-visible behavior change,' not 'are any non-docs paths in the diff.'").

Ground Control Checks

  • make policy passes
  • gc_evaluate_quality_gates passes or is unchanged by this repo-only change
  • gc_run_sweep reviewed; findings fixed or recorded with rationale

Traceability

Checklist

  • Code follows project coding standards (docs/CODING_STANDARDS.md)
  • No business logic in API layer
  • Domain layer has no framework imports
  • Envers @Audited on new entities if applicable
  • Changelog fragment: N/A — docs-only change
  • Architectural docs updated if stack, package structure, or key behaviors changed

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
@sonarqubecloud

Copy link
Copy Markdown

@Brad-Edwards
Brad-Edwards merged commit 9249f1a into dev May 23, 2026
9 checks passed
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