docs: document scene module trust boundary - #146
Merged
Conversation
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
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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 fromdocs/asset-url-policy.mdandREADME.md. A structural drift gate pins the documented capability surface to the liveWorkbenchSceneCtxandSceneModuleTypeScript interfaces so a future ctx field or lifecycle hook cannot ship undocumented. No runtime behavior or contract changes.Requirement UIDs
Related Issues
Closes #102
ADR Impact
Changes
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 + everyWorkbenchSceneCtxfield), 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.docs/asset-url-policy.mdRelated section and fromREADME.mdtop-level orientation so the position is reachable from both adjacent policy reading and repo entry point.tests/runtime/policy-scene-trust-model-doc.test.ts— structural drift gate. Parsessrc/runtime/scene-loader.tsforWorkbenchSceneCtxfields andsrc/runtime/scene.tsforSceneLifecycleFn-typedSceneModulemembers; asserts each appears in the trust-model doc asctx.<field>/<hook>(ctx). Lifecycle hooks are derived from the live interface rather than a hardcoded list so a fourth hook added toSceneModulecannot ship undocumented.docs/design/issue-102-scene-module-trust-boundary-preflight.mdand register it in the design index.Test Plan
make checkpasses (Spotless, SpotBugs, Error Prone, Checkstyle, JaCoCo)make policypasses (documentation/workflow guardrails)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 viaparseSourcefrom the sharedsource-policy.tsseam. Fullpnpm lint && pnpm typecheck && pnpm test(2596 tests) passes locally. Nosrc/change, so nochangelog.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 policypassesgc_evaluate_quality_gatespasses or is unchanged by this repo-only changegc_run_sweepreviewed; findings fixed or recorded with rationaleTraceability
Checklist
docs/CODING_STANDARDS.md)@Auditedon new entities if applicable