Implement CapabilityLedger contract and UI/runtime capability reconciliation#14
Implement CapabilityLedger contract and UI/runtime capability reconciliation#14Copilot wants to merge 2 commits into
Conversation
…econciliation Agent-Logs-Url: https://github.com/SourceOS-Linux/sourceos-shell/sessions/f703d200-8817-413c-b130-b1ad2c8ef456 Co-authored-by: mdheller <21163552+mdheller@users.noreply.github.com>
Review: strong local ledger package, but upstream contract alignment is requiredThis PR is directionally strong: it adds a reusable ledger package, tests, UI/demo surfacing, and feature-gate behavior. The implementation maps well to the intent of the Blocking remediation before this should be marked ready/merged:
Recommendation: keep the local package and UI, then add a |
Clean replay of #14 onto current main after #17 landed local Workspace Operations shell contracts. Adds the capability-ledger package, ledger schema, runtime implementation, node:test coverage, PDF viewer demo capability reconciliation surface, and lockfile update. Connector-visible workflow/status data was absent for PR head 6b29600. The replay is mergeable and scoped to package/demo/test/lockfile files; package test command is node --test tests/ledger.test.js.
|
Closing after capture/replay. Replacement PR #19 landed the intended CapabilityLedger payload on current Merged replacement commit: Content carried forward:
Content intentionally omitted: none. The original branch had no connector-visible workflow/status data, so the payload was replayed onto current main and merged with the validation limitation recorded in #19. |
Adds
CapabilityLedgeras the single source of truth for all capability state across config, UI, runtime, server, plugin, policy, schema, and transport planes — preventing split-brain where a feature is locally claimed enabled but rejected elsewhere.packages/capability-ledger/(new)src/schema.js—CAPABILITY_STATES,CAPABILITY_OWNERS,receiptSchema(JSON Schema draft-07), andreceiptExamplealigned with sourceos-spec#99src/index.js—CapabilityLedgerclass; every state change emits a receipt withcapabilityId,state,owner,timestamp,policyDecisionRef,evidenceRefs,conflictWarningsdeclare → request → negotiate → setAvailable → enable, plusdeny,degrade,setUnsupportedByRuntime/Server,setMissingPlugin/Schema,faillogConflict(id, warning)— appends conflict warnings without mutating statereconcile()— returns{ enabled, pending, conflicted }; intended for runtime startup, feature toggle, and plugin load/unload hooksisEnabled(id)— gates feature use; returnstrueonly when ledger state is"enabled"tests/ledger.test.js— 30 tests vianode:testcovering: enabling, policy denial, unsupported by runtime/server, missing plugin, missing schema, failed reconciliation, conflict accumulation, full lifecycle, and invalid input guardsapps/pdf-viewer-demo/index.html(updated)policyDecisionRef,evidenceRefs, conflict warnings per capabilityenabled), "Sign PDF" disabled (missing_plugin) — demonstrates ledger-gated feature accessWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
accounts.google.com/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=4628 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.9PvjX6 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,3011833886412195176,1120731902717605222,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,872324044727882308,824040626593909651,4 --trace-process-track-uuid=3190708989122997041(dns block)/usr/bin/chromium-browser chromium-browser --headless --disable-gpu --screenshot=/tmp/capability-ledger-ui.png --window-size=900,700 --no-sandbox file:///home/REDACTED/work/sourceos-shell/sourceos-shell/apps/pdf-viewer-demo/index.html(dns block)clients2.google.com/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=4628 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.9PvjX6 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,3011833886412195176,1120731902717605222,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,872324044727882308,824040626593909651,4 --trace-process-track-uuid=3190708989122997041(dns block)/usr/bin/chromium-browser chromium-browser --headless --disable-gpu --screenshot=/tmp/capability-ledger-ui.png --window-size=900,700 --no-sandbox file:///home/REDACTED/work/sourceos-shell/sourceos-shell/apps/pdf-viewer-demo/index.html(dns block)/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=4758 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.XGlGX2 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,6724706879400872977,18314031558142100396,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,11921452979086232962,14162284320797668367,4 --trace-process-track-uuid=3190708989122997041(dns block)redirector.gvt1.com/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=4628 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.9PvjX6 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,3011833886412195176,1120731902717605222,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,872324044727882308,824040626593909651,4 --trace-process-track-uuid=3190708989122997041(dns block)/usr/bin/chromium-browser chromium-browser --headless --disable-gpu --screenshot=/tmp/capability-ledger-ui.png --window-size=900,700 --no-sandbox file:///home/REDACTED/work/sourceos-shell/sourceos-shell/apps/pdf-viewer-demo/index.html(dns block)/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=4758 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.XGlGX2 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,6724706879400872977,18314031558142100396,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,11921452979086232962,14162284320797668367,4 --trace-process-track-uuid=3190708989122997041(dns block)www.google.com/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=4628 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.9PvjX6 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,3011833886412195176,1120731902717605222,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,872324044727882308,824040626593909651,4 --trace-process-track-uuid=3190708989122997041(dns block)/usr/bin/chromium-browser chromium-browser --headless --disable-gpu --screenshot=/tmp/capability-ledger-ui.png --window-size=900,700 --no-sandbox file:///home/REDACTED/work/sourceos-shell/sourceos-shell/apps/pdf-viewer-demo/index.html(dns block)/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=network --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=4758 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/org.chromium.Chromium.scoped_dir.XGlGX2 --change-stack-guard-on-fork=enable --shared-files=network_parent_dirs_pipe:100,v8_context_snapshot_data:101 --field-trial-handle=3,i,6724706879400872977,18314031558142100396,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,11921452979086232962,14162284320797668367,4 --trace-process-track-uuid=3190708989122997041(dns block)If you need me to access, download, or install something from one of these locations, you can either: