webstercli

package
v0.0.0-...-77630a4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 45 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

acceptaudit.go implements the `accept-audit` webster verb: the operator's acknowledgement of the run-exit correctness findings that stay pending and block run entry. With --batch it accepts one failed batch's pathless fabric-reference findings.

awaitbatch.go implements the `await-batch` webster verb: a bounded wait for one batch's report file. An operator watching a run calls it. Master does not call it: it ends its turn while a backgrounded fork works, and it records the batch on the fork's completion notification. The verb is stateless: it reads no state.json, takes no lease and makes no fabric commit. It only watches the report path, so no caller, at any time, can corrupt a run.

beginbatch.go implements the `begin-batch` webster verb. Master calls it immediately before forking a batch's implementer. It runs websterengine.BeginBatch under the state-mutation lease (load, mutate, save, release). It then makes one of webster's fabric-commit points: state.json, holding the batch's start-SHA and record, is durable before Master forks. The fork prompt is not part of that commit: the sync pathspec excludes prompts/*, which are machine-local artifacts that BeginBatch rewrites on every begin.

Package webstercli is the `lym webster` command. It drives a pinned plan-format plan through a long-lived Master session that forks one implementer per batch. It also holds the file-contract-backed verbs that Master's own prompt drives.

Modes

In hub mode webster runs inside a lym hub worktree. In standalone mode it runs in a plain git checkout with no hub beside it. It is lifted to the root of its git repository. `--stencils-dir` and `--plan-dir` are read-only overrides in both modes. `--target-dir` is standalone-only; hub mode refuses it, since the worktree is the target. In standalone mode run boots its own private reed session, since `lym reed up` is a hub verb.

Validate

validate is not read-only. Its resolve pass can canonicalize a `plan:` handle, which rewrites card files. It then re-baselines state.json's plan fingerprint. With a run in progress, a plan edited since the recorded fingerprint is linted but not re-baselined, so an edit is never adopted unseen. Its scope follows the run's progress: "whole-plan" before any batch is begun, "pending" after.

Reset

reset moves the checkout to a recorded target: start, report-head or batch-start. It refuses, changing nothing, when the run holds the run lock (except report-head, which Master runs inside its run); during a merge, off the task branch, with a dirty tracked path the run did not write; or when the remote task branch holds commits the checkout lacks or the remote cannot be read or updated. With a start that cannot be moved to, start archives the run record without moving. The archive refuses, with the move already made, on a pending finding that names its clearing step; re-running converges. In hub mode the reset's records commit carries a `Run-Transition` trailer naming the worktree's run, so the run's last transition names the code tip the reset moved to, not the tip it dropped.

In standalone mode reset moves HEAD with git's keep form and touches no remote. If the checkout rewrite fails after the remote moved, the error envelope carries `partial` true; re-running converges.

Recover-batch, fix-verify and fix-plan

recover-batch exits non-zero whenever its terminal record is not done. A stuck or dead digest goes out as an error envelope carrying the same fields as a done one, and names the way forward. A done digest and a running snapshot exit 0, and Master reads the digest fields, never the exit code.

fix-verify runs the cold verify-gate fixer. fix-plan runs the cold plan fixer after begin-batch refuses with `plan_conflict`. A dead fixer exits non-zero with a message naming the way forward.

Run ownership

A bracket verb, begin, await, record and recover-batch, fix-verify and fix-plan, is Master's own call under a live run. A call from a Master strand while no `lym webster run` holds run.lock refuses before it reads or writes anything. The refusal carries `run_ended: true`. A call whose run.lock probe fails also refuses, with the way forward of re-running the verb and no `run_ended`. Any other caller, such as manual driving from a shell, gets a warning on the envelope instead.

fixplan.go implements the `fix-plan` webster verb. It is the re-entrant, blocking call Master makes, backgrounded, after begin-batch refuses with a plan conflict. It drives websterengine's plan-fixer phases with a real, wall-clock Clock. FixPlanSpawnOrAttach runs under the state-mutation lease. A spawn is saved and fabric-committed as "fix-plan spawn". FixPlanAwait runs with the lease released, so the fixer's own rebaseline can take it. A terminal result is recorded by RecordPlanFixerTerminal into a freshly reloaded state under a re-acquired lease. The state is then saved and fabric-committed as "fix-plan <status>".

fixverify.go implements the `fix-verify` webster verb: the re-entrant, blocking call Master makes in the background. It runs when a verify-gate failure's way forward names the cold fixer. It drives websterengine's cold-fixer phases with a real, wall-clock Clock. FixVerifySpawnOrAttach runs under the state-mutation lease, and a spawn is saved and fabric-committed "fix-verify spawn". FixVerifyAwait runs with the lease released. A terminal result is recorded by RecordVerifyFixerTerminal into a freshly reloaded state under a re-acquired lease, and the state is saved and fabric-committed as "fix-verify <status>".

ownership.go guards the bracket verbs against state that no live `lym webster run` owns. The bracket verbs are begin, await, record and recover-batch, fix-verify and fix-plan. A bracket verb is Master's own call and legitimately runs only under a live run holding run.lock. A Master session that keeps driving verbs after its run ended is a zombie: its commits and records drift from the loom row, which still shows the run's last outcome. So a bracket verb called from a Master strand refuses while run.lock is free. Any other caller, such as the sandbox suite's manual driving, only gets a warning on the envelope.

rebaseline.go implements the `rebaseline` webster verb, the operator's way to accept a plan edit made mid-run. It runs websterengine.Rebaseline under the state-mutation lease: load, restamp, save, release. It then fabric-syncs the restamped state.json.

recordbatch.go implements the `record-batch` webster verb, which Master calls right after a batch's fork returns. It runs websterengine.RecordBatch under the state-mutation lease. The Sleeper is backed by time.Sleep and paces the fork audit's settle retry. RecordBatch either lands a terminal digest or advances transcript attribution on a no_report retry. Either way, state.json and the batch report are committed to fabric before Master's next tool call. A *BatchFailedError saves the whole mutated state and commits it. A *ReportArchivedError commits the archive move, and both commit before the error envelope is emitted.

recoverbatch.go implements the `recover-batch` webster verb. The verb is the blocking escalation call that Master's prompt makes in the background. It runs when a fork reports stuck or never reports. The verb drives three lease-scoped phases of websterengine with a wall-clock Clock. `RecoverSpawnOrAttach` runs under the state-mutation lease. It includes the provider's startup window, which startup_timeout_s bounds. When the call performs the spawn, it saves the state and commits it to fabric as "... spawn". `RecoverAwait` blocks for up to recovery_timeout_min with the lease released. Holding the lease across that wait would stall every concurrent verb and run entry. On a terminal digest, `PersistRecoveryTerminal` runs on a freshly reloaded state under a re-acquired lease, and the verb then commits it to fabric as "... <status>". A *BatchFailedError from the persist step saves the reloaded state and commits it as "... failed". Only then does the verb emit the batch_failed error envelope.

refusalnote.go writes the friction note a `lym webster` refusal leaves. The note is written at the one place every verb's output passes through. A verb is unaware of the note. noteRefusals wraps the verb's RunE, tees what the verb prints, and reads the envelope back.

reset.go implements the `reset` webster verb: the guarded way to move the task branch back to a commit the run recorded. It plans the reset with websterengine.PlanReset and performs it through fabricengine's pair-checkout reset. In standalone mode it performs it through gitrepo's keep-reset instead. It then clears the persisted pre-fix head and fabric-syncs state.json. That records commit marks the run's transition at the new tip. A reset to start ends by archiving the run record, or archives alone when the start cannot be moved to. The verb runs no git of its own, so an agent that is denied `git reset --hard` still has a way to recover.

restoreplan.go implements the `restore-plan` webster verb: it writes every plan file that differs from the plan the run recorded back from webster's own stored copy. It runs websterengine.RestorePlan under the state-mutation lease (load, restore, release), then fabric-syncs.

run.go implements the `run` webster verb: it maps websterengine.Run's outcome onto the run-level backstop fabric commit and the CLI envelope. ErrRunBusy skips the fabric sync entirely. The losing call touched nothing. Syncing would commit the winner's in-flight partial state under a misleading label. Every other exit runs the backstop fabric commit before its envelope, success or error. That includes ErrFingerprintMismatch and the distinct MasterDied and MasterTimeout errors. Completed batches' artifacts must not strand uncommitted.

status.go implements the `status` webster verb, an instant and side-effect-free snapshot of _lym/webster/state.json. It never spawns an agent, never commits to fabric, and never mutates state.json. Webster writes a batch's Status, Terminal and Digest onto state.json once the batch is terminal. Status therefore needs no reports-dir scan.

sync.go implements fabricSync, the package-local helper that each batch-boundary commit point calls. It stages, commits and pushes the webster artifacts just written: state.json, a batch report and outcome.yaml. It does so through the fabric repo, using fabricengine.Fabric.CommitWithTrailers. Machine-local runtime artifacts never reach the pathspec this helper stages against. They live under .lym: run.lock, mutate.lock and webster's rendered fork prompts. The pathspec is positive only, with no ":(exclude)" magic of its own. fabricSync takes its fabric handle from a lazy opener, and its scope from a separate anchor-relative path. The scope is passed separately because fabricengine.Fabric exposes no anchor-relative path of its own. A nil opener means standalone mode, which has no fabric repo: fabricSync then reports (false, nil) without touching git.

validate.go implements the `validate` webster verb. It is the lint-without-run half of the automatic gate that websterengine.Run applies before it spawns Master. It parses the plan and runs every plan-format machine check against it. It prints exactly one JSON envelope. An ok envelope, {"valid": true, "cards": <n>, "scope": <scope>}, marks a clean plan. An error envelope carries every finding. It exits non-zero whenever a blocking finding exists, and it never prints plain text. The check set is scoped the way Run scopes its own, and the "scope" key names which answer the call gave: the index's Validate, the whole-plan answer, while no batch has begun; or planglyph.ValidateDispatch's pending-cards answer once a run has begun any batch. See scopedValidate for why the two are not interchangeable. Run's pre-flight also refuses a zero-batch plan outright: nothing to build is a malformed plan, never a vacuous done outcome (websterengine's runlevel.go). validate surfaces that emptiness through the findings set rather than a distinct check, since a zero-card plan already fails planparser's index-file-consistency checks. With --batches the ok envelope also carries "profile" and "batches": the fresh partition the active batchifier forms for the plan. Each batch lists its card numbers and estimated peak context. It is computed without state, so it shows what a fresh run would form even while a run holds its recorded partition.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command() *cobra.Command

Command returns the cobra command tree for the webster module.

The parent "webster" command's PersistentPreRunE, c.resolvePersistentPreRun, resolves the working directory. It wires the engine stack into c. It skips resolution when the group command itself is invoked.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL