Add the session view to the trace page. Read the specimens first, then build the lane strip, the tree, the document, and the inspector from one authored run. The family's plugins must be visible on the records they touch, and the page must read the same run with the family off.
hook / EffectTS
ets-hook-dsh-workspace-govern
Gates workspace changes before they happen
Facts
- Package
- @playform/ets-hook-dsh-workspace-govern
- Version
- 0.2.1
- Kind
- hook
- Release
- EffectTS
- Licence
- CC0-1.0
- Directory
- EffectTS/packages/ets-hook-dsh-workspace-govern
What it does
Gates workspace changes before they happen.
Conversation
The turn as a document: the calls every plugin page shares, what this package changes in them, and the order its work happens in.
Conversational
Lane
The same run as time: one row per resource, a bar per span, and the clock every record shares. A wait is drawn as an outline, because nothing is busy.
Session
The tree, the document, and the inspector read one record list. The switch at the top of the document changes the face they read, and the run changes with it.
The turn
The same 3 calls on every plugin page, so a reader who moves between plugins stays in the same frame.
| Seq | Call | Outcome |
|---|---|---|
20 | bash ls -la | ok |
21 | write src/index.ts | ok |
22 | read src/index.ts | ok |
Change
The one line that differs with this package installed, transcribed from its source by the dissection.
- Model govern: passed op:1 (write /repo/src/a.ts)
- Transcript kind: "deny", reason: "govern: contributes"
43 character changed, from 42 to 43.
- Property
- A write guard
- Knob
- enabled, off in the bundle patch
- Seam
- tools/pre-execute
This package ships disabled: the left side of the pair is what the harness does with the package installed but inactive, and enabling it is one line in the profile's bundle patch.
Flow
The order this package's work happens in, with the branch that decides it inline, transcribed from the source; the rule it obeys is the last band of Architecture.
- 01
- seam tools/pre-execute
why
The gate arm runs on every gated call, and next() is always awaited first.
- 02branch The tool is outside the gate set, the event is the hook's own, or the target is excluded
why
An excluded target is never gated, and the pass is silent.
- 03pass The downstream decision is returned unchanged
why
A gate that is not gating leaves the waterfall exactly as it found it.
- 04Extract the proposal: the operate record when one is attached, else the minimal synthesis from the call
why
The operation, the parent, and the category travel with the proposal.
- 05branch The operation identifier has been gated more than loopBound times
why
A self-feeding operation can never re-enter the gate without end.
- 06fail loop <operation> (recursion guard)
why
The call passes through, and the line names the operation.
- 07Run the four independent checks: contributes, scope, policy, preconditions
why
The intent is never the permission, so the gate checks the means.
- 08branch A check fails, and the recovery table says fail-closed
why
Scope is the one obligation that fails closed; the others fail open and say so.
- 09fail deny: the waterfall returns a deny decision with the govern reason
why
The proposals become effects only through the gates.
- 10branch A policy rule says escalate
why
The approval is the approve family's step, not this one.
- 11pass ask: the call waits for the exact approval
why
An escalate is a hand-off rather than a refusal.
- 12
- seam tools/post-execute
why
The observer records accepted or errored for the same call, so the trail is auditable.
- 13store ~/.dsh/playform/ets-hook-dsh-workspace-govern.log
why
The decision ring is bounded by maxDecisions.
Harness
The laws the package states, the line it writes when it loads, the seam the harness dispatches with none of the family, and the surface and knobs a run can set.
Default
What the harness does at this package's seam with none of the family installed, so the surface below has something to be a difference from.
The harness dispatches tools/pre-execute as a waterfall and already has listeners there: auto-review, hooks-claude-code, hooks-codex, liveshare, tool-jobs, workspace-changes.
A waterfall listener receives the payload and may return a changed one, so the harness's own listeners can already change what the model reads. This package adds another listener to that list.
Surface
Every listener, tool, service, and knob the README documents.
| Kind | Name | What |
|---|---|---|
| listener | tools/pre-execute | runs the four checks on every gated tool call. |
| service | ctx.workspaceGovern | ctx.workspaceGovern (registered from apply) |
Install
The package as the profile adds it.
pnpm add @playform/ets-hook-dsh-workspace-governConfiguration
Every knob this plugin documents, with its default.
| Field | Type | Default | Meaning |
|---|---|---|---|
| enabled | false | the master switch | |
| log / logFile | true / ~/.dsh/playform/ets-hook-dsh-workspace-govern.log | the durable ledger (one log per module) | |
| tools | write, edit, bash, applyPatch | the gated tool names | |
| scope | [] (unrestricted) | the authorized-scope allowlist (globs) | |
| exclude | node_modules/**, **/Target/**, **/.git/** | never gated, in silence | |
| policy | [] | the policy table ({kind, decision, operation?}) | |
| recovery | [] | the recovery-table overrides ({obligation, behavior}) | |
| loopBound | 4 | the recursion-prevention loop bound | |
| maxDecisions | 500 | the decision ring bound | |
| automation | D6 defaults | the per-action allowlist (the shared factory block; keyed automation - policy is the decision rule table) |
Family
The neighbours at the same seam, the arms beyond it, the twin in the other release tree, and the packages this one needs.
Neighbours
The behavior map lists 2 answers at tools/pre-execute, in the order the family registers them.
| Answer | Effect | Position |
|---|---|---|
| hook-dsh-workspace-govern | rewrite | its twin |
| hook-dsh-workspace-operate | advise | neighbour |
Arms
The seams its source also registers, beyond the one its README documents.
Twin
The same package in the other release tree, when one exists.
Its twin is hook-dsh-workspace-govern.
It registers the same listeners in the same order and composes the same ledger strings; the ledger file's name, which carries the package identity, and the factory base import are the only differences.
Dependencies
The packages this one imports, and whether each one is the family's own.
| Package | Role |
|---|---|
| family | |
| family |
Person
What the person waits for, reads, and never sees.
The person sees the text after the rewrite and not what it replaced, so the change stays invisible unless the source is read beside the result.
The source records no verdict table for this package, so no gate machine is drawn; the branch it takes is in the flow above.
Architecture
This plugin's own structure: the shape the portrait gives it, the facts its source documents, and the rule its flow obeys.
Shape
Plugs into the workspaceGovern service, the tools/pre-execute gate, and the tools/post-execute observer.
The gate that checks the means, because an intent must not authorize its own.
- Runs four independent checks on a proposed change: contributes, scope, policy, preconditions
- Takes each failure behavior from the recovery table rather than a silent default
- Returns the downstream decision unchanged on pass, a deny reason, or an ask
- Drops an operation that re-enters the gate past the loop bound
- Its flow is the interesting part rather than its verdict: the four checks and the recovery table, not the deny
Its shape machine belongs to Person.
Record
The release line, the source, and the files this page was read from.
Release
The versions the package's own changelog records, newest first.
- 0.3.0
- 0.2.1
- 0.2.0
- 0.1.0
Source
The package as the repository holds it.
Origin
The files this page was built from, and what each one supplies.
The files this page was read from 5
| File | Contributed | State |
|---|---|---|
| package.json | The name, the version, the private flag, and the dependencies. | read |
| README.md | The summary, the surface table, and the configuration table. | read |
| CHANGELOG.md | The release lines and their versions. | read |
| cordis.patch.yml | Activation: the bundle entry that mounts the plugin. | read |
| Source/Function/Apply.ts | The listeners, their registration order, and the service the flow calls. | read |
- Data
- The monorepo, read during the build
- Connection
- Build-time read; nothing is fetched at runtime
- Capture
- package.json, README.md, CHANGELOG.md, Source/Function/Apply.ts
Expand provenance source
This page is static. It cannot invoke the plugin, read a ledger, or change a configuration. Every figure comes from those files; a missing README falls back to the manifest's own description, and a package with no surface table shows no surface section.