@dialecte/cli 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli.js +19950 -17849
- package/dist/lookups.d.ts +52 -26
- package/dist/lookups.js +162 -62
- package/package.json +4 -2
- package/templates/ci/.github/pull_request_template.md +1 -1
package/dist/lookups.js
CHANGED
|
@@ -165,6 +165,13 @@ import { dirname as dirname2, join as join2, parse, relative as relative2, resol
|
|
|
165
165
|
// src/lib/file-system.ts
|
|
166
166
|
import { lstatSync, realpathSync, statSync } from "fs";
|
|
167
167
|
import { basename, dirname, isAbsolute, join, relative, sep } from "path";
|
|
168
|
+
function isLink(path) {
|
|
169
|
+
try {
|
|
170
|
+
return lstatSync(path).isSymbolicLink();
|
|
171
|
+
} catch {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
168
175
|
function isFolder(path) {
|
|
169
176
|
try {
|
|
170
177
|
return statSync(path).isDirectory();
|
|
@@ -697,11 +704,26 @@ function inferredToolsLabel() {
|
|
|
697
704
|
}).join("; ");
|
|
698
705
|
}
|
|
699
706
|
|
|
707
|
+
// src/lib/package-json.constants.ts
|
|
708
|
+
var DECLARING_FIELDS = [
|
|
709
|
+
"dependencies",
|
|
710
|
+
"devDependencies",
|
|
711
|
+
"optionalDependencies",
|
|
712
|
+
"peerDependencies"
|
|
713
|
+
];
|
|
714
|
+
|
|
700
715
|
// src/lib/package-json.ts
|
|
701
716
|
function readPackageJson(root) {
|
|
702
717
|
const source = readStepSource(root);
|
|
703
718
|
return "refusal" in source ? {} : source.packageJson;
|
|
704
719
|
}
|
|
720
|
+
function declaredSpecOf(params) {
|
|
721
|
+
const field = DECLARING_FIELDS.find(
|
|
722
|
+
(candidate) => typeof params.manifest[candidate]?.[params.name] === "string"
|
|
723
|
+
);
|
|
724
|
+
const spec = field === void 0 ? void 0 : params.manifest[field]?.[params.name];
|
|
725
|
+
return field === void 0 || typeof spec !== "string" ? void 0 : { field, spec };
|
|
726
|
+
}
|
|
705
727
|
|
|
706
728
|
// src/lib/process-alive.ts
|
|
707
729
|
function isProcessAlive(pid) {
|
|
@@ -741,6 +763,19 @@ import { dirname as dirname5, join as join10, resolve as resolve3 } from "path";
|
|
|
741
763
|
import { existsSync as existsSync4, readdirSync as readdirSync3, readFileSync as readFileSync4 } from "fs";
|
|
742
764
|
import { join as join6, sep as sep2 } from "path";
|
|
743
765
|
|
|
766
|
+
// src/lib/skills/cli-invocations.constants.ts
|
|
767
|
+
var CLI_PACKAGE = "@dialecte/cli";
|
|
768
|
+
var CLI_BIN = "dialecte";
|
|
769
|
+
var UNTAGGED_FENCE_INVOCATION_PATTERN = new RegExp(`^\\s*${CLI_BIN}\\s+(\\S+)`);
|
|
770
|
+
var UNAVAILABLE_REASONS = {
|
|
771
|
+
noCli: `no ${CLI_PACKAGE} installed in this package`,
|
|
772
|
+
noBin: `the installed ${CLI_PACKAGE} {version} has no \`${CLI_BIN}\` bin`,
|
|
773
|
+
failed: `the installed ${CLI_PACKAGE} {version} did not answer \`${CLI_BIN} --help --json\`: {detail}`,
|
|
774
|
+
badManifest: `the installed ${CLI_PACKAGE} has a package.json that is no JSON`,
|
|
775
|
+
noJson: `the installed ${CLI_PACKAGE} {version} answers \`--help --json\` with no JSON`,
|
|
776
|
+
noMap: `the installed ${CLI_PACKAGE} {version} answers \`--help --json\` without the verbs and flags of its commands (a cli before the command map)`
|
|
777
|
+
};
|
|
778
|
+
|
|
744
779
|
// src/lib/store/identity.ts
|
|
745
780
|
import { readFileSync as readFileSync5 } from "fs";
|
|
746
781
|
import { join as join7 } from "path";
|
|
@@ -2428,8 +2463,8 @@ var COMMAND_MAP = {
|
|
|
2428
2463
|
"dialecte lot report --kept [--json]",
|
|
2429
2464
|
"dialecte lot export <id> <dir> [--json]",
|
|
2430
2465
|
"dialecte lot brief <id> --from <brief.json> --by <who> --reason <text>",
|
|
2431
|
-
"dialecte lot
|
|
2432
|
-
"dialecte lot review <id> [--no-open] | lot review <id> --
|
|
2466
|
+
"dialecte lot describe <id> [--print] [--json]",
|
|
2467
|
+
"dialecte lot review <id> [--no-open] | lot review <id> --comments --round <n>",
|
|
2433
2468
|
"dialecte lot approve <id> --by <who> [--reason <text>]",
|
|
2434
2469
|
"dialecte lot design <id> [--from <file> | --from-plan | --approve --by <who> [--reason <text>] | --waive --by <who> --reason <text>] [--json]",
|
|
2435
2470
|
"dialecte lot land <id>",
|
|
@@ -2438,23 +2473,25 @@ var COMMAND_MAP = {
|
|
|
2438
2473
|
"dialecte lot prune [<id>...] [--feature <name>] [--all] [--yes] [--json]"
|
|
2439
2474
|
],
|
|
2440
2475
|
notes: [
|
|
2476
|
+
"every verb - the cli floor, read before any verb runs (wait included, help aside): a cli older than the version a repository the invocation reaches asks for runs nothing (exit 2, naming the path it was started by and its real path, both versions and where the floor came from; --json { error, next: null }); the repositories are the current folder's package and those of each lot a word names (an id, an option's value or a word after --: the lot's worktree and repository, never the cli that started it) and of a brief's repository; a package's floor is the cli repository's own version, else the lowest version its @dialecte/cli pin admits (dependencies, devDependencies, optionalDependencies, peerDependencies); a pin with no lower bound (*, x, an empty spec, workspace:*, <2.0.0, an || alternative without one) or no semver range (file:, link:, a path or url, git+, a dist-tag, workspace:^ or workspace:~ with no version after them) asks for the installed cli's version (none installed: no floor); a package in a subfolder that does not ask for the cli takes the floor of the package above it, up to its repository's root; when the working tree's floor refuses, the base branch's tip is read and the cli is refused only below both (a release or pin-bump lot stays landable by the main checkout's cli); the highest floor across the repositories decides; equal or newer runs; a version the cli cannot read for itself is refused whenever a floor exists",
|
|
2441
2477
|
"start - checks the brief (every refusal at once, exit 2), claims the next index, publishes the lot folder in <git common folder>/dialecte-lots/, makes the numbered worktree at the base commit with its .dialecte/lot link; --dry-run checks (the store list included), names the lot and the start to run next, writing nothing; exit 1 when the worktree cannot be made (the lot failed, nothing removed, next: lot stop); a link that cannot be made leaves the lot working with a note; every --json exit is JSON, a usage error { error, usage, next: null } included",
|
|
2442
2478
|
"start - --keep <why> or the brief's keep (one line of at most 200 characters) keeps the lot on purpose from its start: its first keep.jsonl line, signed by --by (orchestrator in any casing recorded orchestrator) or caller, is written with its records before the lot is published (a simulated lot's too; --dry-run names it, keep: <why>, writing nothing), the start line and --json name it (kept: <why>); --keep and a brief keep together, or a keep or its signer holding a forbidden word, a path, a link, a reference or a plan entry id, refuse (exit 2, nothing published); after the start a keep changes through lot keep and lot unkeep only (lot brief refuses a changed keep)",
|
|
2443
|
-
"start - --on <lot> starts the lot on another open lot of the same repository (a stack): its branch is cut at that lot's branch tip, its stack.json records the parent only (where it forks is read from git when it lands), and the parent's scope is its base, never an overlap, at the start and at lot scope --add (every other open lot's still is); a parent that is unknown, damaged, not working or ready, of another repository or without its branch is refused before anything is written, before any other fault of the brief; lot status shows a stack line, on <parent> (#<
|
|
2479
|
+
"start - --on <lot> starts the lot on another open lot of the same repository (a stack): its branch is cut at that lot's branch tip, its stack.json records the parent only (where it forks is read from git when it lands), and the parent's scope is its base, never an overlap, at the start and at lot scope --add (every other open lot's still is); a parent that is unknown, damaged, not working or ready, of another repository or without its branch is refused before anything is written, before any other fault of the brief; lot status shows a stack line, on <parent> (#<change request>, <state>), the parent read through the one lot reader: merged once its landing is proven (its landed fact, git or the host), else its change request as the host holds it (open, draft, queued, closed, or the host cannot say: <why>), the hand-over card on <parent> (#<change request>) from files only; on <parent> (no change request yet) without one",
|
|
2444
2480
|
"start - a scope meeting another open lot goes ahead when that lot's work reads (its forecast against main, run and never written: a new lot has no work, so no conflict can exist), printed shares <met> with <lot> (forecast clean); still refused: a damaged lot or one whose scope cannot be read, a met lock file (exclusive: a lock file is never shared), a forecast that cannot run (forecast unknown: <reason>); after the start the new lot's own forecast is recorded (trigger start); the re-check after the start refuses only what still refuses (a lot that published meanwhile but has no worktree on disk yet has no work: the start goes on)",
|
|
2445
2481
|
"start - --overlap-ok accepts an overlap the start refuses, for an overlap that names its paths (a lot whose scope cannot be read stays refused; a damaged other lot whose scope reads is accepted, its damage recorded beside the go-ahead); it takes --by <who> --reason <text>, the same go-ahead as an effort below the class; each accepted overlap is a line of the lot folder's overlaps.jsonl (the other lot, the met pairs, who and why), printed by the start and its dry run (! overlaps <lot>: ...) and shown on the card's scope line as a warning; on an overlap the forecast cleared it is recorded all the same, printed --overlap-ok not needed: the forecast cleared <lot>; the re-check after the start refuses a held lot the go-ahead did not name",
|
|
2446
2482
|
"start - the effort: the risk class of the brief's scope (high when an entry reaches the package's dialecte.risk.high list) sets the default (high, medium or low); on a terminal, without --json or --dry-run, the effort is asked with that default; an effort below the class (from --effort, the brief or the answer) is refused (exit 2, nothing written) without --by <who> --reason <text>, which are recorded on an effort line in risk.jsonl with the class's derived line, the start printing ! effort <e> below risk class <c> (by <who>: <reason>)",
|
|
2447
2483
|
"--simulate - start a simulated lot that plays one of the scenarios (ready, question, person, two-questions, limit, failure, slow) under wait: no worktree, no branch, no registry entry; it never blocks a real lot",
|
|
2448
|
-
"brief - a working or ready real lot takes a new brief whose only changes are its public text (the summary, the issue, step titles and behaviours); any other change is refused naming the field, nothing written; the new brief passes the start's field and public-text checks; it replaces the stored brief and a brief transition records the sha256 of the old and new brief, --by and --reason, the state and position kept; the same brief again answers already, nothing written; a simulated lot is refused; brief.json edited any other way reads as damage",
|
|
2449
|
-
"
|
|
2450
|
-
"review - the private half of the lot's review, read-only (nothing written): the lot's state and branch, its
|
|
2451
|
-
"review --
|
|
2452
|
-
"approve - a person's approval of the lot's
|
|
2484
|
+
"brief - a working or ready real lot takes a new brief whose only changes are its public text (the summary, the issue, step titles and behaviours, and each lot's commit message, which titles its change request); any other change is refused naming the field, nothing written; the new brief passes the start's field and public-text checks; it replaces the stored brief and a brief transition records the sha256 of the old and new brief, --by and --reason, the state and position kept; the same brief again answers already, nothing written; a simulated lot is refused; brief.json edited any other way reads as damage",
|
|
2485
|
+
"describe - renders the lot's change request from its records through the repository's change-request template (its host's path; with no host known, the first host template the tree holds): the title is the brief's first commit message (changed with lot brief), the body its summary and other commit messages, step titles and behaviours, the changelog fragments the lot adds, tests.json (a part of another tree reads stale), review.jsonl (findings and how each closed, the verdicts by reviewer kind, never a name; a row value its writer never writes refused), the risk class and effort, the overlaps it accepted (the other lot by its index, and why), the issue it closes, and the author's checklist ticked from the records; a missing record reads not recorded; a lot that changes package.json's version is refused when its title does not name the new version (read at the lot's own fork point: a lot started on an open release lot sets none), naming lot brief; the record text is checked first (a reference, a forbidden word, a plan entry id, a link or a path outside the tree refused, naming the word and the record); the open change request (landing.json's, else the branch's newest) is edited only when its title or body reads otherwise, a person's part after the kept marker kept (a body without that heading holding a person's text refused, never dropped); a damaged lot refused; --print prints and sends nothing; no change request yet prints the text and names lot land; --json { title, body, changeRequest, head, sent }",
|
|
2486
|
+
"review - the private half of the lot's review, read-only (nothing written): the lot's state and branch, its change request (landing.json's) with the head it is at, the head the lot landed and the worktree's HEAD, its checks, the brief's goal and steps (title, spec, behaviours), tests.json's tdd counts and gate run, decisions.md, every finding of the ledger with its text and state, the standard line, and the approve line: the refusals lot approve checks from what the review reads (the lot's state, the change request open at the head the lot landed, the worktree's head, the checks, open findings, the design, a host offering no queue for a lot queued alone (the queue kind read once), a stack record that does not route), or the approve command when none applies; a stacked lot's parent and whether the text renders are checked by lot approve only; then opens the change request's changed files in the browser (--no-open names the page only; an opener that fails is named, never an exit); a lot without a landing prints its private half and names lot land <id>, the host never asked",
|
|
2487
|
+
"review --comments - the change request's line comments come back as findings of round <n> in the lot's findings ledger: a thread's first comment only (replies discuss it), each once (pulled-comments.jsonl records the comment and its finding; a second pull answers already), its severity from a leading blocking:, should-fix: or nit: (dropped from the text, kept when it is all the comment says), else should-fix, at its path:line (the path alone for a comment on the file), its lines joined into one; review.jsonl written again; private points stay off the change request: lot finding records them",
|
|
2488
|
+
"approve - a person's approval of the lot's change request: refused (exit 1, nothing recorded, nothing queued) unless the lot is at work, the change request landing.json names is open at the head the lot landed and the worktree is at that head too (an unpushed commit refuses), its checks ran on that head and are green (a check run again counts by its newest run; a failing or pending check, or none yet, refuses) and no finding but a nit is open (open, or a fix still to verify), and its text renders over the live body; then appends { schema, at, by, reason?, number, head } to the lot folder's approvals.jsonl, which review.jsonl shows as a person's approve verdict with that head (a change request text rendered on another head, after a later commit or a rebase, leaves it out; the body names it by kind only, never the name; the orchestrator in any casing and spacing is recorded as orchestrator), renders the change request's text again from the records, makes a draft ready and queues it (the host's auto-merge or queue; a lot started with --on whose change request still merges into its parent's branch queues as a stack up to it through the host's stack merge, and only on a host with stacks once the parent's change request, read by the parent's branch, is queued (auto-merge on or in the host's queue), refused otherwise before anything is recorded: approve the parent first, or land it again once the parent merged); the only verb that queues, lot land never does; a queue the host refuses after the up-front queue-kind check keeps the approval (exit 1) and the same approval run again answers already approved, writing nothing, and queues; --by orchestrator (in any casing and spacing) approves the cli's own lots only (the package named @dialecte/cli), every other package waits for a person (exit 2); a forbidden word in --by or --reason, or a --by holding what a public record never holds, refused (exit 2) before the host is asked; a lot without a landing names lot land <id>; the queued line names the queue the host answers for the change request's base (queued (<the host's word for its queue>)), nothing when the read is refused or the lot is stacked; a lot queued alone whose host offers neither auto-merge nor a queue is refused before anything is recorded or sent, naming what to turn on (the queue kind read once, before the approval; a refused read refuses nothing)",
|
|
2453
2489
|
"design - a lot's design (design before code): --from <file> records it by the sha256 of its bytes, appending { schema, at, kind: recorded, file, hash, from } to the lot folder's design.jsonl and keeping its copy as design/<hash>.md (the copy rules once the source is gone); a file missing, empty, not UTF-8 or under a scratch root, the system's temporary folder, /tmp or /private/tmp (wiped there) is refused (exit 2), nothing written, and a file outside every git work tree is recorded (plans live there); without a worktree the lot is read at the base recorded at its start, a ! line saying so; --from-plan records the spec of the plan entry the lot carries out, refused when another lot or fix entry of its block names the same spec (write this lot's own design) or the lot carries out no entry with a spec; --approve --by <who> [--reason <text>] appends an approval of the last recorded hash with the need it was given against, refused when nothing is recorded or the source exists with other bytes (record it again); --waive --by <who> --reason <text> appends a waiver with the current need, refused on a lot that needs no design; both refused from the lot's own worktree or its review throwaway (approve from the main checkout), and on a --by or --reason holding a forbidden word or a --by holding what a public record never holds (exit 2); the orchestrator in any casing is recorded as orchestrator; a lot no longer at work is refused (exit 1); without an option it prints design <state>[ by <kind>][ \xB7 <reasons>] and the next command, --json { required, reasons, state, by, uncovered } (by the kind, never a name)",
|
|
2454
|
-
"design - the need, computed by every reader and never stored: required when a scope entry (or a path) lies in a dialecte.risk.high area or is broader than one, or the lot carries out a plan entry of kind lot; an approval or a waiver holds only for the need it was given against (a reason of a new kind or glob reads unapproved or missing again); a recorded design gates the lot whatever its need; states approved, waived, unapproved (shown not approved), stale (shown stale since its approval: the source edited after its approval), missing, not-required (shown not required); lot start and its dry run print design required (<reasons>) or design not required, lot forecast and lot status the state line, the hand-over card a design line (passed or a warning, never failed), review.jsonl a design row and the
|
|
2455
|
-
"design - the gate: while a lot's required design is missing, unapproved or stale, tdd red in its own worktree refuses (exit 2, nothing run), gate --hook's design step fails a commit of the lot's branch, from any worktree, holding a production path (
|
|
2456
|
-
"land - a lot started with --on lands as a stack: its
|
|
2457
|
-
"land - the lot lands through its
|
|
2490
|
+
"design - the need, computed by every reader and never stored: required when a scope entry (or a path) lies in a dialecte.risk.high area or is broader than one, or the lot carries out a plan entry of kind lot; an approval or a waiver holds only for the need it was given against (a reason of a new kind or glob reads unapproved or missing again); a recorded design gates the lot whatever its need; states approved, waived, unapproved (shown not approved), stale (shown stale since its approval: the source edited after its approval), missing, not-required (shown not required); lot start and its dry run print design required (<reasons>) or design not required, lot forecast and lot status the state line, the hand-over card a design line (passed or a warning, never failed), review.jsonl a design row and the change request body Design: <state> by <kind>",
|
|
2491
|
+
"design - the gate: while a lot's required design is missing, unapproved or stale, tdd red in its own worktree refuses (exit 2, nothing run), gate --hook's design step fails a commit of the lot's branch, from any worktree, holding a production path (after the scope step, before every other, whatever dialecte.gate.hook declares; a refused design recorded in the lot's events; a commit of tests or docs only passes; a first or merge commit and a review throwaway on <lot branch>-round-<n> skip it; a branch no lot names gives no line), lot land refuses after its rebase (nothing pushed), handover write refuses a store lot (nothing written), lot approve names design <state> among its reasons and the card's design line, read at the card's worktree, fails (handover run refuses); each reads the shared areas of the lot base its run resolved, through git, over the scope, the change's paths since that base and the staged or landed ones; a refusing path without the lot's worktree refuses; lot land records the base's shared areas again after its rebase",
|
|
2492
|
+
"land - a lot started with --on lands as a stack: its change request is based on the parent's branch, its body's depends-on part names the parent's change request (a parent without one is refused: land it first); the host's stacks are probed once: with them, the change request is linked on the parent's; without, a note says why; it is never queued (lot approve queues it); before each landing it is rebased onto the parent branch's newest tip (the local branch or origin's) when it does not hold it, from its fork point (git merge-base --fork-point: only its own commits move, whatever the parent's amend or rebase); once the parent merged (its landing state: a merge, a squash read offline, or its change request merged; never the registry's committed alone, which a hand-over run writes before anything reaches the base), the parent's landed fact is recorded and the child is rebased with git rebase --onto origin/<base> <fork point>, only its own commits moved, and its change request retargeted to the base when the host did not; when the host already rewrote its branch on origin (a native stack), it follows that rewrite (local commits beyond its last push rebased onto it, that head the lease); a conflict names its files, the rebase undone, nothing pushed, exit 2",
|
|
2493
|
+
"land - the lot lands through its change request: its committed HEAD (uncommitted files stay in the worktree, named), rebased onto origin/<base> when behind (a conflict undone and named, nothing pushed; with uncommitted tracked changes it is pushed as committed, the rebase left for a clean worktree), pushed with a lease, its title and body rendered from the lot's records through the repository's change-request template (its host's path) on the rebased head before the push (as lot describe renders them; records that do not render, or a base branch origin does not hold, push nothing), its change request opened with them as a draft or reused (edited when its title or body reads otherwise, a person's part after the kept marker kept), never queued: CI runs on every push and lot approve, a person's step, queues it; a reused change request queued or ready whose head to push no person approved (approvals.jsonl) is taken back out of the queue before the push (the host's auto-merge turned off; a draft again), since an approval is for one head: a rebase that only moves the sha takes it out too, and every landing checks, so one stopped after its push heals on the next (a refusal there pushes nothing); --draft, from when lot land queued, is refused (exit 2) naming the change; the landing (number, url, branch, pushed tip) recorded in <lot folder>/landing.json; a lot already merged (its change request merged, or its tip or its work in origin/<base>: a squash read offline) is committed: its landed fact written in <lot folder>/landed.json, its hand-over entry committed, the commits made since named (they land in a new lot), the close line printed (for a lot kept on purpose, its keep and its lot unkeep instead: no line names lot close, and the line after an opened change request asks to land it again once merged), nothing pushed; a branch with no commit beyond origin's base is refused before any push; the committed HEAD is forecast against origin/<base> just fetched (git merge-tree, before any entry, rebase or push): a conflict refuses naming its files and ranges, a forecast that cannot run refuses (fails closed), a lot on an open parent is not compared; the lot's forecast against every other open lot is recorded (trigger land) and each pair it does not clear printed (! <lot>: <why>), for information only; the pushed head is kept in landing.json at once, so a change request the host refused to open does not make the next push one outside lot land; the repository's host, which never prompts",
|
|
2494
|
+
"land - before anything is written (after the committed-entry check, before the stack rebase, the forecast and any entry), the lot's committed work (its lot base to HEAD) must lie inside its effective scope, as gate --hook's scope step holds it: a path outside refuses (exit 1) naming every such path and the lot scope <lot> --add ... --by lot-session to run, no entry, no rebase, nothing pushed, no change request; uncommitted work is not held; a lot base that cannot be read refuses",
|
|
2458
2495
|
"status - the state derived from the lot records (working, input-required, ready, committed, canceled, failed), the worktree and link checks, and the exact next command (and an also: line); a working real lot adds a station line (station <what> \xB7 round <r>/<cap> \xB7 effort <level>), the next station walked from its station events and checks (step events, else the worktree's tdd ledger and gate records), its next is that station's command and also keeps the manual line, which lot start prints as its next too; the manual line depends on the repository's landing flow: lot land <name> in a CI-first repository, handover write in any other; --json adds station and rounds (review, cap, beyondCap, independent) and effort { level, source, riskClass, below } (source risk-line for an effort recorded by lot risk; an effort below its risk class adds a ! effort <e> below risk class <c> line, ending (by <who>: <reason>) or (no go-ahead recorded)); --json adds forecast { main, pairs }: the newest main line of forecast.jsonl and, per other open lot, the newer of its own line against that lot and that lot's line against it (files only); a lot whose records do not hold reads damaged with its reason and next: lot stop (exit 6); a lot git reads merged (its tip or its work in origin/<base>, a squash included) shows committed, nothing written; --json adds kept: { reason, by, at } for a lot kept on purpose ({ unreadable: <n> } or { unreadableFile: <code> } for a keep.jsonl that cannot be trusted, read kept), else null, the text unchanged; a ready landing lot kept on purpose names no lot close in also; writes nothing; exit 2 for an unknown or ambiguous id",
|
|
2459
2496
|
"forecast - the conflict forecast of a lot's work (its worktree's HEAD plus its uncommitted work, as one snapshot commit made on a copy of its index with a fixed identity and date; the worktree's index, refs and files never written, ignored files left out) against main (origin/<base> as last fetched, never fetched here) and against every other open lot of its store, each by git merge-tree --write-tree, without a checkout: clean, conflict (each path with its kind, content with the line ranges between the markers), exclusive (every conflicted path a lock file) or unknown with its reason (git older than 2.38, a damaged lot, worktree of <lot> missing, <ref> does not resolve, snapshot of <lot> failed, merge-tree failed, forecast of <lot> over 20 s: each git step is limited to 20 seconds); each line also lists the files both sides changed (shares); a path that conflicts against main for either lot is shown once, on the main line; the verdict is the worst line (unknown > conflict > exclusive > clean); default lot: the one whose worktree holds the current folder; --against <lot> compares with main and that lot only; appends the run to the lot folder's forecast.jsonl (one line per comparison, one write, each line at most 4,096 bytes: 10 shared paths, 10 conflict paths, 3 ranges per path, the rest counted in moreShared and more) and a forecast event (its trigger: start, scope, gate, forecast or land, the verbs that record a run); a pair whose lots both change a lock file reads exclusive even when it merges clean; a gate --fast or --full run in a lot's worktree forecasts the lot as its last step and prints forecast: <verdict> with one ! <against>: <why> line per comparison it does not clear (a warning only: the gate's verdict and exit never change); the card shows a conflicts line on a conflict or an unknown, a pair seen from either lot (the newer line wins), and its scope line names each open lot it shares entries with (forecast <verdict>, <age>); --json { lot, verdict, lines }; exit 0 clean, 1 a conflict or an exclusive path (or the run could not be written), 3 unknown, 2 usage, an unknown id, a damaged, closed or simulated lot, or --against the lot itself or a lot of another store; a clean forecast does not promise a semantic merge, three lots landing together, or work not written yet",
|
|
2460
2497
|
"risk - reads the lot folder's (or hand-over folder's) risk.jsonl and the worktree's diff against the lot's base, writing nothing: the risk class derived now with its reasons (high: a changed file in the package's dialecte.risk.high list, the base's and the worktree's together, an added destructive call or git argument on a line that is not a comment alone, a runtime package (one with an exports map) whose API index changed or whose export source changed against the base without its index; light: docs, a version bump, or at most 40 changed lines in at most 3 files; medium otherwise; a declared reason reads <file>: declared [<glob>]), the effort recorded, the cap of review rounds, a ! line when the effort is below the class, ending (by <who>: <reason>) or (no go-ahead recorded); a derivation that cannot run (no commit to compare to) falls back to the last derived line, else class unknown, and ends with ! risk class not derived: <reason>, exit 0; --json the same as one object, under a versioned JSON schema (lot-risk.schema.json, version 1); exit 2 for usage, an unknown id or a damaged store lot (lot risk: <name> damaged: <reason>)",
|
|
@@ -2463,11 +2500,12 @@ var COMMAND_MAP = {
|
|
|
2463
2500
|
"answer - records the answer to an open question once (the same answer again: already); a person question needs --by <who>; a damaged lot takes none (exit 2); runs the onAnswered hooks; next: lot wait",
|
|
2464
2501
|
"result - never blocks, writes nothing: a ready or committed lot gives its hand-over (card, show and run lines), worktree, branch and answered questions; failed or canceled the last reason (exit 1); input-required the open questions (3); working exit 5; damaged exit 6",
|
|
2465
2502
|
"stop - ends the lot: refused once committed; a pending hand-over is abandoned first (refused while its run is in progress), then a canceled transition with the reason and --by (caller without it); already canceled exits 0 writing nothing; moves no worktree and deletes nothing; a damaged lot has its folder moved to <git common folder>/dialecte-lots-aside/ with a stopped.json (refused while a live run marker holds it), its index kept claimed; a damaged lot kept on purpose is refused, nothing moved, naming its lot unkeep first; a kept lot stopped stays kept (canceled and kept: its items stay)",
|
|
2466
|
-
"scope - changes a started lot's scope on the record, its brief left as published; --by and --reason are required on every call; --drop removes scope entries (an entry, or a folder and the entries inside it), --add widens the scope (a path inside a held entry is recorded as its own entry; only an equal entry answers already holds, nothing written, exit 0); --drop and --add may come in one call to narrow a folder to files: one append, the drop line first; a drop is refused for a path that is no entry or lies inside a wider one, a worktree that cannot be read, a drop leaving the lot no scope, or a file the lot
|
|
2503
|
+
"scope - changes a started lot's scope on the record, its brief left as published; --by and --reason are required on every call; --drop removes scope entries (an entry, or a folder and the entries inside it), --add widens the scope (a path inside a held entry is recorded as its own entry; only an equal entry answers already holds, nothing written, exit 0); --drop and --add may come in one call to narrow a folder to files: one append, the drop line first; a drop is refused for a path that is no entry or lies inside a wider one, a worktree that cannot be read, a drop leaving the lot no scope, or a file the lot changed in its worktree or committed since its lot base inside a dropped entry that no entry left covers (an equal entry, a literal folder holding it, or a glob matching it; the call's adds count), or a lot base that cannot be read; an add is refused when a path is no valid scope entry, or when it meets another open lot's scope and that lot still holds it: the lot's work is forecast against it (trigger scope, recorded only once the add stands) and a clean pair adds with no overlap record; a forecast conflict (its files and ranges), a met lock file, a forecast that cannot run, or a damaged or unreadable lot refuse, unless --overlap-ok accepts an overlap that names its paths (a damaged lot whose scope reads too, its damage recorded) (recorded in overlaps.jsonl before the add with the other lot, the met pairs, --by and --reason, undone with a taken-back add; a lot whose scope cannot be read stays refused; --overlap-ok without --add is refused); a call whose lines would pass the line limit is refused; an add a lot started or widened meanwhile meets is taken back by an undo line, the entries a drop of the same call removed put back (exit 2), a take-back that would pass the line limit refusing the call first (exit 2), a take-back that cannot be written exiting 1 naming the paths and that lot; each change is one line of scope-changes.jsonl ({ schema, at, op, paths, by?, reason? }) and a scope.changed event; the effective scope (the brief's with the changes) is what the overlap guard, lot status and the card read; a damaged, simulated, committed, canceled or failed lot, a forbidden word and a change line that does not read are refused (exit 2), nothing written; a line that cannot be written exits 1",
|
|
2467
2504
|
"keep - keeps a lot's items on purpose (its worktree, review throwaways and branches stay after it is committed or canceled): appends { schema, at, op: keep, by, reason } to the lot folder's keep.jsonl and a keep.changed event, in any state, damaged included; --by and --reason required, one line each, the reason at most 200 characters, orchestrator in any casing recorded orchestrator; a forbidden word, a path, a link, a reference or a plan entry id refused (exit 2, nothing written); the reason it is kept with already answers kept already, nothing written (another reason appends: the history stays); a keep.jsonl with a line that does not read, or that cannot be read, is refused naming it (repair it by hand); an event that cannot be written is one printed line, never an exit; prints <name> kept by decision: <why>; --json { lot, kept, written, next }; a keep never changes the lot's state, its scope's hold or any guard",
|
|
2468
2505
|
"unkeep - releases a kept lot: appends { schema, at, op: unkeep, by, reason } and a keep.changed event, under the rules of keep; refused (exit 2, nothing written) from the lot's own worktree or one of its review throwaways (-round-<n>, -verify): a lot's own session cannot release what a person kept; a lot not kept answers not kept, nothing written; prints <name> no longer kept and, for a committed or canceled lot whose worktree or branch is left, next: lot prune <name>",
|
|
2469
2506
|
"station - appends one station event (by: host) to the lot's events.jsonl, never rewriting a line: start answers its run and the end command; end pairs with --run, else with the one open start of its station, step, round and attempt (several: refused), else repeats the last such end carrying a cost field with the same fields (already, nothing written), else is recorded alone (started: null); --event <id> again answers the first event (already) or is refused when its fields differ; start is refused on a committed, canceled or failed lot, end is accepted in every state; a simulated lot writes simulated: true; text fields refuse control, line-break and direction characters, vendor, model, tier, effort and session at most 80 characters, step, round and attempt 1-999, tokens, runs and duration non-negative, at most 50 skills (hash: sha256 of the path or of the synced <folder>/<name>/SKILL.md, else null), a verdict of approve, back, fix-then-repass, fixed, disagreed, answered, failed, limit; a line over 4,096 bytes is refused; --from takes the same fields plus phase (start|end) as one JSON object, unknown keys refused, every fault at once; --json { recorded: new|already, run, next }",
|
|
2470
2507
|
"--by - one line, not empty, checked before the lot is read (answer and stop)",
|
|
2508
|
+
"--by orchestrator - refused (exit 2, nothing run) for every verb that signs, run from a lot's workplace (its own worktree, a -round-<n> or -verify throwaway beside it), whichever --by of the line names it, in any casing and spacing: a lot signs --by lot-session; the orchestrator signs from the main checkout",
|
|
2471
2509
|
"<id> - an index (171 = 0171), a full name, a lot folder or .dialecte/lot; a write verb needs an index unique across every store of the store list, a word naming an existing folder is that folder",
|
|
2472
2510
|
"exempt|accept|revised|gone|moved|mutation - write .dialecte/lot.json at the package root (tab JSON), keeping the rest",
|
|
2473
2511
|
"moved - a case of the lot moved by a split or a rename of its file or describe after its red (its own title is part of its test call): two cases, or a file (never a glob) and the file or glob its cases moved to under the same names, several files into one each with its entry; tdd red carries the red (flag moved) when the test call and the test code it reads are as that red froze them and it does not pass on the base production, else refuses",
|
|
@@ -2477,18 +2515,18 @@ var COMMAND_MAP = {
|
|
|
2477
2515
|
"mutation - absent: changed when the diff touches the declared scope, off otherwise; gate = changed that the hand-over waits for",
|
|
2478
2516
|
"finding - appends R<n>-<k> open to <folder>/findings-ledger.md (made when absent)",
|
|
2479
2517
|
"decide - rewrites that finding's state cell, every other byte kept",
|
|
2480
|
-
"snapshot - copies what git status lists to round-<n>/, the deletions to round-<n>.deleted, HEAD to round-<n>.base, { schema, at, stateHash } to round-<n>.state; the folder is a lot folder or stays outside every repository; -- ends the options; the risk class is derived again from the diff first and appended to risk.jsonl as a derived line only when the snapshot goes ahead, a refused snapshot writing nothing (a derivation that cannot run prints ! risk class not derived: <reason> and appends nothing); the cap of review rounds is the rounds of the higher of the effort's class and the class derived now (else the last derived line's) (low or light 1, medium 2, high 3; the effort is the last line of lot risk --effort, else the lot's; a class above the effort prints ! risk class now <class> (<reason>): cap <cap>); with no effort recorded the cap is 1 and a later round is refused (exit 2) naming dialecte lot risk <folder> --effort low|medium|high --by <who>; a round above the cap of an effort is refused (exit 2), naming what set the cap ((effort <e>), or (effort <e>, risk class <c>) when a class raised it), unless --beyond-cap --by <who> --reason <text> gives the go-ahead, written to decisions.md as round <n> beyond the cap of <cap>: <reason> before the snapshot (once: a retry finds it); --beyond-cap within the cap, --by or --reason without it, and --by or --reason holding a forbidden word are refused (exit 2), nothing written",
|
|
2518
|
+
"snapshot - from anywhere, copies what git status lists in the lot's own worktree (a plain hand-over folder: the work tree it runs in; a lot with no worktree, or whose worktree is no work tree, refused naming it, nothing written) to round-<n>/, the deletions to round-<n>.deleted, HEAD to round-<n>.base, { schema, at, stateHash } to round-<n>.state; the folder is a lot folder or stays outside every repository; -- ends the options; the risk class is derived again from the diff first and appended to risk.jsonl as a derived line only when the snapshot goes ahead, a refused snapshot writing nothing (a derivation that cannot run prints ! risk class not derived: <reason> and appends nothing); the cap of review rounds is the rounds of the higher of the effort's class and the class derived now (else the last derived line's) (low or light 1, medium 2, high 3; the effort is the last line of lot risk --effort, else the lot's; a class above the effort prints ! risk class now <class> (<reason>): cap <cap>); with no effort recorded the cap is 1 and a later round is refused (exit 2) naming dialecte lot risk <folder> --effort low|medium|high --by <who>; a round above the cap of an effort is refused (exit 2), naming what set the cap ((effort <e>), or (effort <e>, risk class <c>) when a class raised it), unless --beyond-cap --by <who> --reason <text> gives the go-ahead, written to decisions.md as round <n> beyond the cap of <cap>: <reason> before the snapshot (once: a retry finds it); --beyond-cap within the cap, --by or --reason without it, and --by or --reason holding a forbidden word are refused (exit 2), nothing written",
|
|
2481
2519
|
"choice - appends | decision | who | yyyy-mm-dd | to <folder>/decisions.md (made when absent)",
|
|
2482
2520
|
"standard - writes <folder>/standard.json (state, note, time), read by the card's standard line; outside (the lot's asks answered outside the documents, written by ask itself) warns, and fails at effort high unless the record's confirmed flag is true (written by ask once a person confirmed every outside answer; by hand false): the flag decides, never the note text",
|
|
2483
|
-
"delta - per file, the diff from round-<n-1>/ to the worktree now; --worktree adds a throwaway worktree holding round n-1 and prints its removal command; for a lot kept on purpose it prints kept by decision: <why> (by <who>, <date>): the throwaway stays with the lot instead, and --json carries kept and no removal",
|
|
2484
|
-
"recap - the <details> part of a
|
|
2485
|
-
"verify -
|
|
2521
|
+
"delta - per file, the diff from round-<n-1>/ to the lot's own worktree now, from anywhere (a plain hand-over folder: the work tree it runs in); --worktree adds a throwaway worktree holding round n-1 and prints its removal command; for a lot kept on purpose it prints kept by decision: <why> (by <who>, <date>): the throwaway stays with the lot instead, and --json carries kept and no removal",
|
|
2522
|
+
"recap - the <details> part of a change request from the hand-over's records only; writes nothing",
|
|
2523
|
+
"verify - from anywhere (the main checkout included): appends { schema, at, by, note, state } to <folder>/verify.jsonl in one write, state the state hash of the lot's own worktree (a plain hand-over folder: the work tree it runs in); a lot with no worktree (a simulated lot) or whose worktree is no work tree is refused naming it, nothing written; a change of the tree after the last round-<n>/ snapshot is a late fix: the card warns and handover run refuses it (exit 2) until a verify covers the current state (one later change needs a new verify); a snapshot with no round-<n>.state (an older cli) is not checked; no snapshot yet (nothing is late), --by or --note missing, blank or not one line, or holding a forbidden word are refused (exit 2), nothing written",
|
|
2486
2524
|
"report - reads files only (no git, no process, nothing written): the lot's stations, tokens, money, time, suites per station by time, heavy steps, folders and review rounds from its events.jsonl, transitions, ledger and cards.log; a number nobody reported is unknown, never 0, and a step family whose runs may be unrecorded reads unknown with the reason; --feature lists every lot of that feature in every store (simulated ones counted apart, listed by --simulated; a lot whose folder is gone is read from its cards.log line), a kept lot marked kept; next: the lot's own next command, for a committed or canceled lot kept on purpose whose worktree or branch is left lot unkeep (prune would keep everything); a kept lot adds a kept line and kept in --json",
|
|
2487
2525
|
"report --kept - every lot kept on purpose of every store of the list and of the folder it runs from, real, simulated and damaged, each read once and filtered on its keep first: <name> <state> kept since <date> by <who>: <why> \xB7 worktree present|gone|unknown \xB7 branch present|gone|unknown, sorted by name, then <n> kept lot(s) (no kept lot: exit 0); next lot unkeep; --json { lots: [{ lot, state, kept, worktree, branch, next }] }; an id, --feature or --simulated beside it exits 2",
|
|
2488
2526
|
"export - copies a lot folder to <dir>/<full name>/ without asks/ (links kept as links, those pointing outside it named), adding the lot's cards.log lines and registry entry; refused for a <dir> inside a git work tree and for an existing <dir>/<full name>; every copied file compared by size and sha256 (events.jsonl as a prefix) before the rename, one more copy on a difference; the source is never written",
|
|
2489
|
-
"prune - removes what a committed or canceled lot leaves behind, each item on its own proof: the lots named by id, else the lots of --feature in every store of the list, else every lot of every store (--all), else every lot of the store of the folder it runs from; base branches fetched first; per lot its line (state, landing) and one line per item - its worktree (the same proof as lot close: kept with why), its review throwaways (recorded by a step's throwaway-add, or cut by hand at a commit of the lot with no commit of their own: they go when every changed path is held by a commit, else kept naming the path held nowhere), its branch and its throwaways' branches; a lot kept on purpose (lot start --keep, lot keep) keeps every item, reason kept by decision: <why> (by <who>, <date>), before any proof, damaged or not; an open lot's items are kept, reason lot <name> <state>; a branch is kept while it is the base, the branch the main checkout is on, an open lot's branch, the stack parent of an open lot, a pending hand-over's or a stash's, while deleting it would lose a commit (a canceled lot's names its commits and the command to delete it anyway), and goes after its worktree when one checks it out; a lot whose worktree is gone and whose landing is not proven is listed stale with the command to stop it; without --yes the plan only; --yes acts in order (worktrees, throwaways, branches), each proof read again at the move, the lot's keep first (a keep, a damage or a folder gone since the plan keeps the item): a throwaway proved again after its move, a branch deleted at its proved tip only (git update-ref -d), a branch still parked in the trash listed waiting for the trash; a throwaway's --force removal starts only after its second proof, so a file written into it in that moment goes with it; a deleted branch is restorable with git branch <branch> <tip> (its removing line in cards.log holds the tip) until git's garbage collection, its upstream config is not restored; worktrees git refused to delete from the trash for more than ten minutes are listed with their git status and the forced removal, a throwaway its second proof left in the trash with why and the command that moves it back; a git read an item's decision rests on that fails keeps the item (could not read <what>: <git's error>), never reads as empty; ids, --feature and --all exclude each other; exit 1 when an item meant to go was kept (one another run removed since the plan is no failure), 2 for a usage error or an id that names no lot or more than one",
|
|
2490
|
-
"close - closes a lot or a hand-over: a hand-over of the registry (by name or index), or a lot (its id, name or index), with no registry entry needed; first the landing of every lot the arguments reach (the lot named, the lot an entry registers, the open lots naming an entry's worktree and branch) is read, with the host asked for every lot it reads (one never pushed by lot land, its branch deleted on origin after the merge, included): merged (its tip on the base, its
|
|
2491
|
-
"close - --feature <name> closes a feature at a pipeline's last step: its lots in every store of the list (simulated ones left out); none answers no lot of the feature, exit 1; a lot of it neither committed nor canceled refuses the whole close, listing each with its state, exit 2, nothing moved; else lot prune's plan without branches, acted at once (removing lines by lot-close): every lot worktree and recorded review throwaway of the feature closed on its own proof, branches untouched and not listed (lot prune removes them); then the rehearsal clones of the machine's scratch roots whose marker names a hand-over folder of a lot of the feature (its lot folder, or the folder of a committed or abandoned entry naming
|
|
2527
|
+
"prune - removes what a committed or canceled lot leaves behind, each item on its own proof: the lots named by id, else the lots of --feature in every store of the list, else every lot of every store (--all), else every lot of the store of the folder it runs from; base branches fetched first; per lot its line (state, landing) and one line per item - its worktree (the same proof as lot close: kept with why), its review throwaways (recorded by a step's throwaway-add, or cut by hand at a commit of the lot with no commit of their own and held by no store lot - its own worktree or branch, or the lot its root .dialecte/lot link names, a lot whose identity does not read included: they go when every changed path is held by a commit, else kept naming the path held nowhere), its branch and its throwaways' branches; a lot kept on purpose (lot start --keep, lot keep) keeps every item, reason kept by decision: <why> (by <who>, <date>), before any proof, damaged or not; an open lot's items are kept, reason lot <name> <state>; a branch is kept while it is the base, the branch the main checkout is on, an open or damaged lot's branch (a lot whose identity does not read holds the branch its registry entry names), the stack parent of an open or damaged lot (its stack.json read without its identity), a pending hand-over's or a stash's, while deleting it would lose a commit (a canceled lot's names its commits and the command to delete it anyway), and goes after its worktree when one checks it out; a lot whose worktree is gone and whose landing is not proven is listed stale with the command to stop it; without --yes the plan only; --yes acts in order (worktrees, throwaways, branches), each proof read again at the move, the lot's keep first (a keep, a damage or a folder gone since the plan keeps the item): a throwaway proved again after its move, a branch deleted at its proved tip only (git update-ref -d), a branch still parked in the trash listed waiting for the trash; a throwaway's --force removal starts only after its second proof, so a file written into it in that moment goes with it; a deleted branch is restorable with git branch <branch> <tip> (its removing line in cards.log holds the tip) until git's garbage collection, its upstream config is not restored; worktrees git refused to delete from the trash for more than ten minutes are listed with their git status and the forced removal, a throwaway its second proof left in the trash with why and the command that moves it back; a git read an item's decision rests on that fails keeps the item (could not read <what>: <git's error>), never reads as empty; ids, --feature and --all exclude each other; exit 1 when an item meant to go was kept (one another run removed since the plan is no failure), 2 for a usage error or an id that names no lot or more than one",
|
|
2528
|
+
"close - closes a lot or a hand-over: a hand-over of the registry (by name or index), or a lot (its id, name or index), with no registry entry needed; first the landing of every lot the arguments reach (the lot named, the lot an entry registers, the open lots naming an entry's worktree and branch) is read, with the host asked for every lot it reads (one never pushed by lot land, its branch deleted on origin after the merge, included): merged (its tip on the base, its change request merged - the one landing.json names, else the newest of its branch whose head the branch reached, a change request opened by hand included - or its work contained in origin/<base>, a squash read offline) writes its landed fact in <lot folder>/landed.json, commits its pending entry (a lot with none is closed as the lot itself: no registry entry is made) and every outcome reaching it carries the line landed on <base> at <commit>: <how>, landed in --json; a lot kept on purpose keeps its worktree, reason kept by decision: <why> (by <who>, <date>); a lot named by its id that is open is kept with lot <name> <state>: why (its work not in the base, its change request closed, the commits it holds since part of it landed, or the host's silence); a lot whose branch and worktree are gone reads its landing from the latest card line of its own or of a hand-over on its branch whose entry names its worktree, written since the lot was made; a canceled lot closes, its landing never read; then for each committed or abandoned hand-over, and each committed or canceled lot named by its id: its final record first, the card line in the repository's cards.log (a catch-up one when none exists, for every hand-over of the worktree, read back), then a removing line, then its worktree moved to .worktrees/_trash/ and removed in the background by git worktree remove without --force (git refuses one written into since the check: it stays in .worktrees/_trash/), its node_modules parked in .worktrees/_pool-<repository>-<n>, its caches to their own _trash/ entries, then a removed line (trashed or kept); a commit dropped from its branch (reset or rebased away), held by the branch reflog alone, is named under the closed line: git expires it with that reflog (gc.reflogExpireUnreachable), as it would have with the worktree's; a landed or canceled lot's own lot files (its root .dialecte/lot link naming the lot's folder): the root's .dialecte/lot.json and each package's (the folder of a package.json git tracks, or one the lot deleted), archived in that folder first (lot prune and lot close --feature archive the same way), the root's as lot.json and a package's as lots/<package path>/lot.json, or lot.landed.json beside a lot.json holding other bytes, never over one and read back, kept naming both archives when both hold other bytes; every lot file it counted read again right before the move, one rewritten since keeping the worktree, nothing archived; a lot file is removable only when empty or byte-equal to an archive of its own package path; kept first when a lot holds it: an open, damaged or kept on purpose lot naming it, or the lot its root .dialecte/lot link names (a lot whose identity does not read included, reason lot <name> damaged; a lot folder present in the store but not read, lot <name>: its records do not read; a lot folder gone or moved aside holds nothing), the holding lot first (reason lot <name> <state>, or its kept text), then with why when it is the main checkout, on another branch than the hand-over's, locked, another hand-over of the same worktree is neither committed nor abandoned, a link from outside it points into it, dirty, a landed lot holds commits made since its landing (<n> commit(s) made since its landing: <commits>), its removal would lose a commit (<n> commit(s) its removal would lose: <commits>: a commit only its HEAD or HEAD reflog reaches, that no surviving branch, branch reflog, tag, landed tip or remote-tracking ref holds, nor the same change at the same place (a commit of theirs with the same diff, its hunk line numbers included) - a commit made on a detached HEAD), it holds ignored files its removal would delete that nothing else holds (rebuilt folders, dialecte.rebuiltIgnored folders, the .dialecte/lot link, an empty or archived .dialecte/lot.json and copies byte-equal to the main checkout's go), a process or a mutation run works there, lot close itself runs from inside it, or the processes are not known, or the final record cannot be kept or the lot's commit is not known; the branch never touched; a hand-over already closed, or a lot whose worktree a recorded removal moved, answers already closed, exit 0, nothing moved (a lot whose worktree is gone with no such removal: nothing to close), its lot's landed fact still recorded when the host proves the merge (its landed line beside already closed); exit 1 when one is kept, 2 when a name or index is neither a hand-over nor a lot (the others are still closed)",
|
|
2529
|
+
"close - --feature <name> closes a feature at a pipeline's last step: its lots in every store of the list (simulated ones left out); none answers no lot of the feature, exit 1; a lot of it neither committed nor canceled refuses the whole close, listing each with its state, exit 2, nothing moved; else lot prune's plan without branches, acted at once (removing lines by lot-close): every lot worktree and recorded review throwaway of the feature closed on its own proof, branches untouched and not listed (lot prune removes them); then the rehearsal clones of the machine's scratch roots whose marker names a hand-over folder of a lot of the feature (its lot folder, or the folder of a committed or abandoned entry naming exactly one lot's worktree and branch; two such lots keep it: owner not single: <lots>): a dead one (its pid gone, or running with another start time) that no process works in and no link reaches (links read in this workspace and every workspace of the feature's lots; the processes read first, then the lots and the links, again before the moves, the planned lot's keep read on its folder) moved to the workspace's .worktrees/_trash for its own .worktrees/_scratch, else its scratch root's dialecte-trash, with removing and removed lines (item clone); one alive, whose marker cannot tell (no marker, no pid, no start time, an unreadable one), a process works in, or the processes or links cannot be read, kept and named for dialecte worktree prune; a kept lot keeps every item, clones included, with its kept text, and a lot damaged by the time its clones are read keeps them at the plan with its damaged text; a clone of another hand-over is listed, never moved; --json { open, lots: [{ lot, state, landing, items: [{ item: worktree|throwaway|clone, name, decision, outcome }] }], clones: [{ clone, kept }] }; a lot name beside --feature is a usage error (exit 2); exit 0 when every item of the feature went, 1 when one was kept"
|
|
2492
2530
|
],
|
|
2493
2531
|
exitCodes: [
|
|
2494
2532
|
"1 risk --effort: the line could not be written",
|
|
@@ -2505,7 +2543,8 @@ var COMMAND_MAP = {
|
|
|
2505
2543
|
"3 wait, result: input-required",
|
|
2506
2544
|
"4 wait: an agent failed or hit a limit, run again",
|
|
2507
2545
|
"5 wait --timeout, result: still working",
|
|
2508
|
-
"6 status, wait, result: the lot is damaged: a person must look"
|
|
2546
|
+
"6 status, wait, result: the lot is damaged: a person must look",
|
|
2547
|
+
"2 every verb: the cli is older than the version a repository the invocation reaches asks for (the cli floor); nothing done"
|
|
2509
2548
|
],
|
|
2510
2549
|
example: 'dialecte lot finding ../handover --round 1 --severity nit --at src/a.ts:3 "a finding"'
|
|
2511
2550
|
},
|
|
@@ -2575,7 +2614,7 @@ var COMMAND_MAP = {
|
|
|
2575
2614
|
"the default lists end with a scoped rules step (dialecte rules); a step whose run starts with the word dialecte runs as the gate's own cli (its node and entry file, never node_modules/.bin), its line ending (dialecte <version>); a missing dialecte bin fails that step, never the gate",
|
|
2576
2615
|
"a green record of the same tree, install and steps answers the steps after a fresh tdd step; --no-reuse runs them",
|
|
2577
2616
|
"--full and --release hold the machine awake while they run (macOS: caffeinate -i -w <pid>; DIALECTE_KEEP_AWAKE=0 turns it off); a run that spanned a sleep keeps sleptMs on its record and the card says it",
|
|
2578
|
-
|
|
2617
|
+
`--hook - in a commit hook, no test suite (CI runs it on every push): on a commit of a lot's branch, from any worktree, the scope step comes first, whatever dialecte.gate.hook declares: the lot's whole work up to the commit (its lot base against the index tree being committed, both sides of a rename, deletions included) must lie inside its effective scope (the brief's with lot scope's changes; .dialecte/ records left out), else the commit fails naming every path outside and the lot scope <lot> --add ... --by lot-session to run (a path holding a glob character gets no add), no other step run, the failed part in the lot's events; a review throwaway, a committed, canceled, failed or simulated lot, a first commit and a merge in progress skip it; a damaged lot or a lot base that cannot be read fails it; with no base branch it holds the staged change (held against HEAD: no base branch); a branch no lot names gives no line; then the design step; with "dialecte.gate.hook" declared, the tdd receipts of the lot first (every new or changed case since the lot base proven red then green, unchanged, accepted or revised, each closed case proven passing at the production as committed: its last run at its test file now passed it there, else listed stale (proven at another production) or refused (its last run refused it), both naming a tdd green run (measured from the lot base), or unproven (no proof receipt: a case moved into a file a red ran before the move) naming a tdd red run; a case skipped as written is never listed; a test file moved with its bytes lists its cases too; a first or merge commit skips it), then the declared steps (the cli: check, then rules on the touched files); without one, every step of --full, a scoped one against the hook base; each step answered by a green record (any mode) of the committed tree and install that ran it as it is now, else run; the running line names the steps it runs`,
|
|
2579
2618
|
'--release - alone: "dialecte.gate.release" (default: the --full steps), every scoped step against the empty tree (--base feeds only the tdd step); records dialecte-gate-release.json; each of its steps answers a hook step of the same step hash (a scoped one at any base: it checked everything); its green record answers a rehearsal, contrib and the card when the list covers full (same name, run, counts and changedOnly for every full step)',
|
|
2580
2619
|
`scoped steps ("scoped": true) get DIALECTE_GATE_BASE, _TREE, _CHANGED (the changed paths byte for byte, NUL-separated, relative to the repository top as git diff --name-only names them; a declared failing path is relative to the package root) and _SELECTION, where they write { schema: 1, base, tree, changed, selected: [{ id, reasons }], skipped: [{ id, reason }] } (both lists required, reasons non-empty); the base is --base <ref>, else the merge-base with the base branch (the first found: "dialecte.baseBranch", origin/HEAD, main, master; each local, else on origin), else the empty tree; a local base branch holding commits origin's lacks: a note naming the count, the base read from origin's; select from the working files; without the gate (no DIALECTE_GATE_SELECTION): select everything`,
|
|
2581
2620
|
'a step whose run is npm run <script> the package lacks is not wired: a default step fails a --full or --release run (a --fast one says it and goes on), a declared step fails in every mode; then no step runs, the others read not run: a step of the list is not wired; "dialecte": { "gate": { "skip": { "<default step>": "<reason>" } } } (dialecte.gate.skip) opts a default step out, a warning with its reason',
|
|
@@ -2596,11 +2635,11 @@ var COMMAND_MAP = {
|
|
|
2596
2635
|
],
|
|
2597
2636
|
notes: [
|
|
2598
2637
|
"red - every case of the changed test files must fail on an assertion (or a stub's 'not implemented' inside an asserting expect); a passing new case, a missing export, a type or syntax error, a timeout, a .only is refused; the files without a refusal are frozen",
|
|
2599
|
-
"green - each case with a red receipt, its test code as frozen, production changed since its red,
|
|
2638
|
+
"green - runs every case of the changed test files and of the test files moved with their bytes; each case it runs must pass whatever its proof, else refused (a refused receipt, exit 1); a case with a red receipt, its test code as frozen, production changed since its red, records a green receipt; a case proven without a red (unchanged, accepted, revised, the base's case of a moved file) records its proof again when its last run is not at this production and its test file now; a case proven without a red that the run did not run (a moved file's skipIf skipped only at this run, a node:test todo reported pending) passes and is recorded again the same way, its line ending skipped at this run; a case skipped as written is not judged",
|
|
2600
2639
|
"status - per case red, green, unchanged, missing receipt, test edited after red, flags",
|
|
2601
2640
|
"base - the change is measured from the lot base: HEAD's fork point from the base branch (the newer of the local branch and origin's), or from an open stack parent's line; HEAD only when no base branch is found; a green taken before a rebase still counts after it",
|
|
2602
2641
|
"--base - measure from where HEAD left the ref given instead of the lot base",
|
|
2603
|
-
"declarations - a gone or moved entry of the lot file naming a path the change leaves unchanged, or one known nowhere (not at the base, not now, not in the receipts), is refused before any run, naming its lot gone --remove or lot moved --remove; a test file deleted on disk is a deleted file, never read",
|
|
2642
|
+
"declarations - a gone or moved entry of the lot file naming a path the change leaves unchanged, or one known nowhere (not at the base, not now, not in the receipts), is refused before any run, naming its lot gone --remove or lot moved --remove; a test file deleted on disk is a deleted file, never read; a test file git reports renamed is read at the base at its old path (its untouched cases unchanged), a moved entry may name that old path, a gone entry naming it is refused (a case removed in the rename is gone at the new path), and a file-level moved entry on a pair tdd matches itself is listed not needed, never unused",
|
|
2604
2643
|
"--legend - the tdd terms of the hand-over card"
|
|
2605
2644
|
],
|
|
2606
2645
|
exitCodes: [],
|
|
@@ -2616,7 +2655,7 @@ var COMMAND_MAP = {
|
|
|
2616
2655
|
"without files: the changed list a scoped gate step hands (DIALECTE_GATE_CHANGED), else the files changed against HEAD and the new ones; a file it cannot read or parse is an error",
|
|
2617
2656
|
"quality rules: argument-mutation, query-in-loop, long-function on implementation files; table-branch, without-export-xml, export-without-queries, fixture-builder, plan-tag on test-shaped files; on test-shaped Dialecte changes: xml-splice, xml-replace, transaction-spy, act-repeats-call, act-snapshot, act-format-check, inline-document-long, expected-fixture, fixture-case-comment (warning), test-file-long, fixture-file-long, fixtures-module, fixture-builder an error; in an app only Dialecte-change script files are judged, the others counted in one line (a contributor package is never an app); with the gate base, an error on a line the change did not add is a warning; without a gate base, or with an empty-tree one (as gate --release hands), the order every caller shares: in the worktree of a store lot its lot base read from git (its fork point from the base branch, or from the line of the lot it was started on while that lot is open; never the base recorded at its start, which a rebase leaves behind; with no base branch found, the newest of the commit it recorded at its start, when HEAD holds it, and a release tag descending from that commit, else no base), else the merge-base with the base branch (skipped, for an empty-tree base and for a run without a gate base, when it is the commit of HEAD), else the last release tag <name>@v<version>, else no base and every error kept; a lot base that cannot be read (its stack parent unreadable) is no base, never the merge-base, said in a rules: no base (<why>) line by every run that reads the order: without a gate base, with an empty-tree one, and on the contrib rules row; a run without a gate base prints one line naming it (rules: base <sha> (the lot <name> | the merge-base with <branch> | the merge-base with the base branch | the release tag <tag>), or rules: no base (<why>) when the lot base cannot be read)",
|
|
2618
2657
|
"changelog-edit (an error), in a package keeping a changes/ folder: CHANGELOG.md edited without the package version bumped; write the entry in changes/<lot>.md (dialecte changelog)",
|
|
2619
|
-
"released-changelog (an error, no opt-out), on CHANGELOG.md in every package: a released ## [<version>] section the change altered - lines added, removed or reordered, the section removed, or its heading repeated - judged against the base branch and where the change left it (a section main corrected after the branch point, or a release the branch predates, is no finding); the release base a rehearsal hands its hooks (DIALECTE_RELEASE_BASE, to the scoped rules step alone) replaces the base branch; no base branch: one line, not judged (--json: releasedChangelogNotJudged)",
|
|
2658
|
+
"released-changelog (an error, no opt-out), on CHANGELOG.md in every package: a released ## [<version>] section the change altered - lines added, removed or reordered (a run of blank and link reference definition lines holding a definition compares as one blank line: a definition renders nothing), the section removed, or its heading repeated - judged against the base branch and where the change left it (a section main corrected after the branch point, or a release the branch predates, is no finding); the release base a rehearsal hands its hooks (DIALECTE_RELEASE_BASE, to the scoped rules step alone) replaces the base branch; no base branch: one line, not judged (--json: releasedChangelogNotJudged)",
|
|
2620
2659
|
"--base <ref>: the files changed from the merge-base of <ref> and HEAD to the worktree are judged (deletions left out; uncommitted ones in), that merge-base the base of the softening as a gate base would be; files given with it, or a ref naming no commit, exit 2",
|
|
2621
2660
|
"base-aware rules (warnings, against the base the run judges the change from: --base, else the lot base, else, in a run that is no scoped gate step, the base branch merge-base; never a release tag, an empty tree nor the gate base): duplicate-read, an added function reading the same element and three or more attributes as an existing one (a named set counts three), or whose name shares two words with an existing function it does not call (generic words such as read, list, file, path or name left out); shared-export-changed, an export imported by a file of another folder (a sub-folder included) newly shared, re-signed (its parameters, return type, or a sibling .types.ts type they name), its body changed, or removed; docs-not-updated, in a contributor library (no bin), a public api.json entry added, re-signed or removed whose doc page (doc/ Markdown or README naming its last two route segments, or its whole route in a code span) the change did not touch; one line names where they stand: quality: since <short> (lot | base-branch | flag), quality: not run (no lot) in a scoped gate step outside any lot, no line when there is no base or no package.json; notes under it: public API: <route> removed: still named by <pages>, ! public API unknown (<why>), aliases changed, when a tsconfig or Vite config changed (the base edges read with the aliases of the tree); a run that judged the whole change writes dialecte-quality.json in the worktree git folder; contrib never runs them",
|
|
2622
2661
|
"--json: dialecteChanges (the verdict of each file), notJudged, baseLine, qualityLine, quality (the base, the examined files, duplicates, sharedExports, publicApi, docs); described by rules.schema.json (schema 1)",
|
|
@@ -2649,8 +2688,8 @@ var COMMAND_MAP = {
|
|
|
2649
2688
|
],
|
|
2650
2689
|
notes: [
|
|
2651
2690
|
"a fragment: one changes/<name>.md per lot (a no-entry note changes/<name>.none.md holds why a visible change has none), its entries under the changelog headings ### Added, Changed, Deprecated, Removed, Fixed, Security; a package keeping a changes/ folder edits CHANGELOG.md only in a release (rules: changelog-edit)",
|
|
2652
|
-
"check - every fragment readable (a known heading, no loose text, no empty or repeated section), the Unreleased part of CHANGELOG.md, then its released sections: none altered against the base branch and where the change left it (rules: released-changelog); --base <revision> judges against that commit alone, the one the change goes onto (the CI check step hands the merge queue's base, or a
|
|
2653
|
-
"release - writes ## [<x.y.z>] - <date> (default today, local) under an emptied ## [Unreleased] (written above the first version when missing): the Unreleased summary and entries first, then each fragment in file name order, section by section,
|
|
2691
|
+
"check - every fragment readable (a known heading, no loose text, no empty or repeated section, no HTML comment, code fence or HTML block that never closes, and in each block or item a release moves no raw HTML but whole comments and balanced bare tags of an inert element, nor a block that moving the breaking items first would read otherwise; read as CommonMark reads it), the Unreleased part of CHANGELOG.md, then its released sections: none altered against the base branch and where the change left it (rules: released-changelog); --base <revision> judges against that commit alone, the one the change goes onto (the CI check step hands the merge queue's base, or a `pull_request` merge ref's first parent)",
|
|
2692
|
+
"release - writes ## [<x.y.z>] - <date> (default today, local) under an emptied ## [Unreleased] (written above the first version when missing): the Unreleased summary and entries first, then each fragment in file name order, section by section, each section's breaking items (a bullet opening with **Breaking, Breaking: or Breaking (types):) first, the blocks read as CommonMark reads them (each item of a - list a block, any other block whole and never reordered) and joined as oxfmt leaves them (a blank line after an item holding a second block and around any other block); deletes the fragments and the no-entry notes; nothing written when a fragment or the Unreleased part cannot be read"
|
|
2654
2693
|
],
|
|
2655
2694
|
exitCodes: [
|
|
2656
2695
|
"1 a fragment or the Unreleased part cannot be read, a released section is altered (check), the release is refused (no CHANGELOG.md, version already there, nothing to release), or a fragment could not be deleted",
|
|
@@ -2664,9 +2703,9 @@ var COMMAND_MAP = {
|
|
|
2664
2703
|
usage: ["dialecte ci sync [--dry-run]", "dialecte ci check", "dialecte ci publish-decision"],
|
|
2665
2704
|
notes: [
|
|
2666
2705
|
"the template: the workflows (ci.yml, publish.yml and their reusables), .github/pull_request_template.md, .nvmrc and changes/.gitkeep; ci.yml selects its jobs from package.json: type-perf with a type-bench:check script (its bench step handed the base the change goes onto in DIALECTE_CHANGE_BASE: the base sha of the merge queue, else HEAD^1, skipped on a dispatch), docs with a doc:build script, the Playwright install with a playwright dependency, the npm run skills:check step of the check job with a skills:check script; the check job always runs rules --base of the cli over the change (the base sha of the merge queue, else HEAD^1, skipped on a dispatch), where --no-verify cannot skip it; a build script is required (publish.yml builds the package)",
|
|
2667
|
-
"the repository owns .github/workflows/_test.yml (ci.yml calls it: a workflow_call trigger; a mode input of type string gets pr on a
|
|
2706
|
+
"the repository owns .github/workflows/_test.yml (ci.yml calls it: a workflow_call trigger; a mode input of type string gets pr on a `pull_request` run, full in the merge queue) and every other workflow file the template does not name; they are listed, never written",
|
|
2668
2707
|
"sync - writes what differs from the template, deletes the retired files (pr.yml, _lint.yml) and the reusables no job of the package calls; an update prints its diff; a second run is in step; --dry-run writes nothing",
|
|
2669
|
-
"check - the same comparison, read-only: each drifted file with its diff, then the fix; the template's _check.yml runs it on every
|
|
2708
|
+
"check - the same comparison, read-only: each drifted file with its diff, then the fix; the template's _check.yml runs it on every `pull_request` run",
|
|
2670
2709
|
"publish-decision - the publish guard of the push to main (BEFORE, GITHUB_OUTPUT): publish above npm's latest, a pre-release under next, a missing release tag pushed alone, a failed npm query refused",
|
|
2671
2710
|
"publish.yml keeps its name and its push trigger: npm trusted publishing names the file"
|
|
2672
2711
|
],
|
|
@@ -2737,12 +2776,15 @@ var COMMAND_MAP = {
|
|
|
2737
2776
|
],
|
|
2738
2777
|
notes: [
|
|
2739
2778
|
"add - under the workspace's .worktrees/: hooks folder, the links its file: and link: dependencies need to sibling checkouts, node_modules taken from the pool when an entry matches package-lock.json's lock key, else a near entry (at most 5 packages off) completed by npm install --prefer-offline --no-save, else npm ci, a copy-on-write copy only when npm ci fails (the reason on the card), read against package-lock.json (the npm ci to run when it differs), hygiene baseline",
|
|
2740
|
-
"prune - merged worktrees and branches, committed hand-overs, rehearsal clones: the commands with their cd; a worktree whose folder is gone is kept while its HEAD reflog holds work nothing else does (git worktree prune would delete that reflog), and git worktree prune waits while one is kept; a store lot's items (its worktree, its review throwaways <lot worktree>-round-<n> and -verify, its branch and theirs) are never removed here and no landing is read: an open lot's are kept, reason lot <name> <state>, a damaged lot's are held, reason its keep or lot <name> damaged; a committed or canceled lot kept on purpose holds them as an open lot does, reason kept by decision: <why> (by <who>, <date>); any other committed or canceled lot's are listed lot <name> <state>: its own item, removed by dialecte lot prune <name>; a worktree whose branch's work is not in the base is kept (not landed: its work is not in <base>); a worktree or a branch whose removal would lose a commit is kept with its commits (<n> commit(s) its removal would lose: <commits>; a surviving branch, branch reflog, tag, landed tip or remote-tracking ref holds a commit, or the same change at the same place (a commit with the same diff, its hunk line numbers included); deleting a branch takes its reflog); a worktree a process works in is kept (a process works in it: pid <pid>; processes not known: kept with why); ignored entries are read as lot close reads them: rebuilt folders, .dialecte/ views and copies of the main checkout's files go, anything else keeps the worktree (ignored files git worktree remove would delete: <paths>); a rehearsal clone is kept while its marker is
|
|
2741
|
-
"prune --reclaim - every worktree idle for --older-than days (default 2: no write to its index, HEAD or reflog since), not the main checkout, not locked,
|
|
2779
|
+
"prune - merged worktrees and branches, committed hand-overs, rehearsal clones: the commands with their cd; a worktree whose folder is gone is kept while its HEAD reflog holds work nothing else does (git worktree prune would delete that reflog), and git worktree prune waits while one is kept; a store lot's items (its worktree, its review throwaways <lot worktree>-round-<n> and -verify, its branch and theirs) are never removed here and no landing is read: an open lot's are kept, reason lot <name> <state>, a damaged lot's are held, reason its keep or lot <name> damaged, a lot whose identity.json does not read included: found by its worktree's root .dialecte/lot link and by the registry entry naming its folder (a lot folder gone or moved aside holds nothing); the root link names the lot holding a worktree too, held first, a link alone counting only when its lot holds; a committed or canceled lot kept on purpose holds them as an open lot does, reason kept by decision: <why> (by <who>, <date>); any other committed or canceled lot's are listed lot <name> <state>: its own item, removed by dialecte lot prune <name>; a worktree whose branch's work is not in the base is kept (not landed: its work is not in <base>); a worktree or a branch whose removal would lose a commit is kept with its commits (<n> commit(s) its removal would lose: <commits>; a surviving branch, branch reflog, tag, landed tip or remote-tracking ref holds a commit, or the same change at the same place (a commit with the same diff, its hunk line numbers included); deleting a branch takes its reflog); a worktree a process works in is kept (a process works in it: pid <pid>; processes not known: kept with why); ignored entries are read as lot close reads them: rebuilt folders, .dialecte/ views and copies of the main checkout's files go, anything else keeps the worktree (ignored files git worktree remove would delete: <paths>); a rehearsal clone is decided as lot close --feature decides it: kept while it is a link, it cannot be read (it could not be read (<why>)), its lot (the lot folder its marker names, present in the store, or the lot a committed or abandoned entry of its hand-over names by worktree and branch; owner not single: <lots> when two) is kept on purpose or damaged (its kept text), its run is alive or its pid runs with a start time that cannot be compared (its rehearsal still runs: pid <pid>), its marker cannot tell (no rehearsal marker, or why), the processes are not known, a process works in it (a process works in it: pid <pid>), or a link reaches it; a pid running with another start time is dead; a lot folder gone or moved aside releases its clones; a committed hand-over folder, a scratch folder or a rehearsal hook folder a process works in is kept (a process works in it: pid <pid>; processes not known: kept with why), the processes asked last; --json prints the plan, a worktree on a branch naming branch (kept or not), a clone let go naming owner (the folder of the lot that owned it at the plan, whose keep --yes reads again); --yes runs them after a confirmation on a terminal, and decides every item again first - worktree, branch, hand-over folder, rehearsal clone, scratch and hook folder, pool left-over - by the same rules, on a plan taken again right after the confirmation (processes, links, lots, hand-overs and markers read then, once, before the first move: a change between two moves of one run is not seen, and pool left-overs and clones, read right before their own move until now, are read earlier): an item goes only when that plan removes it with the same command, else, nothing moved, \u2717 <name> kept: <why>, \u2717 <name>: gone since the plan (its folder or refs/heads/<branch> missing), \u2717 <name> kept: not offered now, \u2717 <name> kept: removed another way now: <command>, \u2717 <branch> kept: its worktree stays (its worktree did not go), \u2717 <worktree> kept: git worktree prune would now also unregister <worktrees>, or \u2717 <name>: not decided again: <reason> (the hand-overs or the plan could not be read again); an item only that plan offers is never removed nor printed; committed hand-over folders, finished rehearsal clones, scratch folders and pool left-overs (.worktrees/_pool-<repository>-<n> with no pool.json: a park that never finished, unwritten for a while, no process in it) go to the trash like the other items (the workspace's .worktrees/_trash for a clone or a folder in its own .worktrees/_scratch, else the scratch root's dialecte-trash): the plan shows the move (mkdir -p <trash> && mv <folder> <trash>/), --yes makes it; a move that cannot be made is a \u2717 line, nothing deleted; the pool entries (with their pool.json) and the trash (.worktrees/_trash/) are counted, never touched",
|
|
2780
|
+
"prune --reclaim - every worktree idle for --older-than days (default 2: no write to its index, HEAD or reflog since), not the main checkout, not locked, held by no lot (an open, failed, damaged or kept on purpose lot naming it, or the lot its root .dialecte/lot link names, a lot whose identity does not read included; a lot's review throwaways are reclaimed like any idle worktree), named by no open hand-over, worked in by no process, reached by no link: its node_modules parked in the pool when its lock key is the main checkout's and it installs that lock, else sent to .worktrees/_trash/, its code never touched, a -round-<n> review throwaway's too; a node_modules that is a link is never moved; every rule checked again just before each move; one line per worktree, the total (worktrees, files, size) last; --dry-run moves nothing; --dry-run or --older-than without --reclaim, or an --older-than that is no positive whole number, exit 2"
|
|
2742
2781
|
],
|
|
2743
2782
|
exitCodes: [
|
|
2744
2783
|
"0 add: the worktree exists, whatever the links and the lockfile say",
|
|
2745
|
-
"1 add: a new branch without --from, and the base branch refused (a dialecte.baseBranch set to a branch that exists nowhere, local or on origin, or no base branch found); no worktree made"
|
|
2784
|
+
"1 add: a new branch without --from, and the base branch refused (a dialecte.baseBranch set to a branch that exists nowhere, local or on origin, or no base branch found); no worktree made",
|
|
2785
|
+
"0 prune: a plan, --json, a --reclaim run, every item moved, nothing to remove, or the confirmation declined",
|
|
2786
|
+
"1 prune --yes: an item not moved (kept, gone since the plan, not decided again, or its command or move failed)",
|
|
2787
|
+
"2 prune: --yes without a terminal, --dry-run or --older-than without --reclaim, or an --older-than that is not a positive whole number"
|
|
2746
2788
|
],
|
|
2747
2789
|
example: "dialecte worktree add cli feat/my-change"
|
|
2748
2790
|
},
|
|
@@ -2757,7 +2799,7 @@ var COMMAND_MAP = {
|
|
|
2757
2799
|
notes: [
|
|
2758
2800
|
"what to fix before trusting what you read",
|
|
2759
2801
|
"--brief - the session-start form, nothing when in sync, one line per problem",
|
|
2760
|
-
"--host - runs every read of the repository's host once, for real, through the cli's own code (the newest merged
|
|
2802
|
+
"--host - runs every read of the repository's host once, for real, through the cli's own code (the newest merged change request, its checks, its queued state and the queue its base offers, a reference change request's line comments, the stack extension), then the tool versions against the recorded ones and git against its floor; only those lines; network by name; --vendor <name> probes that vendor whatever the origin"
|
|
2761
2803
|
],
|
|
2762
2804
|
exitCodes: [
|
|
2763
2805
|
"1 a warning",
|
|
@@ -2858,13 +2900,13 @@ var COMMAND_MAP = {
|
|
|
2858
2900
|
},
|
|
2859
2901
|
text: {
|
|
2860
2902
|
family: "Maintain",
|
|
2861
|
-
summary: "The human part of a
|
|
2862
|
-
usage: ["dialecte text check <file> [--kind
|
|
2903
|
+
summary: "The human part of a host text, before it is posted",
|
|
2904
|
+
usage: ["dialecte text check <file> [--kind change-request|issue|comment|commit]"],
|
|
2863
2905
|
notes: [
|
|
2864
|
-
"the lines before <details: headings What changes, Why, How to check it (then Watch out) for
|
|
2906
|
+
"the lines before <details: headings What changes, Why, How to check it (then Watch out) for change-request and issue, none for comment and commit; word cap 150 | 200 | 80 | 100, headings and code blocks not counted; a commit subject of 72 at most"
|
|
2865
2907
|
],
|
|
2866
2908
|
exitCodes: [],
|
|
2867
|
-
example: "dialecte text check
|
|
2909
|
+
example: "dialecte text check change-request.md"
|
|
2868
2910
|
},
|
|
2869
2911
|
// the renamed commands: one key per command of the renamed forms, derived from that table
|
|
2870
2912
|
...renamedEntriesOf()
|
|
@@ -2898,7 +2940,7 @@ function renderLine(line) {
|
|
|
2898
2940
|
}
|
|
2899
2941
|
|
|
2900
2942
|
// src/lib/doctor/diagnose.ts
|
|
2901
|
-
import { existsSync as existsSync19,
|
|
2943
|
+
import { existsSync as existsSync19, readdirSync as readdirSync10, readFileSync as readFileSync13 } from "fs";
|
|
2902
2944
|
import { dirname as dirname11, join as join24, resolve as resolve5 } from "path";
|
|
2903
2945
|
|
|
2904
2946
|
// src/lib/profile/profile.constants.ts
|
|
@@ -3387,13 +3429,6 @@ function isContributor(cwd) {
|
|
|
3387
3429
|
return false;
|
|
3388
3430
|
}
|
|
3389
3431
|
}
|
|
3390
|
-
function isLink(path) {
|
|
3391
|
-
try {
|
|
3392
|
-
return lstatSync5(path).isSymbolicLink();
|
|
3393
|
-
} catch {
|
|
3394
|
-
return false;
|
|
3395
|
-
}
|
|
3396
|
-
}
|
|
3397
3432
|
function dependsOnCore(folder) {
|
|
3398
3433
|
const manifest = JSON.parse(readFileSync13(join24(folder, "package.json"), "utf8"));
|
|
3399
3434
|
return manifest.name !== CORE_PACKAGE2 && (manifest.dependencies?.[CORE_PACKAGE2] !== void 0 || manifest.peerDependencies?.[CORE_PACKAGE2] !== void 0);
|
|
@@ -3415,12 +3450,7 @@ function declaredVersions(cwd) {
|
|
|
3415
3450
|
const manifest = JSON.parse(readFileSync13(join24(cwd, "package.json"), "utf8"));
|
|
3416
3451
|
const names = dependencyNames(cwd);
|
|
3417
3452
|
return Object.fromEntries(
|
|
3418
|
-
names.map((name) => [
|
|
3419
|
-
name,
|
|
3420
|
-
String(
|
|
3421
|
-
manifest.dependencies?.[name] ?? manifest.devDependencies?.[name] ?? manifest.peerDependencies?.[name]
|
|
3422
|
-
)
|
|
3423
|
-
])
|
|
3453
|
+
names.map((name) => [name, String(declaredSpecOf({ manifest, name })?.spec)])
|
|
3424
3454
|
);
|
|
3425
3455
|
}
|
|
3426
3456
|
function installedVersion(params) {
|
|
@@ -3453,6 +3483,7 @@ var HOST_READ_METHODS = [
|
|
|
3453
3483
|
"readChangeRequest",
|
|
3454
3484
|
"readChecks",
|
|
3455
3485
|
"readQueued",
|
|
3486
|
+
"readQueueKind",
|
|
3456
3487
|
"probeStacks"
|
|
3457
3488
|
];
|
|
3458
3489
|
|
|
@@ -4189,6 +4220,19 @@ function resolveConfig(context) {
|
|
|
4189
4220
|
// src/lib/host/github/github.constants.ts
|
|
4190
4221
|
var GITHUB_VENDOR_NAME = "github";
|
|
4191
4222
|
var GITHUB_REMOTE_HOSTS = ["github.com", "ssh.github.com"];
|
|
4223
|
+
var GITHUB_NOUNS = {
|
|
4224
|
+
changeRequestNoun: "pull request",
|
|
4225
|
+
changeRequestNouns: "pull requests"
|
|
4226
|
+
};
|
|
4227
|
+
var GITHUB_QUEUE_NOUNS = {
|
|
4228
|
+
queue: "merge queue",
|
|
4229
|
+
"auto-merge": "auto-merge",
|
|
4230
|
+
none: "no queue"
|
|
4231
|
+
};
|
|
4232
|
+
var GITHUB_CHANGE_REQUEST_TEMPLATE = ".github/pull_request_template.md";
|
|
4233
|
+
var GITHUB_NOUN_WORDS = ["pull", "pulls", "pullrequest", "pullrequests"];
|
|
4234
|
+
var GITHUB_NOUN_PATH_PATTERN = /pull[-_]?request/i;
|
|
4235
|
+
var QUEUE_SETTINGS_QUERY = "query($owner:String!,$repo:String!,$number:Int!){repository(owner:$owner,name:$repo){autoMergeAllowed pullRequest(number:$number){isMergeQueueEnabled}}}";
|
|
4192
4236
|
var GH_COMMAND = "gh";
|
|
4193
4237
|
var QUEUED_QUERY = "query($owner:String!,$repo:String!,$number:Int!){repository(owner:$owner,name:$repo){pullRequest(number:$number){isInMergeQueue autoMergeRequest{enabledAt}}}}";
|
|
4194
4238
|
var HOST_ENVIRONMENT = {
|
|
@@ -4226,6 +4270,7 @@ var GITHUB_PROBE_TEXTS = {
|
|
|
4226
4270
|
noPullRequestTextChanged: "the text gh prints for no pull request changed: {refusal}",
|
|
4227
4271
|
checksRead: "#{number}: checks {state}",
|
|
4228
4272
|
queuedRead: "#{number}: queued {queued}",
|
|
4273
|
+
queueKindRead: "#{number}: {kind} ({noun})",
|
|
4229
4274
|
commentsRead: "{reference}: {count} comments, {lines} on a line, {replies} replies",
|
|
4230
4275
|
commentKeysChanged: "review-comment keys changed: {reference} reads {lines} comments on a line and {replies} replies, at least one of each expected",
|
|
4231
4276
|
stacksOn: "gh stack answers",
|
|
@@ -4290,6 +4335,14 @@ var GITHUB_CALLS = {
|
|
|
4290
4335
|
graphql: QUEUED_QUERY,
|
|
4291
4336
|
filter: ".data.repository.pullRequest"
|
|
4292
4337
|
},
|
|
4338
|
+
queueSettings: {
|
|
4339
|
+
words: ["api"],
|
|
4340
|
+
flags: ["-F"],
|
|
4341
|
+
kind: "read",
|
|
4342
|
+
endpoint: "graphql",
|
|
4343
|
+
graphql: QUEUE_SETTINGS_QUERY,
|
|
4344
|
+
filter: ".data.repository"
|
|
4345
|
+
},
|
|
4293
4346
|
stackHelp: { words: [GH_STACK], flags: ["--help"], kind: "read" },
|
|
4294
4347
|
stackLink: { words: [GH_STACK, "link"], flags: [], kind: "write" },
|
|
4295
4348
|
stackMerge: { words: [GH_STACK, "merge"], flags: ["--yes", "--squash"], kind: "write" }
|
|
@@ -4373,6 +4426,15 @@ function objectOf(text) {
|
|
|
4373
4426
|
return void 0;
|
|
4374
4427
|
}
|
|
4375
4428
|
}
|
|
4429
|
+
function queueSupportOf(params) {
|
|
4430
|
+
try {
|
|
4431
|
+
const parsed = JSON.parse(params.text);
|
|
4432
|
+
const kind = parsed.pullRequest?.isMergeQueueEnabled === true ? "queue" : parsed.autoMergeAllowed === true ? "auto-merge" : "none";
|
|
4433
|
+
return { kind, noun: GITHUB_QUEUE_NOUNS[kind] };
|
|
4434
|
+
} catch {
|
|
4435
|
+
return { refusal: `gh api graphql: not the JSON it writes: ${params.text.slice(0, 80)}` };
|
|
4436
|
+
}
|
|
4437
|
+
}
|
|
4376
4438
|
|
|
4377
4439
|
// src/lib/host/github/run-gh.ts
|
|
4378
4440
|
import { spawnSync as spawnSync4 } from "child_process";
|
|
@@ -4601,6 +4663,7 @@ function createGithubHost() {
|
|
|
4601
4663
|
retargetChangeRequest: retargetOnGithub,
|
|
4602
4664
|
draftChangeRequest: draftOnGithub,
|
|
4603
4665
|
readQueued: readQueuedOnGithub,
|
|
4666
|
+
readQueueKind: readQueueKindOnGithub,
|
|
4604
4667
|
queueChangeRequest: function queueChangeRequest(params) {
|
|
4605
4668
|
const number = String(params.number);
|
|
4606
4669
|
if (params.draft) {
|
|
@@ -4739,11 +4802,7 @@ function closeOnGithub(params) {
|
|
|
4739
4802
|
return "refusal" in closed ? closed : void 0;
|
|
4740
4803
|
}
|
|
4741
4804
|
function readQueuedOnGithub(params) {
|
|
4742
|
-
const run =
|
|
4743
|
-
root: params.root,
|
|
4744
|
-
call: "queuedState",
|
|
4745
|
-
options: { "-F": ["owner={owner}", "repo={repo}", `number=${params.number}`] }
|
|
4746
|
-
});
|
|
4805
|
+
const run = runPullRequestQuery({ ...params, call: "queuedState" });
|
|
4747
4806
|
if ("refusal" in run) return run;
|
|
4748
4807
|
try {
|
|
4749
4808
|
const parsed = JSON.parse(run.output);
|
|
@@ -4754,6 +4813,17 @@ function readQueuedOnGithub(params) {
|
|
|
4754
4813
|
return { refusal: `gh api graphql: not the JSON it writes: ${run.output.slice(0, 80)}` };
|
|
4755
4814
|
}
|
|
4756
4815
|
}
|
|
4816
|
+
function readQueueKindOnGithub(params) {
|
|
4817
|
+
const run = runPullRequestQuery({ ...params, call: "queueSettings" });
|
|
4818
|
+
return "refusal" in run ? run : queueSupportOf({ text: run.output });
|
|
4819
|
+
}
|
|
4820
|
+
function runPullRequestQuery(params) {
|
|
4821
|
+
return runGh({
|
|
4822
|
+
root: params.root,
|
|
4823
|
+
call: params.call,
|
|
4824
|
+
options: { "-F": ["owner={owner}", "repo={repo}", `number=${params.number}`] }
|
|
4825
|
+
});
|
|
4826
|
+
}
|
|
4757
4827
|
function pullRequestOf(params) {
|
|
4758
4828
|
try {
|
|
4759
4829
|
const parsed = JSON.parse(params.text);
|
|
@@ -4885,19 +4955,36 @@ function probeViewChecks(params) {
|
|
|
4885
4955
|
};
|
|
4886
4956
|
}
|
|
4887
4957
|
function probeQueuedState(params) {
|
|
4958
|
+
return probeNumberedRead({
|
|
4959
|
+
params,
|
|
4960
|
+
read: (number) => params.host.readQueued({ root: params.root, number }),
|
|
4961
|
+
template: GITHUB_PROBE_TEXTS.queuedRead,
|
|
4962
|
+
valuesOf: (answer) => ({ queued: String(answer.queued) })
|
|
4963
|
+
});
|
|
4964
|
+
}
|
|
4965
|
+
function probeNumberedRead(probe) {
|
|
4966
|
+
const { params } = probe;
|
|
4888
4967
|
if (params.changeRequest === void 0) return needsPullRequest(params);
|
|
4889
|
-
const
|
|
4890
|
-
if ("refusal" in
|
|
4891
|
-
return { status: "error", subject: params.subject, detail:
|
|
4968
|
+
const answer = probe.read(params.changeRequest);
|
|
4969
|
+
if ("refusal" in answer)
|
|
4970
|
+
return { status: "error", subject: params.subject, detail: answer.refusal };
|
|
4892
4971
|
return {
|
|
4893
4972
|
status: "ok",
|
|
4894
4973
|
subject: params.subject,
|
|
4895
4974
|
detail: fillMessage({
|
|
4896
|
-
template:
|
|
4897
|
-
values: { number: String(params.changeRequest),
|
|
4975
|
+
template: probe.template,
|
|
4976
|
+
values: { number: String(params.changeRequest), ...probe.valuesOf(answer) }
|
|
4898
4977
|
})
|
|
4899
4978
|
};
|
|
4900
4979
|
}
|
|
4980
|
+
function probeQueueSettings(params) {
|
|
4981
|
+
return probeNumberedRead({
|
|
4982
|
+
params,
|
|
4983
|
+
read: (number) => params.host.readQueueKind({ root: params.root, number }),
|
|
4984
|
+
template: GITHUB_PROBE_TEXTS.queueKindRead,
|
|
4985
|
+
valuesOf: (answer) => ({ kind: answer.kind, noun: answer.noun })
|
|
4986
|
+
});
|
|
4987
|
+
}
|
|
4901
4988
|
function probeReviewComments(params) {
|
|
4902
4989
|
const comments = readReviewCommentsWith({
|
|
4903
4990
|
run: params.run,
|
|
@@ -4947,6 +5034,7 @@ var GITHUB_PROBES = {
|
|
|
4947
5034
|
viewPullRequest: probeViewPullRequest,
|
|
4948
5035
|
viewChecks: probeViewChecks,
|
|
4949
5036
|
queuedState: probeQueuedState,
|
|
5037
|
+
queueSettings: probeQueueSettings,
|
|
4950
5038
|
reviewComments: probeReviewComments,
|
|
4951
5039
|
stackHelp: probeStackHelp
|
|
4952
5040
|
};
|
|
@@ -4957,6 +5045,10 @@ var GITHUB_VENDOR = {
|
|
|
4957
5045
|
name: GITHUB_VENDOR_NAME,
|
|
4958
5046
|
tool: GH_COMMAND,
|
|
4959
5047
|
remoteHosts: GITHUB_REMOTE_HOSTS,
|
|
5048
|
+
nouns: GITHUB_NOUNS,
|
|
5049
|
+
changeRequestTemplate: GITHUB_CHANGE_REQUEST_TEMPLATE,
|
|
5050
|
+
nounWords: GITHUB_NOUN_WORDS,
|
|
5051
|
+
nounPathPattern: GITHUB_NOUN_PATH_PATTERN,
|
|
4960
5052
|
calls: GITHUB_CALLS,
|
|
4961
5053
|
recordedVersions: GITHUB_RECORDED_VERSIONS,
|
|
4962
5054
|
subject: GITHUB_SUBJECT,
|
|
@@ -4996,6 +5088,7 @@ function sshHostnameOf(params) {
|
|
|
4996
5088
|
});
|
|
4997
5089
|
return run.status === 0 ? hostnameOfSshConfig({ text: run.stdout }) : void 0;
|
|
4998
5090
|
}
|
|
5091
|
+
var sshHostnameOnce = memoisedLookup({ lookup: sshHostnameOf });
|
|
4999
5092
|
function hostKeyOf(params) {
|
|
5000
5093
|
const resolved = resolveConfig({
|
|
5001
5094
|
root: params.root,
|
|
@@ -5025,7 +5118,7 @@ function selectionOf(params) {
|
|
|
5025
5118
|
const byOrigin = vendorOfRemoteHost({ host });
|
|
5026
5119
|
if (byOrigin !== void 0) return { vendor: byOrigin, host };
|
|
5027
5120
|
if (remote !== void 0 && remote.form !== "https") {
|
|
5028
|
-
const sshHostname = params.sshHostname ??
|
|
5121
|
+
const sshHostname = params.sshHostname ?? sshHostnameOnce;
|
|
5029
5122
|
const byAlias = vendorOfRemoteHost({ host: sshHostname({ alias: remote.host }) });
|
|
5030
5123
|
if (byAlias !== void 0) return { vendor: byAlias, host };
|
|
5031
5124
|
}
|
|
@@ -5064,6 +5157,13 @@ function noVendorReason(params) {
|
|
|
5064
5157
|
}
|
|
5065
5158
|
});
|
|
5066
5159
|
}
|
|
5160
|
+
function memoisedLookup(params) {
|
|
5161
|
+
const answers = /* @__PURE__ */ new Map();
|
|
5162
|
+
return function lookupOnce({ alias }) {
|
|
5163
|
+
if (!answers.has(alias)) answers.set(alias, params.lookup({ alias }));
|
|
5164
|
+
return answers.get(alias);
|
|
5165
|
+
};
|
|
5166
|
+
}
|
|
5067
5167
|
|
|
5068
5168
|
// src/commands/doctor.ts
|
|
5069
5169
|
function runDoctor(params) {
|