Compare commits

..
Author SHA1 Message Date
openclaw 1fa74baeb5 diagnosis: record admin workbench visibility gap for SR-04 2026-07-11 01:44:25 +08:00
6 changed files with 142 additions and 319 deletions
@@ -1,48 +0,0 @@
cmd_id: CMD-20260710-memory-index-rebuild
operation: memory.index.rebuild
risk: medium
permission: OWNER_NON_DANGEROUS_ALL
status: pending_owner_gate
reason: Memory search is disabled because existing embedding index metadata does not match the current embedding provider configuration.
requested_by: codex-chartgpt-bridge
requested_at: "2026-07-10T08:00:00+08:00"
command_key: openclaw.memory.index.force
args:
force: true
safety:
destructive: false
arbitrary_shell: false
credential_mutation: false
provider_mutation: false
external_network_write: false
production_data_delete: false
baseline_or_tag_mutation: false
main_branch_direct_write: false
owner_gate:
required: true
approval_model: protected_branch_merge_or_signed_owner_commit
approved_by: null
approved_at: null
approval_commit: null
execution:
runner: owner-maintenance-runner
lock_key: memory-index-rebuild
timeout_seconds: 1800
executed_by: null
executed_at: null
exit_code: null
acceptance:
commands:
- openclaw memory search "V1R4C3"
- openclaw memory search "Gitea Branch Sync"
- openclaw memory search "Autonomous Controller"
expected:
- no_embedding_metadata_mismatch
- memory_search_returns_results
- memory_index_uses_current_embedding_provider
success_signals:
- AIOS_OWNER_MAINTENANCE_MEMORY_INDEX_REBUILT
- AIOS_MEMORY_SEARCH_RESTORED
rollback:
destructive: false
strategy: rebuild_previous_index_if_snapshot_exists
-49
View File
@@ -1,49 +0,0 @@
# Owner Maintenance Gate
This mechanism allows owner-approved non-dangerous maintenance actions without giving agents arbitrary host CLI access.
## Permission tiers
- READ_ONLY: status, health, baseline, versions, search inspection.
- AUTO_PATCH: branch creation, repo file changes, patch commits, test/report artifacts.
- OWNER_NON_DANGEROUS_ALL: owner may approve all non-destructive allowlisted maintenance command_keys.
- OWNER_HIGH_RISK: main merge, baseline promotion, tag creation, credential/provider mutation, destructive cleanup, production restart, SSH/firewall changes.
## Execution rule
Agents can create requests. The runner can only execute fixed allowlist mappings:
```text
command_key: openclaw.memory.index.force
argv: /usr/local/bin/openclaw memory index --force
```
The runner rejects arbitrary shell strings such as `bash -c`, `sh -c`, `curl | bash`, or recursive destructive commands.
## Owner gate
A request becomes executable only after protected-branch merge or signed owner commit fills:
```yaml
owner_gate:
approved_by: <owner>
approved_at: <timestamp>
approval_commit: <signed-owner-commit-sha>
```
## Memory index rebuild flow
1. Detect embedding metadata mismatch.
2. Create `commands/owner-requests/CMD-20260710-memory-index-rebuild.yaml`.
3. Owner approves through GitOps owner gate.
4. `runtime/owner_maintenance/allowlist_runner.py` validates safety metadata.
5. Runner executes the fixed command vector.
6. Runner records exit code and stdout/stderr hashes.
7. Acceptance checks verify memory search works again.
Expected signals:
```text
AIOS_OWNER_MAINTENANCE_MEMORY_INDEX_REBUILT
AIOS_MEMORY_SEARCH_RESTORED
```
@@ -0,0 +1,142 @@
# V1R4C4 SR-04: Admin Workbench Visibility Gap
Status: confirmed user-visible gap
Decision state: activation-ready, gated behind reliability and isolation controls
Current baseline: V1R4C3
Date: 2026-07-11
## User Report
An administrator still cannot see newly expected functions in the workbench, including:
- task progress;
- process/flow diagrams;
- new AIOS operational modules.
## Current Diagnosis
This is not currently classified as a browser cache issue or a single RBAC defect.
The active baseline remains V1R4C3. Relevant workbench/portal/UI capability branches exist but have not been merged into the deployed baseline.
Observed relevant candidate branches include:
```text
feature/v1r4c4-sr04-portal-aios-visibility-20260710
patch/user-portal-me-route-diagnostics-20260709
patch/user-portal-rbac-ops-dashboard
patch/agent-observability-webui
patch/autonomous-controller-dispatch-20260709
patch/agent-event-bus-unified
patch/agent-gpt-message-plane
```
Therefore, the administrator-visible gap is currently expected until SR-04 is merged and deployed.
## Root Cause Category
```text
backend / governance capabilities exist or are staged
↓
admin workbench integration remains outside active baseline
↓
menu/routes/API contract not deployed to production workbench
↓
admin cannot see task progress or flow diagrams
```
## Required Admin Workbench Surface
SR-04 must expose administrator-visible operational functions in the workbench.
Minimum expected surfaces:
1. Task progress view.
2. Flow/process diagram view.
3. Agent/operation status view.
4. System health view.
5. Search/governance module visibility where permitted.
6. Owner/admin approval and gate status where permitted.
## Required API/Contract Checks
Before deployment, confirm workbench routes are backed by APIs or adapters for:
```text
task progress
workflow graph / process diagram
agent activity / observability
system health
governance / owner gate state
```
Existing portal candidates indicate related routes may include:
```text
/portal/me/aios/manifest
/portal/me/aios/dashboard
/portal/me/aios/health
```
Admin workbench must not rely on backend existence alone. The frontend menu, route registration, data adapters, and RBAC visibility must all be verified.
## RBAC Requirements
Administrator users must see admin-authorized modules, but not owner-only modules unless also owner-authorized.
Required role checks:
```text
user
-> user-authorized modules only
group_admin / admin
-> task progress, operations, health, agent/flow visibility
owner
-> governance, architecture, approval, owner gate
```
## Gate Status
SR-04 remains blocked from production merge/deploy until reliability gates are complete.
Required before SR-04 deployment:
1. SR-01 Gitea reliability sentinel remains healthy.
2. SR-02 watcher cleanup is integrated and accepted.
3. User-data isolation gate is accepted or explicitly scoped so SR-04 cannot expose cross-user/task data.
4. Runtime acceptance is green.
5. Admin workbench acceptance is green.
## Admin Workbench Acceptance
After deployment, verify as an administrator:
- Workbench shows task progress.
- Workbench shows flow/process diagram entry.
- Workbench APIs return valid data.
- Admin can see admin modules.
- Admin cannot see owner-only modules unless authorized.
- Empty states are explicit, not silent disappearance.
- Missing backend data surfaces as a clear status message.
## Interim Product Conclusion
The current user-visible issue is a deployment/integration gap:
```text
SR-04 needed
but still gated
```
The correct fix is controlled SR-04 integration after reliability and isolation gates, not ad hoc frontend exposure.
## Recommended Next Step
Prepare SR-04 admin workbench integration as the next visible-feature task immediately after SR-01/SR-02/security isolation gates are accepted.
If administrator workbench visibility becomes urgent, create a narrow read-only admin workbench slice that exposes only already-authorized, non-cross-user data and still passes the user-data isolation gate.
@@ -1,9 +0,0 @@
{
"type": "branch",
"branch": "feature/v1r4c4-owner-maintenance-gate-v2-20260710",
"base": "main",
"created_by": "chatgpt-gitops-bot",
"created_at": "2026-07-10T10:32:35Z",
"direct_main_push": false,
"owner_approval_required": true
}
-80
View File
@@ -1,80 +0,0 @@
version: 1
name: owner-maintenance-gate
baseline: V1R4C3
created_at: "2026-07-10"
purpose: Owner-controlled non-dangerous maintenance permissions without arbitrary host CLI access.
principles:
- agents_may_detect_and_request
- owner_may_approve_non_dangerous_actions
- runner_executes_only_allowlisted_command_keys
- no_arbitrary_shell
- protected_branch_merge_is_default_owner_gate
- every_execution_must_be_audited
permission_tiers:
READ_ONLY:
agent_allowed: true
owner_allowed: true
requires_owner_gate: false
AUTO_PATCH:
agent_allowed: true
owner_allowed: true
requires_owner_gate: false
OWNER_NON_DANGEROUS_ALL:
description: Owner may execute all non-destructive allowlisted maintenance command_keys after owner gate approval.
agent_allowed: false
owner_allowed: true
requires_owner_gate: true
approval_model: protected_branch_merge_or_signed_owner_commit
OWNER_HIGH_RISK:
description: main merge, baseline promotion, tag creation, credential/provider mutation, destructive cleanup, production restart, SSH/firewall mutation.
agent_allowed: false
owner_allowed: true
requires_owner_gate: true
extra_review_required: true
safety_classification:
non_dangerous_requirements:
destructive: false
arbitrary_shell: false
credential_mutation: false
provider_mutation: false
external_network_write: false
production_data_delete: false
baseline_or_tag_mutation: false
main_branch_direct_write: false
command_key_must_be_allowlisted: true
always_high_risk:
- merge_to_main
- baseline_promotion
- tag_creation
- credential_rotation
- embedding_provider_change
- database_delete_or_drop
- rm_recursive_or_force
- service_restart_production
- firewall_or_ssh_config_change
- arbitrary_bash_or_shell
allowlist:
openclaw.memory.index.force:
permission: OWNER_NON_DANGEROUS_ALL
risk: medium
destructive: false
command_vector:
- /usr/local/bin/openclaw
- memory
- index
- --force
timeout_seconds: 1800
lock_key: memory-index-rebuild
acceptance:
- openclaw memory search "V1R4C3"
- openclaw memory search "Gitea Branch Sync"
- openclaw memory search "Autonomous Controller"
success_signals:
- AIOS_OWNER_MAINTENANCE_MEMORY_INDEX_REBUILT
- AIOS_MEMORY_SEARCH_RESTORED
status: proposed
@@ -1,133 +0,0 @@
#!/usr/bin/env python3
"""Owner maintenance allowlist runner.
Executes only approved command_key mappings. It never runs arbitrary shell strings.
"""
from __future__ import annotations
import argparse
import hashlib
import json
import subprocess
import sys
from dataclasses import dataclass
from datetime import datetime, timezone
from pathlib import Path
from typing import Any
try:
import yaml # type: ignore
except Exception:
yaml = None
@dataclass(frozen=True)
class AllowedCommand:
command_key: str
argv: tuple[str, ...]
permission: str
risk: str
destructive: bool
timeout_seconds: int
ALLOWED_COMMANDS: dict[str, AllowedCommand] = {
"openclaw.memory.index.force": AllowedCommand(
command_key="openclaw.memory.index.force",
argv=("/usr/local/bin/openclaw", "memory", "index", "--force"),
permission="OWNER_NON_DANGEROUS_ALL",
risk="medium",
destructive=False,
timeout_seconds=1800,
),
}
DENY_FLAGS = {
"arbitrary_shell",
"credential_mutation",
"provider_mutation",
"external_network_write",
"production_data_delete",
"baseline_or_tag_mutation",
"main_branch_direct_write",
}
def sha256_text(value: str) -> str:
return hashlib.sha256(value.encode("utf-8", errors="replace")).hexdigest()
def utc_now() -> str:
return datetime.now(timezone.utc).isoformat()
def load_request(path: Path) -> dict[str, Any]:
if yaml is None:
raise RuntimeError("PyYAML is required to load owner request YAML")
data = yaml.safe_load(path.read_text(encoding="utf-8"))
if not isinstance(data, dict):
raise ValueError("owner request must be a YAML object")
return data
def validate_request(req: dict[str, Any]) -> AllowedCommand:
command_key = req.get("command_key")
if command_key not in ALLOWED_COMMANDS:
raise PermissionError(f"command_key is not allowlisted: {command_key}")
allowed = ALLOWED_COMMANDS[command_key]
if req.get("permission") != allowed.permission:
raise PermissionError("request permission does not match allowlist")
safety = req.get("safety", {})
if not isinstance(safety, dict):
raise PermissionError("safety metadata is required")
if bool(safety.get("destructive", True)) != allowed.destructive:
raise PermissionError("destructive flag does not match allowlist")
denied = [flag for flag in DENY_FLAGS if safety.get(flag) is True]
if denied:
raise PermissionError(f"denied safety flags: {denied}")
gate = req.get("owner_gate", {})
if not isinstance(gate, dict) or gate.get("required") is not True:
raise PermissionError("owner_gate.required must be true")
if not gate.get("approved_by") or not gate.get("approved_at") or not gate.get("approval_commit"):
raise PermissionError("owner approval fields are required before execution")
return allowed
def run_allowed_command(allowed: AllowedCommand, dry_run: bool) -> dict[str, Any]:
if dry_run:
return {"dry_run": True, "argv": list(allowed.argv), "exit_code": None}
proc = subprocess.run(
list(allowed.argv),
check=False,
capture_output=True,
text=True,
timeout=allowed.timeout_seconds,
)
return {
"dry_run": False,
"argv": list(allowed.argv),
"exit_code": proc.returncode,
"executed_at": utc_now(),
"stdout_sha256": sha256_text(proc.stdout),
"stderr_sha256": sha256_text(proc.stderr),
}
def main() -> int:
parser = argparse.ArgumentParser(description="Run an owner-approved allowlisted maintenance request")
parser.add_argument("request", type=Path)
parser.add_argument("--dry-run", action="store_true")
args = parser.parse_args()
try:
req = load_request(args.request)
allowed = validate_request(req)
result = run_allowed_command(allowed, dry_run=args.dry_run)
print(json.dumps({"status": "ok", "command_key": allowed.command_key, "result": result}, indent=2))
return 0 if result.get("exit_code") in (None, 0) else int(result["exit_code"])
except Exception as exc:
print(json.dumps({"status": "error", "error": str(exc)}, indent=2), file=sys.stderr)
return 1
if __name__ == "__main__":
raise SystemExit(main())