DSH familySearch GitHub

hook / EffectTS

ets-hook-dsh-workspace-govern

Gates workspace changes before they happen

0.2.1 hook EffectTS

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.

Read the full description in the README.

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.

session 7c41e0a2 | deepseek-v4.1-flash | max | 3 turns | 9 steps | 40 records | simulated

*emit~waterfall=serial>parallel

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.

Turn 1Read the specimens14 records | 3 steps

Step 12 calls, 265 chars

Step 24 calls, 313 chars

Step 33 calls, 153 chars

Turn 2Write the run13 records | 3 steps

Step 43 calls, 174 chars

Step 52 calls, 258 chars

Step 62 calls, 115 chars

Turn 3Repair the run13 records | 3 steps

Step 72 calls, 143 chars

Step 83 calls, 184 chars

Step 92 calls, 123 chars

The turn

The same 3 calls on every plugin page, so a reader who moves between plugins stays in the same frame.

The 3 calls every plugin page shares, in sequence order
SeqCallOutcome
20bash ls -laok
21write src/index.tsok
22read src/index.tsok

Change

The one line that differs with this package installed, transcribed from its source by the dissection.

  1. Model govern: passed op:1 (write /repo/src/a.ts)
  2. 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.

  1. 01
    1. seam tools/pre-execute
    why

    The gate arm runs on every gated call, and next() is always awaited first.

  2. 02
    branch 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.

  3. 03
    pass The downstream decision is returned unchanged
    why

    A gate that is not gating leaves the waterfall exactly as it found it.

  4. 04
    Extract 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.

  5. 05
    branch The operation identifier has been gated more than loopBound times
    why

    A self-feeding operation can never re-enter the gate without end.

  6. 06
    fail loop <operation> (recursion guard)
    why

    The call passes through, and the line names the operation.

  7. 07
    Run the four independent checks: contributes, scope, policy, preconditions
    why

    The intent is never the permission, so the gate checks the means.

  8. 08
    branch 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.

  9. 09
    fail deny: the waterfall returns a deny decision with the govern reason
    why

    The proposals become effects only through the gates.

  10. 10
    branch A policy rule says escalate
    why

    The approval is the approve family's step, not this one.

  11. 11
    pass ask: the call waits for the exact approval
    why

    An escalate is a hand-off rather than a refusal.

  12. 12
    1. seam tools/post-execute
    why

    The observer records accepted or errored for the same call, so the trail is auditable.

  13. 13
    store ~/.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.

The surfaces ets-hook-dsh-workspace-govern registers
KindNameWhat
listenertools/pre-executeruns the four checks on every gated tool call.
servicectx.workspaceGovernctx.workspaceGovern (registered from apply)

Install

The package as the profile adds it.

Install sh
pnpm add @playform/ets-hook-dsh-workspace-govern

Configuration

Every knob this plugin documents, with its default.

Configuration of ets-hook-dsh-workspace-govern
FieldTypeDefaultMeaning
enabledfalsethe master switch
log / logFiletrue / ~/.dsh/playform/ets-hook-dsh-workspace-govern.logthe durable ledger (one log per module)
toolswrite, edit, bash, applyPatchthe gated tool names
scope[] (unrestricted)the authorized-scope allowlist (globs)
excludenode_modules/**, **/Target/**, **/.git/**never gated, in silence
policy[]the policy table ({kind, decision, operation?})
recovery[]the recovery-table overrides ({obligation, behavior})
loopBound4the recursion-prevention loop bound
maxDecisions500the decision ring bound
automationD6 defaultsthe 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.

The family's answers at tools/pre-execute, in the order the behavior map lists them
AnswerEffectPosition
hook-dsh-workspace-governrewriteits twin
hook-dsh-workspace-operateadviseneighbour

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.

Dependencies of ets-hook-dsh-workspace-govern
PackageRole
@playform/ets-base-dshfamily
@playform/ets-plugin-dsh-factoryfamily

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.

Open the package source

Origin

The files this page was built from, and what each one supplies.

The files this page was read from 5
The files behind https://github.com/PlayForm/DeepSeek/tree/Current/EffectTS/packages/ets-hook-dsh-workspace-govern
FileContributedState
package.jsonThe name, the version, the private flag, and the dependencies.read
README.mdThe summary, the surface table, and the configuration table.read
CHANGELOG.mdThe release lines and their versions.read
cordis.patch.ymlActivation: the bundle entry that mounts the plugin.read
Source/Function/Apply.tsThe 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.