@playform/plugin-dsh-workspace-authority
v0.2.1
Published
The workspace-authority service: a DeepSeek plugin that IS the authority step of the workspace family's invisible flow - the licenses. The service keeps the THREE SEPARATE AUTHORITY RECORDS (v4.1 section 3.9, correcting the corpus's own conflation): the C
Readme
@playform/plugin-dsh-workspace-authority
v0.1.0 - UNPUBLISHED - plan: Workspace-Family/AUTHORITY
The role
The workspace-authority service is the authority step of the workspace family's invisible flow: operate proposes → the govern gates → the authority licenses → the approve binds.
The service keeps the three separate authority records (v4.1 section 3.9, correcting the corpus's own conflation) and owns the eviction dispositions.
The plugin ships disabled (the idle-forever posture): the service registers and reads honestly, but grants, leases, and evictions are refused with a byte-stable ledger line until enabled.
The three records (never one object)
| Record | Question | Fields | | ---------- | --------------------- | -------------------------------------------------------------------------- | | Capability | what the actor may do | holder, resource, permitted operations, expiration, delegation, revocation | | Lease | for how long | holder, resource, acquisition, expiry (lazy expiry sweep) | | Residency | what stays in store | resource, kind, weight (representation-only field), promoted flag |
The license/weight conflation is a logged pitfall, because priority, retention, and permission are never interchangeable: the capability carries no weight, and the policy never reads the weight except to order candidates.
The eviction dispositions
keep · defer · evict · discard · promote - decided by the policy table (rules per resource
kind, with defaults, TTLs, and the revocation timing); the license decides, and the weight only
ranks.
Two shields force keep: an open non-expired lease, and an active capability (a revoked one shields
only within the revocation grace).
evict keeps the record in the graveyard (recoverable), and discard removes it permanently.
The surfaces
- The service
ctx.workspaceAuthority(the method list below). - No tool, no event listener; the store is the service's own records.
Service
ctx.workspaceAuthority (registered from apply):
grant({holder, resource, operations, expiresAt?, delegation?})→ capabilityrevoke(id)·authorize(holder, resource, operation)→ booleanacquire(holder, resource, kind?, ttlMs?)→ lease ·release(id)residence(resource, kind, weight)→ residency recordevict(resources?)→{resource, disposition}[]statistics()→ counts
The configuration (all volatile)
| Field | Default | Meaning |
| -------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------ |
| enabled | false | the master switch |
| log / logFile | true / ~/.dsh/playform/plugin-dsh-workspace-authority.log | the durable ledger |
| defaultTtlMs | 300000 | the default lease TTL |
| maxLeasesPerHolder | 8 | the lease ceiling |
| maxCapabilitiesPerHolder | 16 | the capability ceiling |
| revocationGraceMs | 0 | the revoked capability's shield time |
| policy | [] | {kind, disposition, ttlMs?, maxResidencyMs?, revocationGraceMs?} |
| automation.* | the D6 block (see below) | the per-action allowlist (the shared factory block) |
The policy block (D6) - the automation key
The config carries the shared per-action allowlist (automation: Policy(), composed from the
factory's block), mapped to State.Allow:
| action | default | action | default |
| --------- | ------- | --------- | --------- |
| read | auto | write | approve |
| index | auto | commit | approve |
| record | auto | spawn | approve |
| suggest | auto | message | auto |
The key is automation, NOT policy, because this package's policy is already the residency RULE
TABLE above (kind -> disposition), a different contract; this follows the plugin-dsh-route
precedent, which keyed its D6 block automation for the same reason.
This package's actions are read-only and record, all AUTOMATIC, and it has NO gated action (no file write, no batch commit, no spawn), so the block documents the posture and refuses nothing.
The block is one volatile object, so a policy flip is hot-editable without a remount, and a resolved
pack's policy section overrides the defaults per action (the wiring is the next refinement).
The defaults are smoke-arbitrated in Source/Test/Policy-Defaults.
The ledger (module-owned, byte-stable)
authority: activated (ttl=<ms>, policy=<n>)
authority: disabled (enabled=false)
authority: granted <id> (<holder> -> <resource>, <operations>)
authority: revoked <id>
authority: authorized <holder> <resource> (<operation>)
authority: denied <holder> <resource> (<operation>)
authority: refused grant (...)
authority: leased <id> (<holder> -> <resource>, expires <ms>)
authority: expired <id>
authority: released <id>
authority: residency <resource> (weight <w>)
authority: evicted <resource> (<disposition>)The build and the tests
The build is pnpm prepublishOnly (Source/prepublishOnly.sh): the plugin build (ESM Target/, Test
tree excluded), the Test build, the harness selfcheck, and the Test type-check.
The plan
- Workspace-Family/AUTHORITY - the authority step.
- The plugin ships disabled (the idle-forever posture): the service registers and reads honestly, but grants, leases, and evictions are refused with a byte-stable ledger line until enabled.
License
CC0-1.0.
