Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (scene-capability-engine) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
SCE - Scene Capability Engine
SCE is a scene-governed execution and governance engine for AI-native software delivery.
It turns open-ended agent work into a controlled path from goal -> scene -> spec -> task -> patch -> verify -> release.
English | 简体中文
What SCE Solves
AI agents can generate code quickly, but they also drift, over-create context, lose execution history, and hide risky decisions inside long sessions.
SCE provides the missing control layer:
Scene-governed context:scenestays the semantic boundary, while one project can host many channels/sessions in parallel and each channel keeps its own scene + spec focus.Spec-first execution: requirements, design, tasks, and gates stay attached to the work, not buried in chat history.Bounded autonomous delivery: agents can runclose-loop,close-loop-program, andclose-loop-controllerwith retry, fallback, and governance policies.Recoverable local history: timeline snapshots, task refs, and SQLite-backed state keep work recoverable even before Git push.Release-grade governance: validation gates, handoff evidence, git management checks, and errorbook-driven learning prevent silent regressions.
Core Model
SCE organizes agent work using one stable semantic/collaboration model:
project -> scene -> specproject -> channel/session -> (scene + spec focus) -> task -> eventsceneis the continuity boundarychannel/sessionis the collaboration thread, not the semantic domainspecis the governed work packagetaskis the smallest user-facing execution uniteventremains the raw audit stream behind the task view
This gives you a predictable way to manage long-running agent work without relying on fragile chat context alone.
Major Capabilities
1. Scene + Spec Governance
- Automatic goal intake and spec binding/creation during
studio plan - Scene portfolio governance for existing and new specs
- Scene/spec/task contracts stored under
.sce/ - Historical spec-scene backfill for older projects
2. Studio Execution Flow
studio plan -> generate -> apply -> verify -> release- Structured task stream for frontend or IDE integration
- Hierarchical task refs (
scene.spec.task/SS.PP.TT) for lookup, controlled rerun, and rerun hints aligned to the originalproject + channelfocus - Auth lease model for protected write operations
3. Autonomous Delivery
sce auto close-loopsce auto close-loop-batchsce auto close-loop-programsce auto close-loop-controller- Built-in retry, fallback-chain, governance replay, and anomaly-aware adaptation
4. Problem Closure and Errorbook
- Problem-domain map, chain, contract, and closure gate
- Incident staging before promotion to the long-term errorbook
- Local + registry-backed errorbook workflow
- Default rule: after repeated failed attempts, debug evidence is required
5. Local Timeline and SQLite State
- Timeline save/list/show/restore/push commands
- SQLite-backed task/event/session state
- Deterministic task references and rerun support
- File-to-SQLite migration and reconciliation tooling
6. Capability and Scene Assetization
- Scene/capability inventory and governance views
- Capability extraction, evaluation, and publication workflow
- Semantic observation, replay evaluation, local promotion, governed delta export, and native backflow rerank
- Shared-library mirror publication that advances qualified lessons from
publish_pendingtopublished-shared semantic promotenow auto-publishes qualified lessons by default under the adopt-implied model- Shared-sync handoff bundle export that packages the local semantic mirror into spec-scoped bundle/index/shards/receipt artifacts
- Shared-sync intake that lets another terminal sync governed bundle output back into its local semantic mirror
- Scene runtime and ontology-oriented execution support
- Moqui-oriented capability validation and handoff baselines
Quick Start
Install
npm install -g scene-capability-engineAdopt into a project
sce adoptStart a scene-governed workflow
sce studio plan --scene scene.demo --from-chat session-demo --goal "bootstrap first feature" --json
sce spec bootstrap --name 01-00-first-feature --scene scene.demo --non-interactive
sce spec pipeline run --spec 01-00-first-feature --scene scene.demoRun autonomous delivery
sce auto close-loop "deliver customer + order + inventory baseline"Recommended Usage Paths
Feature Delivery
sce studio plan --scene scene.customer-order --from-chat session-20260308 --goal "optimize checkout" --json
sce spec bootstrap --name 02-00-checkout-optimization --scene scene.customer-order --non-interactive
sce spec gate run --spec 02-00-checkout-optimization --scene scene.customer-order --jsonProgram-Scale Autonomous Delivery
sce auto close-loop-program "stabilize order lifecycle and release governance" --program-govern-until-stable --jsonTimeline Safety
sce timeline save --summary "before risky refactor"
sce timeline list --limit 20
sce timeline restore <snapshot-id>Protected Write Flow
sce auth grant --scope studio:* --reason "apply approved patch" --auth-password <password> --json
sce auth status --jsonDefault Governance Behavior
SCE is opinionated by default.
studio planruns intake and scene/spec governance unless policy explicitly allows bypass.studio plan,studio intake, andnative askpass through the Four Teachings supreme-intent gate first; off-track requests are clarified, rewritten, narrowed, or refused before execution, and existing bound Specs receive governed evidence.- When business scene/module/page/entity context is missing, SCE must route to clarification first; unknown business scope must not be turned into blanket disable.
CORE_PRINCIPLES.mdkeeps onlyFour Teachings + Little Ninein the supreme-principle layer; execution baselines belong inRULES_GUIDE.md, and reusable tactics belong in governance docs or lessons.- After two failed localization rounds, record/update an
errorbookincident and use bisection-style debug logs to keep halving the failing scope instead of continuing blind patch attempts. - Agent-generated scripts, reports, debug logs, test scripts, and temporary analysis default to the active Spec subdirectories; if no explicit Spec exists yet, use a governed general Spec instead of scattering files.
spec pipelineandspec gatenow carry a read-only strategy advisory for single-Spec runs, so broad or clarification-heavy work is surfaced asmulti-spec-program/research-programinstead of being blindly forced deeper into one Spec.verifyandreleaseenforce problem-closure and related gates when a spec is bound.- Autonomous program execution applies gate evaluation, fallback-chain logic, governance replay, and auto-remediation.
- Co-work baseline is enabled by default: initialized/adopted SCE projects provision
.sce/config/multi-agent.jsonwithenabled=true, while the central coordinator stays opt-in. - State persistence prefers SQLite, not ad hoc local caches.
- Oversized source files must trigger periodic refactor assessment; SCE recommends project-specific thresholds, with
2000 / 4000 / 10000as the default source-file fallback. - Release validation defaults to integration test coverage via
npm run test:releasefor faster publish feedback.
Key Integration Points
For IDEs, AI shells, or custom frontends, the most important SCE surfaces are:
sce studio plan|generate|apply|verify|releasesce studio eventssce task ref|show|rerunsce timeline save|list|show|restoresce capability inventorysce auth grant|status|revoke- SQLite state at
.sce/state/sce-state.sqlite
MagicBall-specific integration surfaces now also include:
sce device currentsce device override show|upsertsce app bundle list|show|registersce app collection list|show|applysce app install-state listsce scene delivery showsce scene workspace list|show|applysce app registry status|configure|sync*sce app runtime show|releases|install|activate|uninstallsce app engineering preview|ownership|open|import|show|attach|hydrate|scaffold|activatesce project portfolio show|candidate inspect|onboarding import|target resolve|supervision showsce mode application|ontology|engineering homesce pm requirement|tracking|planning|change|issue ... --jsonsce ontology er|br|dl ... --jsonsce ontology triad summary --jsonsce assurance resource|logs|backup|config ... --json
Demo remote registries:
magicball-app-bundle-registrymagicball-app-service-catalog- demo app key:
customer-order-demo
Scene-oriented install-management references:
- examples:
docs/examples/app-intent-phase1/.sce/app/... - apply JSON contract:
docs/app-intent-apply-contract.md
Documentation
Start here:
- Quick Start
- Quick Start with AI Tools
- Command Reference
- Autonomous Control Guide
- Scene Runtime Guide
- Multi-Agent Coordination Guide
- Errorbook Registry Guide
- Documentation Hub
Moqui and capability-focused docs:
Community
Scan the QR code and note sce to join the WeChat group.
License
MIT. See LICENSE.
Version: 3.6.67 Last Updated: 2026-03-29