scene-capability-engine 3.2.0 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,92 @@
1
+ # Dual UI Mode Integration Guide
2
+
3
+ This guide maps two UI surfaces to SCE interactive governance behavior.
4
+
5
+ ## 1. Target Surfaces
6
+
7
+ - `user-app`: end-user business operation UI.
8
+ - `ops-console`: maintenance and new-requirement management UI.
9
+
10
+ ## 2. Default Governance Mapping
11
+
12
+ - `user-app`
13
+ - Recommended dialogue profile: `business-user`
14
+ - Recommended execution mode: `suggestion`
15
+ - Apply intent is denied by authorization dialogue policy by default.
16
+ - `ops-console`
17
+ - Recommended dialogue profile: `system-maintainer`
18
+ - Execution mode: `suggestion|apply` (subject to runtime/authorization-tier/approval gates)
19
+
20
+ ## 3. Runtime Integration Pattern
21
+
22
+ Use the same backend flow and switch only mode/profile by surface:
23
+
24
+ ```bash
25
+ # user-facing application UI
26
+ sce scene interactive-flow \
27
+ --input <provider-payload.json> \
28
+ --goal "<business-goal>" \
29
+ --ui-mode user-app \
30
+ --dialogue-profile business-user \
31
+ --execution-mode suggestion \
32
+ --json
33
+
34
+ # operations / maintenance console
35
+ sce scene interactive-flow \
36
+ --input <provider-payload.json> \
37
+ --goal "<maintenance-goal>" \
38
+ --ui-mode ops-console \
39
+ --dialogue-profile system-maintainer \
40
+ --execution-mode apply \
41
+ --runtime-environment staging \
42
+ --auto-execute-low-risk \
43
+ --json
44
+ ```
45
+
46
+ ## 4. UI Rendering Contract
47
+
48
+ Read these fields from loop/flow output:
49
+
50
+ - `summary.ui_mode`
51
+ - `summary.dialogue_authorization_decision`
52
+ - `summary.authorization_tier_decision`
53
+ - `summary.execution_block_reason_category`
54
+ - `summary.execution_block_remediation_hint`
55
+
56
+ Recommended rendering:
57
+
58
+ - `dialogue_authorization_decision=deny`: block execute button and show guided fallback.
59
+ - `dialogue_authorization_decision=review-required`: show review handoff panel.
60
+ - `authorization_tier_decision=allow` and runtime/gate allow: enable guarded apply action.
61
+
62
+ ## 5. Runtime UI-Mode Contract (Default)
63
+
64
+ `runtime-mode-policy-baseline.json` now includes `ui_modes` policy:
65
+
66
+ - `user-app`
67
+ - `allow_execution_modes=["suggestion"]`
68
+ - `deny_execution_modes=["apply"]`
69
+ - Apply intents should switch to `ops-console`.
70
+ - `ops-console`
71
+ - `allow_execution_modes=["suggestion","apply"]`
72
+ - Supports maintenance/apply flows with approval and authorization-tier gates.
73
+
74
+ When evaluating runtime policy directly, pass `--ui-mode`:
75
+
76
+ ```bash
77
+ node scripts/interactive-runtime-policy-evaluate.js \
78
+ --plan .kiro/reports/interactive-change-plan.generated.json \
79
+ --ui-mode user-app \
80
+ --runtime-mode ops-fix \
81
+ --runtime-environment staging \
82
+ --json
83
+ ```
84
+
85
+ ## 6. Audit and Compliance
86
+
87
+ For both modes, persist:
88
+
89
+ - work-order (`interactive-work-order.json|.md`)
90
+ - approval events (`interactive-approval-events.jsonl`)
91
+ - execution ledger (`interactive-execution-ledger.jsonl`)
92
+ - authorization-tier signals (`interactive-authorization-tier-signals.jsonl`)
@@ -0,0 +1,78 @@
1
+ # Embedded Assistant Authorization Dialogue Rules
2
+
3
+ This guide defines mandatory conversation and authorization behavior for an embedded AI assistant using SCE interactive flow inside business systems.
4
+
5
+ ## 1. Goals
6
+
7
+ - Keep non-technical users productive in `suggestion` mode by default.
8
+ - Prevent unsafe or unauthorized system mutation.
9
+ - Ensure every mutation path is explainable, reversible, and auditable.
10
+
11
+ ## 2. Dialogue Profiles
12
+
13
+ - `business-user`:
14
+ - Default profile for end users.
15
+ - Allowed mode: `suggestion` only.
16
+ - Any apply request must be refused with guided escalation steps.
17
+ - `system-maintainer`:
18
+ - For operators/maintainers with change responsibility.
19
+ - `apply` can be evaluated, but must still pass runtime + authorization-tier + approval policy checks.
20
+
21
+ ## 3. Mandatory Conversation Flow
22
+
23
+ 1. Clarify intent and scope:
24
+ - Assistant must restate target `product/module/page/entity/scene`.
25
+ - Assistant must ask for missing business constraints before planning.
26
+
27
+ 2. Explain plan before execution:
28
+ - Assistant must show `risk_level`, verification checks, and rollback plan.
29
+ - Assistant must explicitly say whether execution is blocked, review-required, or allowed.
30
+
31
+ 3. Confirmation before mutation:
32
+ - For `apply`, assistant must ask a final explicit confirmation.
33
+ - Confirmation text must include impact summary and rollback availability.
34
+
35
+ ## 4. Step-Up Authorization Rules
36
+
37
+ - Password step-up:
38
+ - When policy requires password for apply, assistant must ask for one-time password confirmation.
39
+ - Assistant must never echo raw password in logs or summaries.
40
+ - Role-policy step-up:
41
+ - When role policy is required, assistant must ask for actor role and approver role.
42
+ - If separation-of-duties is required, roles must be distinct.
43
+ - Review-required:
44
+ - Assistant must stop execution and generate review handoff instructions.
45
+
46
+ ## 5. Deny and Fallback Behavior
47
+
48
+ - If decision is `deny`, assistant must:
49
+ - reject execution,
50
+ - explain the blocked policy reason in plain language,
51
+ - provide at least one safe alternative (`suggestion`, ticket, or scope reduction).
52
+ - If environment is rate-limited or unstable (`429`/timeouts), assistant must:
53
+ - avoid aggressive retries,
54
+ - switch to phased queue execution guidance,
55
+ - preserve pending work-order state for resume.
56
+
57
+ ## 6. Audit Requirements
58
+
59
+ Each interactive mutation attempt must leave:
60
+
61
+ - work-order artifacts (`interactive-work-order.json|.md`)
62
+ - approval event audit (`interactive-approval-events.jsonl`)
63
+ - execution ledger (`interactive-execution-ledger.jsonl`)
64
+ - authorization-tier signal (`interactive-authorization-tier-signals.jsonl`)
65
+
66
+ Assistant responses for mutation flow must include a traceable reference:
67
+ - `session_id`
68
+ - `work_order_id` (or pending ticket id)
69
+ - current decision (`allow|review-required|deny`)
70
+
71
+ ## 7. UX Copy Requirements
72
+
73
+ - Use direct and business-readable language (no internal jargon only).
74
+ - Every blocked response must end with actionable next steps.
75
+ - Every allowed apply response must include:
76
+ - what will change now,
77
+ - what will not change,
78
+ - how to rollback.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.0",
2
+ "version": "1.3.0",
3
3
  "min_intent_samples": 5,
