DSH familySearch GitHub

hook / EffectTS

ets-hook-dsh-package-governor

Keeps package.json in order without asking

0.2.1 hook EffectTS

Facts

Package
@playform/ets-hook-dsh-package-governor
Version
0.2.1
Kind
hook
Release
EffectTS
Licence
CC0-1.0
Directory
EffectTS/packages/ets-hook-dsh-package-governor

What it does

Keeps package.json in order without asking.

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 leftpad "^ 2.0.0" with the effective latest at 1.0.0
  2. Transcript leftpad "^ 1.0.0", chalk untouched

41 character changed, from 41 to  23.

Property
A dependency ceiling
Knob
registry, npm by default
Seam
fs/observed

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 fs/observed
    why

    A tool-layer write lands, carrying its path, its actor, and its version token.

  2. 02
    Gate: the basename package.json, a mutation tool, a present observation, the stash, and the exclusion list
    why

    The gate writes nothing to the ledger; the module composes its own lines.

  3. 03
    fail skipped (excluded) <path>
    why

    Exclusion-first: the internals of a dependency are never governed.

  4. 04
    Discover the nearest registry.json, and parse it
    why

    The walk-up is an auxiliary plain-fs probe; the governed manifest is never read here.

  5. 05
    branch No registry.json found, or it is unreadable
    why

    The chain pass is skipped, and the line says which of the two happened.

  6. 06
    Chain pass: canonicalize every chain-governed pin to the resolved range
    why

    A dependency outside the chain is left where the author put it.

  7. 07
    branch The refusal guard: a non-dependency section would change
    why

    The rewrite is aborted, and the refusal names the section.

  8. 08
    GuardedWrite replaceIfVersion, then re-emit fs/observed with the fresh version
    why

    The author sees its own bytes; the observation policy's version record is refreshed.

  9. 09
    Update stage: npm-check-updates in process, or the ncu bin
    why

    A detached continuation off the settled chain pass, with the chain deps rejected.

  10. 10
    branch The circuit breaker: maxUpdateFailures in a row for one directory
    why

    The directory pauses, and the line carries the count.

  11. 11
    store ~/.dsh/playform/ets-hook-dsh-package-governor.log
    why

    One global ledger, with the module identity as the line prefix.

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.

Scheme

The laws the package states in its own SCHEME.md: when it runs, what it refuses, and what stays identical because of it.

01 P The chain pass: decode, satisfy the registry, and rewrite a chain-governed pin. Pure, deterministic, idempotent.
02 U The update stage: policy-gated, cooldown-guarded, async, and skipped when the chain pass changed nothing.
Trigger The governor fires only on an author write to a package.json.
  • observation.kind is present
  • actor.name is write, edit, or str_replace_editor
  • basename(displayPath) is package.json
Exclusion A path inside the tooling is never governed.
  • no path segment is node_modules, .git, .dsh, .pnpm, .store
  • no path segment is the harness application bundle
Non-trigger The governor does not trigger itself.
  • its own write goes through the fs service, which dispatches no fs/observed
  • its update stage is a continuation, not an author call
Identical with and without
  • the tool result the author receives
  • the transcript the model reads
  • the session events the log records
Different, and only here
  • the bytes on disk, discoverable only by a later read
  • the ledger line the module writes

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 fs/observed as a emit and already has listeners there: fs-observation-policy, skill-filesystem, workspace-files.

An emit listener observes a fact that already happened, so the harness's own listeners can record it and cannot change it. This package records beside them, or acts on the world rather than on the payload.

Surface

Every listener, tool, service, and knob the README documents.

The surfaces ets-hook-dsh-package-governor registers
KindNameWhat
listenerfs/observedThe Wire-registered observation listener; basename gate package.json.
listenerfs/observed (refresh)The observation-policy refresh re-emits the service-issued fresh version.
serviceRegisterGovern("package.json", "canonicalize")The direct-govern chain-pass entry.
serviceRegisterGovern("package.json", "update")The direct-govern update-stage entry.
serviceupdate stage (Dispatch/Execute)The detached, contained continuation (npm-check-updates programmatic or ncu bin).
configupdate-policy.jsonThe update-stage policy file (policyFileName, shared discovery via the factory).
configSchemastery Config schemaThe exported Config (shared block + the module's own fields).
toolledger ets-hook-dsh-package-governor.logThe module's own log file (one global log).

Install

The package as the profile adds it.

Install sh
pnpm add @playform/ets-hook-dsh-package-governor

Configuration

Every knob this plugin documents, with its default.

Configuration of ets-hook-dsh-package-governor
FieldTypeDefaultMeaning
logbooleantrueLedger enabled - write the durable log file (volatile).
logFilestring~/.dsh/playform/ets-hook-dsh-package-governor.logThe ledger file - one global log, volatile.
updateCooldownMsnumber3000Cooldown between update-stage dispatches, per directory (volatile).
mutationToolsstring[]["write", "edit", "str_replace_editor", "raw-write"]Actor tool names whose fs/observed events trigger governing (volatile).
policyFilestring""Global policy file; empty means discovery (Function/Resolve).
excludestring[]["node_modules", ".git", ".dsh", ".pnpm", ".store", "DeepSeek Harness.app"]Excluded path segments (anywhere mode, exclusion-first) - the module's fence.
strictbooleanfalseStrict chain pass: strip unknown deps in a governed workspace.
maxUpdateFailuresnumber3Circuit breaker: consecutive update-stage failures per directory before pause.
updateModestring"programmatic"Update stage mode: "programmatic" (ncu library in-process) or "bin".
ncuBinstring"ncu"ncu binary for bin mode (binary name or absolute path, resolved via the host PATH).

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 9 answers at fs/observed, in the order the family registers them.

The family's answers at fs/observed, in the order the behavior map lists them
AnswerEffectPosition
hook-dsh-cargo-governorrewriteneighbour
hook-dsh-package-governorrewriteits twin
hook-dsh-package-pinnerrewriteneighbour
hook-dsh-workspace-approverecordneighbour
hook-dsh-workspace-auditrecordneighbour
hook-dsh-workspace-journalrecordneighbour
hook-dsh-workspace-mergerewriteneighbour
hook-dsh-workspace-monitorrecordneighbour
hook-dsh-workspace-observerecordneighbour

Arms

The seams its source also registers, beyond the one its README documents.

Its source registers no seam beyond the one its README documents.

Twin

The same package in the other release tree, when one exists.

Its twin is hook-dsh-package-governor.

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-package-governor
PackageRole
@playform/ets-base-dshfamily
@playform/ets-lib-dsh-corefamily
@playform/ets-plugin-dsh-factoryfamily
effectexternal
npm-check-updatesexternal

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.

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 fs/observed event through the factory's Wire, and the direct-govern entries for package.json.

The silent governor of every written package.json.

  • Gates on the basename, the actor tool, a present observation, the stash, and the exclusion list
  • Canonicalizes a chain-governed pin to the resolved range the nearest registry records
  • Bumps the public pins from a detached update stage, in process or through the ncu bin
  • Re-emits fs/observed with the fresh version, so the observation policy's record is current

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
  • 0.0.1

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-package-governor
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.