4
4
  "adoption_rate_min_percent": 30,
5
5
  "execution_success_rate_min_percent": 90,
@@ -8,6 +8,13 @@
8
8
  "satisfaction_min_score": 4,
9
9
  "min_feedback_samples": 3,
10
10
  "min_matrix_samples": 3,
11
+ "min_dialogue_authorization_samples": 3,
12
+ "dialogue_authorization_block_rate_max_percent": 40,
13
+ "min_runtime_samples": 3,
14
+ "runtime_block_rate_max_percent": 40,
15
+ "runtime_ui_mode_violation_max_total": 0,
16
+ "min_authorization_tier_samples": 3,
17
+ "authorization_tier_block_rate_max_percent": 40,
11
18
  "matrix_portfolio_pass_rate_min_percent": 80,
12
19
  "matrix_regression_positive_rate_max_percent": 20,
13
20
  "matrix_stage_error_rate_max_percent": 20
@@ -59,6 +59,32 @@
59
59
  "require_work_order": true
60
60
  }
61
61
  },
62
+ "ui_modes": {
63
+ "user-app": {
64
+ "description": "End-user business operation surface. Apply should be routed through ops console.",
65
+ "allow_runtime_modes": [
66
+ "user-assist",
67
+ "ops-fix"
68
+ ],
69
+ "allow_execution_modes": [
70
+ "suggestion"
71
+ ],
72
+ "deny_execution_modes": [
73
+ "apply"
74
+ ]
75
+ },
76
+ "ops-console": {
77
+ "description": "Operations and maintenance console surface.",
78
+ "allow_runtime_modes": [
79
+ "ops-fix",
80
+ "feature-dev"
81
+ ],
82
+ "allow_execution_modes": [
83
+ "suggestion",
84
+ "apply"
85
+ ]
86
+ }
87
+ },
62
88
  "environments": {
63
89
  "dev": {
64
90
  "allow_live_apply": true,
@@ -135,7 +135,10 @@ Ensure:
135
135
  - `KSE_RELEASE_WEEKLY_OPS_REQUIRE_SUMMARY`: require weekly summary artifact (`true|false`, default `true`)
136
136
  - `KSE_RELEASE_WEEKLY_OPS_MAX_RISK_LEVEL`: `low|medium|high|unknown` (default `medium`)
137
137
  - `KSE_RELEASE_WEEKLY_OPS_MAX_GOVERNANCE_BREACHES`: optional max breach count
138
+ - `KSE_RELEASE_WEEKLY_OPS_MAX_AUTHORIZATION_TIER_BLOCK_RATE_PERCENT`: max authorization-tier deny/review block rate percent (default `40`)
139
+ - `KSE_RELEASE_WEEKLY_OPS_MAX_DIALOGUE_AUTHORIZATION_BLOCK_RATE_PERCENT`: max dialogue-authorization block rate percent (default `40`)
138
140
  - `KSE_RELEASE_WEEKLY_OPS_MAX_MATRIX_REGRESSION_RATE_PERCENT`: optional max regression-positive rate percent
141
+ - Invalid numeric values are reported as gate `config_warnings` and default threshold fallback is applied.
139
142
  - Optional: tune release asset integrity gate:
140
143
  - `KSE_RELEASE_ASSET_INTEGRITY_ENFORCE`: `true|false` (default `true`)
141
144
  - `KSE_RELEASE_ASSET_INTEGRITY_REQUIRE_NON_EMPTY`: `true|false` (default `true`)
@@ -15,6 +15,7 @@ This baseline is the default operating policy for SCE-driven delivery, including
15
15
  - Low-risk auto-apply is allowed only when gate result is `allow`.
16
16
  - Runtime policy gate is mandatory before apply (`runtime_mode=ops-fix`, `runtime_environment=staging` by default).
17
17
  - Runtime non-allow (`deny|review-required`) should block unattended apply (`--fail-on-runtime-non-allow`).
18
+ - Authorization-tier gate is mandatory before apply (profile+environment step-up checks).
18
19
  - Enable role-based action control when environment requires stronger separation of duties (`approval-role-policy-baseline.json` + `--actor-role`).
19
20
  - Apply-mode mutating plans require password authorization (`authorization.password_required=true` by default).
20
21
  - Password verifier hash must be supplied via `SCE_INTERACTIVE_AUTH_PASSWORD_SHA256` (or explicit override).
@@ -37,6 +38,9 @@ This baseline is the default operating policy for SCE-driven delivery, including
37
38
  - `.kiro/reports/release-evidence/governance-snapshot-<tag>.json`
38
39
  - `.kiro/reports/release-evidence/weekly-ops-summary-<tag>.json`
39
40
  - `.kiro/reports/interactive-governance-report.json`
41
+ - `.kiro/reports/interactive-dialogue-authorization-signals.jsonl`
42
+ - `.kiro/reports/interactive-runtime-signals.jsonl`
43
+ - `.kiro/reports/interactive-authorization-tier-signals.jsonl`
40
44
  - `.kiro/reports/interactive-dialogue-governance.json`
41
45
  - `.kiro/reports/interactive-execution-ledger.jsonl`
42
46
  - `.kiro/reports/interactive-approval-events.jsonl`
@@ -52,3 +56,5 @@ node scripts/release-asset-integrity-check.js
52
56
  ```
53
57
 
54
58
  If weekly ops summary risk is `high`, freeze release and run remediation before next tag.
59
+ Keep weekly ops block-rate thresholds enabled for both authorization tiers and dialogue authorization (default `40%` each).
60
+ Keep weekly ops runtime ui-mode violation threshold enabled (`RELEASE_WEEKLY_OPS_MAX_RUNTIME_UI_MODE_VIOLATION_TOTAL`, default `0`).