ytdb-slate 0.13.0 → 0.15.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.
Files changed (50) hide show
  1. package/README.md +23 -10
  2. package/docs/blast-radius.md +39 -30
  3. package/docs/change-records.md +215 -0
  4. package/docs/configuration.md +486 -10
  5. package/docs/context-budget.md +225 -55
  6. package/docs/delivery-packages.md +116 -72
  7. package/docs/design-principles.md +362 -266
  8. package/docs/model-routing.md +5 -6
  9. package/docs/pr-publishing.md +177 -162
  10. package/docs/recursive-workflow.md +754 -0
  11. package/docs/review-common-policy.md +1 -1
  12. package/docs/review-rules.md +48 -29
  13. package/docs/roadmap.md +25 -4
  14. package/docs/safety-and-trust.md +43 -3
  15. package/docs/track-workflow.md +324 -136
  16. package/docs/user-notes.md +48 -41
  17. package/extension/action-temporary.ts +100 -0
  18. package/extension/concurrency.ts +28 -0
  19. package/extension/config.ts +2 -0
  20. package/extension/episodes.ts +30 -1
  21. package/extension/failover.ts +24 -3
  22. package/extension/handoff.ts +96 -17
  23. package/extension/index.ts +42 -15
  24. package/extension/logical-model-adapters.ts +6 -3
  25. package/extension/mode.ts +50 -61
  26. package/extension/model-default.ts +3 -3
  27. package/extension/notification-config.ts +120 -0
  28. package/extension/notification-dispatcher.ts +274 -0
  29. package/extension/notification-events.ts +166 -0
  30. package/extension/notification-native.ts +173 -0
  31. package/extension/notification-protocols.ts +102 -0
  32. package/extension/notification-push-resolution.ts +216 -0
  33. package/extension/notification-push.ts +107 -0
  34. package/extension/notification-terminal.ts +94 -0
  35. package/extension/notification-tmux.ts +166 -0
  36. package/extension/paths.ts +2 -0
  37. package/extension/record-names.ts +31 -0
  38. package/extension/render.ts +146 -127
  39. package/extension/run-outcome.ts +7 -0
  40. package/extension/slate-files.ts +2 -1
  41. package/extension/startup-summary.ts +6 -6
  42. package/extension/state.ts +16 -1
  43. package/extension/threads.ts +158 -27
  44. package/extension/tools.ts +73 -38
  45. package/extension/worker-codemode.ts +32 -0
  46. package/extension/worker-extensions.ts +3 -4
  47. package/extension/worker-nested-lifecycle.ts +58 -0
  48. package/extension/worker-reminder.ts +3 -2
  49. package/extension/worker.ts +113 -39
  50. package/package.json +4 -4
package/README.md CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  [![CI status](https://github.com/JetBrains/ytdb-slate/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/JetBrains/ytdb-slate/actions/workflows/ci.yml)
4
4
 
5
- Slate is a multi-agent orchestration extension for the [pi coding agent](https://pi.dev). You work in one interactive pi session, the main session. A bounded action is a focused task with a clear limit. A worker thread is an isolated pi session that researches, implements, or reviews changes. Slate sends bounded actions to separate worker threads. Each worker thread returns a short structured summary called an episode. A review workflow adds reviewers for risks that you approve or for work above a size threshold.
5
+ Slate is a multi-agent orchestration extension for the [pi coding agent](https://pi.dev). You work in one interactive pi session, the main session. A bounded action is a focused task with a clear limit. A worker thread is an isolated pi session that researches, implements, or reviews changes. Slate sends bounded actions to separate worker threads. Each worker thread returns a short structured summary called an episode. A review workflow adds reviewers for risks the orchestrator proves or for work above a size threshold.
6
+
7
+ The developers of the [YouTrackDB](https://github.com/JetBrains/youtrackdb) database use Slate in production development.
6
8
 
7
9
  ## What Slate does
8
10
 
@@ -14,6 +16,8 @@ Slate is a multi-agent orchestration extension for the [pi coding agent](https:/
14
16
 
15
17
  ## Quick start
16
18
 
19
+ Slate requires pi 1.4.0 or later. Older pi can still load the package, but it is not supported. Slate provides no runtime version warning.
20
+
17
21
  You need an installed and authenticated [pi coding agent](https://pi.dev/docs/latest/quickstart). From your project directory, install a pinned Slate version:
18
22
 
19
23
  ```bash
@@ -36,7 +40,7 @@ Try a request with a clear outcome:
36
40
  Add input validation to the account settings endpoint. First research the relevant code and tests. Show me the proposed plan and risks before implementation.
37
41
  ```
38
42
 
39
- Slate asks for required decisions before editing code. It delegates work after workflow gates allow it. Slate shows a short workflow summary when orchestrator mode is on at interactive startup or when you turn it on. A saved `startupSummary: false` choice stops automatic display. The summary disappears when you send your first prompt to the model.
43
+ Slate asks for required decisions before editing code. It delegates work after workflow gates allow it. The workflow summary is off by default. Run `/slate summary on` to save an opt-in. The panel appears at the next interactive startup or mode activation, not when you save the choice. The summary disappears when you send your first prompt to the model. A handoff successor keeps the current panel visibility instead of using the saved choice.
40
44
 
41
45
  Run `/slate off` to stop Slate's delegation and remove the summary. `/slate summary off` also removes it. Toggling orchestrator mode off with `/slate` removes it too. Other slash commands leave it visible unless they reload or replace the session. `/reload`, `/new`, `/resume`, and `/fork` clear the panel when they reload or replace the session. Slate then shows it only when orchestrator mode is on and the saved choice allows automatic display. Run `/slate summary` to show it at any time. See [Commands](#commands).
42
46
 
@@ -51,13 +55,19 @@ Through `context`, later worker threads can receive earlier episodes without ful
51
55
 
52
56
  Slate independently implements the thread-weaving architecture from the Random Labs technical report for `@randomlabs/slate`.
53
57
 
54
- A track is one coherent, independently mergeable part of a change. Slate supplies a track-based development workflow in orchestrator mode. Project configuration can extend the workflow rules but cannot replace them. Eleven focus areas name specific risks. They cover
58
+ A track is a bounded part of approved work. A code track implements that work. A design track plans a nested change with child tracks. A level contains sibling tracks from one split. The level is the merge unit. Slate supplies this development workflow in orchestrator mode. Project configuration can extend the workflow rules but cannot replace them. Eleven focus areas name specific risks. They cover
55
59
  concurrency defects, data loss, security weaknesses, performance degradation,
56
60
  test-quality defects, unreadable user-facing prose, licensing exposure,
57
61
  non-local logic defects, consumer contract breaks, governing-rule defects, and
58
62
  unreported failures.
59
63
 
60
- The orchestrator records risks for the change and each track. You approve or reject each named proof. Approved proofs select design gates and reviewers. A track with a proved risk gets one general reviewer and its required specialists. An implementer's approximate track size above 100 added plus removed lines also adds the general reviewer unless the track changes only documents that neither ship as code nor run. Lockfiles, migration files, and generated output do not count. A track that the orchestrator estimates above 100 such lines needs a high-level design before implementation, including when it changes only documents. A track with neither review trigger gets no routine implementation reviewer. See [workflow](docs/track-workflow.md) and [focus areas](docs/blast-radius.md) for the rules. Optional draft pull requests cover the whole change. Only you merge them.
64
+ The orchestrator records risks for the change and each track. The orchestrator judges each named proof and selects design gates and reviewers. You can inspect the assessment and direct changes. A track with a proved risk gets one general reviewer and its required specialists. An implementer's approximate track size above 100 added plus removed lines also adds the general reviewer unless the track changes only documents that neither ship as code nor run. Lockfiles, migration files, and generated output do not count. A track that the orchestrator estimates above 100 such lines needs a high-level design before implementation, including when it changes only documents. A track with neither review trigger gets no routine implementation reviewer. See [workflow](docs/track-workflow.md) and [focus areas](docs/blast-radius.md) for the rules. Optional draft pull requests cover each level with code tracks. A change without nested tracks has at most one pull request. Each design track needs your explicit acceptance of its whole subtree, which contains that track and its descendants. Final acceptance of the whole change remains a separate decision. Only you merge pull requests. See [recursive workflow](docs/recursive-workflow.md) for nested planning, repair children, and acceptance.
65
+
66
+ ## Product principles
67
+
68
+ - **Control without reading every line.** Many coding agents produce code that the developer accepts without reading it. Slate keeps you in control in a different way. It gives you higher-level views of the work: proved risks, designs, and review results. You direct and check each change through these views, so you do not need to read all of the generated code.
69
+ - **Quality before cost, within limits.** We expect the cost of model use to fall over time. Slate therefore spends more model work on code quality, up to a reasonable limit. For example, Slate adds reviewers for proved risks and for large tracks that change code.
70
+ - **Cost in proportion to the change.** The cost of a change should grow in proportion to its complexity. A small track with no proved risk gets no design gate and no routine implementation reviewer. A larger or riskier track can add design steps, review steps, or both.
61
71
 
62
72
  ## Commands
63
73
 
@@ -68,7 +78,7 @@ The orchestrator records risks for the change and each track. You approve or rej
68
78
  | `/slate` | Toggle orchestrator mode. |
69
79
  | `/slate summary` | Show the workflow summary in any mode, even when automatic display is off. |
70
80
  | `/slate summary off` | Stop automatic display and remove a visible summary. |
71
- | `/slate summary on` | Allow automatic display when orchestrator mode is on. |
81
+ | `/slate summary on` | Save automatic display for the next startup or mode activation. |
72
82
  | `/slate effective` | Show the effective logical-model policy and remembered route selections. |
73
83
  | `/slate handoff [focus]` | Prepare a new-session handoff, with an optional focus. |
74
84
  | `/slate resume` | Clear a context-budget pause and accept user prompts again. |
@@ -77,6 +87,8 @@ The orchestrator records risks for the change and each track. You approve or rej
77
87
 
78
88
  Slate reads optional home configuration and trusted project configuration. The [configuration reference](docs/configuration.md) lists merge rules, options, examples, and document path warnings.
79
89
 
90
+ Slate attempts notifications after a main-session run settles or an extension dialog stays open for input. Terminal, desktop and bell delivery default to on. Phone push through ntfy, a notification server, needs home setup. Text defaults to the event type. See [notification setup](docs/configuration.md#notifications) for timing and limits.
91
+
80
92
  ## Safety and trust
81
93
 
82
94
  Slate limits which extensions worker threads can load and which project settings it reads. [Safety and trust](docs/safety-and-trust.md) explains worker extensions, provider registrations, and the project trust boundary.
@@ -86,25 +98,26 @@ Slate limits which extensions worker threads can load and which project settings
86
98
  The main goal is that you can guide a change through its design without reading the code. Planned work:
87
99
 
88
100
  1. Design documents that state exact guarantees and show why the design keeps them. Reviewers check the code against the approved design ([#402](https://github.com/JetBrains/ytdb-slate/issues/402), [#403](https://github.com/JetBrains/ytdb-slate/issues/403), [#404](https://github.com/JetBrains/ytdb-slate/issues/404)).
89
- 2. Recursive decomposition for large, long-running changes ([#361](https://github.com/JetBrains/ytdb-slate/issues/361)).
90
- 3. Better developer experience: asynchronous threads, a detailed cost breakdown, and a read-only view of thread execution.
91
- 4. Remote development through integration with pi-agent-dashboard ([#417](https://github.com/JetBrains/ytdb-slate/issues/417)).
101
+ 2. Better developer experience: asynchronous threads, a detailed cost breakdown, and a read-only view of thread execution.
102
+ 3. Remote development: planned support will allow you to set up your own infrastructure to steer agents from a laptop, a desktop or a phone through one browser application, with notifications when an agent needs attention.
92
103
 
93
104
  See [`docs/roadmap.md`](docs/roadmap.md) for details.
94
105
 
95
106
  ## Shipped docs
96
107
 
97
- These documents define workflow and reference behavior. Slate cites workflow documents by installed path in its numbered system-prompt rules.
108
+ These documents define workflow and reference behavior. Slate uses installed paths for workflow citations in its numbered system-prompt rules. The filenames `change-records.md` and `recursive-workflow.md` resolve beside the Lifecycle document, `track-workflow.md`.
98
109
 
99
110
  - [`docs/blast-radius.md`](docs/blast-radius.md) defines focus areas, proofs, and review coverage.
111
+ - [`docs/change-records.md`](docs/change-records.md) defines identifiers, code ranges, design markers, and safe writes to change records.
100
112
  - [`docs/configuration.md`](docs/configuration.md) defines settings, merge rules, and path warnings.
101
113
  - [`docs/context-budget.md`](docs/context-budget.md) defines context limits, model overrides, and measured prompt sizes.
102
114
  - [`docs/delivery-packages.md`](docs/delivery-packages.md) — the compact track and change package format, read only before package preparation
103
115
  - [`docs/design-principles.md`](docs/design-principles.md) explains the architecture and its trade-offs.
104
116
  - [`docs/model-routing.md`](docs/model-routing.md) defines logical-model routing, recovery, and accepted limits.
105
117
  - [`docs/pr-publishing.md`](docs/pr-publishing.md) defines optional draft pull request publishing.
118
+ - [`docs/recursive-workflow.md`](docs/recursive-workflow.md) defines nested planning, repair children, and whole-subtree acceptance.
106
119
  - [`docs/review-rules.md`](docs/review-rules.md) defines reviewer roles, evidence, and fix gates.
107
- - [`docs/roadmap.md`](docs/roadmap.md) describes planned work.
120
+ - [`docs/roadmap.md`](docs/roadmap.md) describes current larger-change guidance and planned work.
108
121
  - [`docs/safety-and-trust.md`](docs/safety-and-trust.md) defines worker extension, provider, and trust boundaries.
109
122
  - [`docs/track-workflow.md`](docs/track-workflow.md) defines research, design, implementation, review, and delivery.
110
123
  - [`docs/user-notes.md`](docs/user-notes.md) defines user note handling.
@@ -10,28 +10,37 @@ composition and finding handling.
10
10
  The orchestrator judges all eleven focus areas for the change and independently
11
11
  for every track. An area is **NAMED** when the orchestrator submits its
12
12
  four-part proof. The proof states the defect class, the place where the defect
13
- can occur, the material consequence, and the review contribution. User approval
14
- makes a NAMED area **proved**.
15
- User rejection makes it **SKIPPED**. Only a proved area adds focus-dependent
13
+ can occur, the material consequence, and the review contribution.
14
+ The orchestrator judges and records each proof. A sufficient NAMED proof makes
15
+ the area **proved**. An insufficient NAMED line becomes **SKIPPED**.
16
+ Only a proved area adds focus-dependent
16
17
  gates or area reviewers. A track with one or more proved areas gets exactly
17
18
  one Reviewer I and every required area specialist. The implementer's approximate
18
19
  size above 100 counted lines also requires Reviewer I on a track that is not
19
20
  documentation-only. Without either trigger, routine implementation review is
20
21
  `NOT REQUIRED`. Size alone adds no area reviewer or blocking track acceptance.
21
22
  [track-workflow.md](track-workflow.md) § Track size and split defines counted
22
- lines and the separate pre-implementation design estimate. The user alone
23
- judges proofs and whether the proposal is the simplest solution. No script or
24
- other rule decides whether a proof holds.
25
-
26
- Each track must be one coherent unit that a human can review in one sitting. The
27
- orchestrator owns the split and records its rationale. Reject a split that would
28
- leave an inconsistent intermediate state. When the planned split exceeds twelve
29
- tracks, stop and present it to the user. The user chooses whether and how the
30
- change proceeds. Twelve is an escalation threshold, not a hard track cap.
23
+ lines and the separate pre-implementation design estimate. The user judges
24
+ whether the proposal is the simplest solution. No script or other rule decides
25
+ whether a proof holds.
26
+
27
+ Each track must be one coherent unit that a human can review in one sitting.
28
+ The orchestrator owns the split and records its rationale.
29
+ A code track implements bounded approved work, including document changes.
30
+ A level contains the sibling tracks created by one split.
31
+ The level is the merge unit.
32
+ All checks pass at each child marker.
33
+ Agreement across documents, prompt guidance, and the extension is required at
34
+ the level boundary.
35
+ Intermediate track packages and review intentions list each remaining difference
36
+ across those surfaces and name the later child that owns it.
37
+ Do not merge an incomplete level into the default branch.
38
+ [track-workflow.md](track-workflow.md) § Recursive planning and loading owns split
39
+ limits, the implementer-requested exception, and the recursive-document loading condition.
31
40
 
32
41
  ## Focus areas and their gates
33
42
 
34
- A focus area is one named risk. An area adds its reviewer only when the user approves its NAMED proof.
43
+ A focus area is one named risk. An area adds its reviewer only when the orchestrator judges its NAMED proof sufficient.
35
44
 
36
45
  <!-- focus-area-table:begin -->
37
46
  | # | focus area | the gate it adds | where the gate runs |
@@ -305,13 +314,11 @@ Areas may engage together when each area meets its own trigger. The unreported f
305
314
 
306
315
  The orchestrator records one line for every area. A named line gives a concrete
307
316
  four-part proof. A line that is not NAMED states which part of the trigger
308
- answers no. A NAMED line becomes proved only through user approval. A rejected
309
- NAMED line becomes SKIPPED and adds no gate or reviewer.
317
+ answers no. A NAMED line becomes proved when the orchestrator judges its proof sufficient.
318
+ An insufficient NAMED line becomes SKIPPED and adds no gate or reviewer.
310
319
 
311
- Each change and track keeps its own assessment and risk record. When two records
312
- pose the same decision, each record may cite one applicable user approval under
313
- [track-workflow.md](track-workflow.md) § Confirmation gate. A shared approval
314
- does not merge the records or replace either record's evidence.
320
+ Each change and track keeps its own assessment and risk record.
321
+ Shared evidence does not merge the records or replace either assessment.
315
322
 
316
323
  Every NAMED proof has these four parts:
317
324
 
@@ -342,8 +349,8 @@ material when loss of that control would be material. A cosmetic consequence
342
349
  is not material. A proof is not convincing when its words would also fit a
343
350
  change that does not engage the area.
344
351
 
345
- No rule mechanically decides whether a proof holds. The user alone judges every
346
- proof at the confirmation gate and at focus reconfirmation. A SKIPPED area gets
352
+ No rule mechanically decides whether a proof holds. The orchestrator judges every
353
+ proof at planning and focus reconfirmation. A SKIPPED area gets
347
354
  no gate or reviewer. The skip is recorded and is not an escalation. A track with
348
355
  no proved area gets no area reviewer.
349
356
 
@@ -366,7 +373,7 @@ A path is evidence, not a definition or a decision.
366
373
  ## Lifecycle rules owned by the spine
367
374
 
368
375
  [track-workflow.md](track-workflow.md) § Risk planning and reconciliation owns
369
- planning, approval, focus reconfirmation, the late-area route, and the
376
+ planning, proof judgment, focus reconfirmation, the late-area route, and the
370
377
  committed-difference comparison. This document does not duplicate those rules.
371
378
 
372
379
  [review-rules.md](review-rules.md) § Reviewer sets, merge rule and charters owns
@@ -383,12 +390,9 @@ On a halt, the orchestrator:
383
390
 
384
391
  1. pauses implementation.
385
392
  2. re-derives all eleven focus lines for the remaining work.
386
- 3. presents each addition or proposed removal with its proof or failed trigger
387
- part.
388
- 4. applies an applicable prior user answer or obtains the user's approval or
389
- rejection of every new NAMED proof and every proposed removal of a proved
390
- area. A rejected removal preserves the proved area and all of its gates and
391
- reviewers.
393
+ 3. records each addition or removal with its proof or failed trigger part.
394
+ 4. judges each new NAMED proof and removal, records the resulting gate changes,
395
+ and honors any user direction without silently waiving a separate gate.
392
396
  5. runs the required design gate for remaining work when a newly proved
393
397
  DESIGN-TRIGGERING area requires it, unless the user records a decision to
394
398
  skip that gate.
@@ -400,8 +404,9 @@ A late proved area recomputes the complete required routine reviewer set for the
400
404
  completed range. If Reviewer I has not covered that range, dispatch Reviewer I
401
405
  and the new area specialist. If Reviewer I already ran because of size or
402
406
  another proved area, dispatch only the new specialist. Do not dispatch Reviewer I
403
- again. Every newly required perspective reviews the completed range. The durable
404
- delivery record reports the resulting coverage.
407
+ again. Every newly required perspective reviews the completed range. The owning
408
+ research log reports the resulting coverage.
409
+ Disclose relevant concerns under the package rules.
405
410
 
406
411
  ## Review coverage and the coverage register
407
412
 
@@ -430,6 +435,10 @@ log.
430
435
  prefixes and the source of truth for track boundaries. This section owns the
431
436
  remaining commit discipline.
432
437
 
438
+ These review-range body rules do not govern the final publishing-disabled delivery squash.
439
+ That squash follows project commit rules or the default under
440
+ [track-workflow.md](track-workflow.md) § Delivery history and accounting.
441
+
433
442
  The cumulative implementation commit is defined in
434
443
  [track-workflow.md](track-workflow.md) § Lifecycle and phases. When the track
435
444
  has a high-level design, the cumulative implementation commit body carries the
@@ -0,0 +1,215 @@
1
+ # Common change records
2
+
3
+ For record writing, a **change record** is a research log, status file, implementer report, or design file.
4
+ [change-records.md](change-records.md) owns the common record rules below.
5
+ [recursive-workflow.md](recursive-workflow.md) owns nested-track rules.
6
+ Use [track-workflow.md](track-workflow.md) § Recursive planning and loading for document loading.
7
+
8
+ [writing-guidance.md](writing-guidance.md) separately defines change records for the writing convention.
9
+ That definition covers pull request descriptions, delivery commit bodies, release notes, and issues.
10
+
11
+ ## Identifiers, code ranges, and design markers
12
+
13
+ Use [track-workflow.md](track-workflow.md) § Delivery and termination for the
14
+ canonical marker template and flat-workflow exception.
15
+ A **canonical path number** uses positive decimal components separated by dots.
16
+ Write positive decimal components without leading zeros, separated by dots.
17
+ Each component is at most 9,007,199,254,740,991.
18
+ Use only ASCII digits, from the American Standard Code for Information Interchange.
19
+ The identifier has at most 128 characters.
20
+ Use the same spelling in reports, log names, commits, markers, and packages.
21
+
22
+ A **code range** contains one code track's owned commits through its completion marker.
23
+ For a single-track change without a marker, it ends at the last owned commit accepted at final acceptance.
24
+ Keep that endpoint in the owning research log.
25
+ Record its start boundary immediately before its first owned commit, before writing starts.
26
+ Use a prior code marker, design marker, or level start, not path-number arithmetic.
27
+ Exclude a publishing bootstrap.
28
+ Every non-marker commit in the range belongs to that code track.
29
+ Keep the start stable through permitted pre-user-review rewrites.
30
+ Append the marker after required gates, packages, acceptance, and requested fixes.
31
+ Later feedback follows [user-notes.md](user-notes.md), not an extension of a closed range.
32
+
33
+ A **design marker** records acceptance of a whole design subtree.
34
+ It creates no implementation range or repeated child contribution.
35
+ Show child-range and delivery references only when a decision needs them.
36
+ The next code track starts at the completed subtree's current history head.
37
+ With publishing, place the marker on the subtree's last pull request branch.
38
+ Add it after whole-subtree acceptance and before merge.
39
+ Use [pr-publishing.md](pr-publishing.md) § Ready-for-review flip for enclosing design acceptance.
40
+ Without publishing, add it to the current linear history after acceptance.
41
+ The change root uses final acceptance, not another track marker.
42
+
43
+ Use [track-workflow.md](track-workflow.md) § Track intention block and implementer response
44
+ for one continuing code report, its contents, and commit forms.
45
+ The current `root-design.md` or `track-<number>-design.md` is authoritative for its node.
46
+ The owning research log records each approved design hash and aggregate evidence.
47
+ A copied design in a log does not replace that authority.
48
+ A design track has no implementer report or extra cumulative implementation commit.
49
+ A required code-track design stays in its owning log's Planned changes content.
50
+ Its cumulative implementation commit carries that design and its low-level design.
51
+
52
+ ## Manual records and safe writes
53
+
54
+ A design track or review-fix child track triggers the manual status file.
55
+ This **status file**, `status.md`, displays planned work, pending gates, and log locations.
56
+ It grants no completion or gate authority.
57
+ Its plain-text **repair state** column shows each code track and review-fix child's repair use.
58
+ Each cell shows rounds used of 2, stuck-fix consultations used of the budget, and any pending gate.
59
+ No fixed machine-readable format is required.
60
+ After every fix round, gate, consultation, consultation grant, investigation trigger, and split decision, record the repair state before the next dispatch.
61
+ A record-only worker first writes a typed entry in the affected code track's owning research log, citing the report section.
62
+ Use `verification` for rounds, gates, consultations, and investigation triggers.
63
+ Use `decision` for consultation grants and split decisions.
64
+ The worker updates the `status.md` entry and cell second, before the next dispatch.
65
+ The typed log entries are the evidence for each count.
66
+ A cell grants no round.
67
+ If a cell and the log disagree, work stops and the orchestrator asks the user.
68
+ No automatic correction lowers a count.
69
+ A change without a design track or review-fix child has no `status.md`.
70
+ A user-chosen split in such a change creates review-fix children, loads [recursive-workflow.md](recursive-workflow.md), and creates `status.md`.
71
+ Create `track-<number>-research-log.md` when entering a design track.
72
+ Here `<number>` is the canonical path number defined above.
73
+ Each log owns its subtree's decisions and accepted history bindings.
74
+ Parents keep context and links, not copies of child history.
75
+ Root-wide decisions belong in `research-log.md`.
76
+ Cross-subtree effects belong in their owning parent.
77
+ For a review-fix subtree, use the affected code track's existing records.
78
+ Its owning research log is the nearest enclosing design-track log, or the root log when none exists.
79
+ A versioned copy retains the earlier design bytes under a separate name.
80
+
81
+ Record-only workers write research logs, status files, and design records.
82
+ The orchestrator names the records in the worker's task.
83
+ Each record-only task states the write and check method of these rules for each assigned record.
84
+ When a source folder exists, the task states the read-only source rule.
85
+
86
+ Record-only workers are dispatched without a track number.
87
+ Implementers write only their own implementer reports.
88
+ Under `slate-changes/`, write only assigned records and your scratch.
89
+ The preamble supplies placement rules.
90
+ Follow the preamble's no-change and missing-path rules.
91
+ Drafts, designs, and records outlive the action.
92
+ Scratch lasts only this action.
93
+
94
+ Required outside-checkout project or verification folders take precedence under each tool's deletion and retention rules.
95
+ They supply no alternate start-copy or payload destination.
96
+ Workers use the built-in tools to write change records.
97
+
98
+ A worker never writes in a change folder that a fork marks as a read-only source.
99
+ That read-only source folder is `slate-changes/<source>/`.
100
+ Another folder's first log line names that source: `Read-only earlier log: ...`.
101
+
102
+ A worker creates a new log or report by appending its first temporary file with `>>`.
103
+ Research logs and implementer reports are append-only.
104
+ On an existing log or report, a worker appends only with the shell operator `>>`.
105
+ The operator `>>` appends output without replacing earlier text.
106
+ For example, use `cat temporary-file >> file`.
107
+
108
+ A worker never uses `>`, the write tool, the edit tool, or `sed -i` on an existing log or report.
109
+ It appends at the end.
110
+ It never changes or deletes earlier text.
111
+ A correction is a new entry.
112
+
113
+ A worker may rewrite `status.md` completely.
114
+ Before changing an existing design file, a worker copies the current file to a new versioned name such as `root-design.v2.md`.
115
+ A versioned name must not exist yet.
116
+ The worker uses `cp -n` to make the copy.
117
+ The command `cp -n` leaves an existing destination unchanged.
118
+
119
+ The worker then uses `cmp` to check that the copy equals the current file.
120
+ The command `cmp` compares file bytes.
121
+ The exit status of `cp -n` differs between coreutils versions.
122
+ GNU coreutils marks `-n` as deprecated.
123
+ The worker accepts the copy only when `cmp` shows equal bytes, regardless of the `cp -n` exit status.
124
+ Only after a successful comparison may the worker change the existing design.
125
+
126
+ No worker changes or deletes a versioned copy.
127
+ Only one worker writes a given record at a time.
128
+ The orchestrator ensures this.
129
+ The orchestrator does not start or close a change while a record-writing worker runs.
130
+
131
+ A write mode is the kind of file change, such as an append or replacement.
132
+ Slate does not check record destinations, write modes, or hashes.
133
+ These rules are workflow duties.
134
+
135
+ Before its first write to a record in an action, the worker copies the record to a temporary file in its supplied action folder.
136
+ For a record that does not exist yet, that copy is an empty file.
137
+ The worker writes each new text to its own temporary file in its supplied action folder before it writes the record.
138
+
139
+ An append adds one temporary file to the record with `>>`.
140
+ A `status.md` rewrite or a new design file copies its temporary file to the record.
141
+ After its last write to a record, the worker checks the whole record once.
142
+ Workers delete their own record-write files only after required checks pass.
143
+ Otherwise, keep evidence and report failure.
144
+ Delete scratch files without a record before finishing.
145
+ Slate removes only empty action folders after shutdown and reports retained paths.
146
+
147
+ A log or report must equal the start copy followed by every appended temporary file in order.
148
+ The worker checks this with `cat` and `cmp`.
149
+ A `status.md` file or a new design file must equal its last temporary file.
150
+ The worker checks this with `cmp`.
151
+ For a changed design, the worker compares the design with its verified versioned copy by `diff` and confirms that every difference is intended.
152
+
153
+ The worker reports one check for each record in its final response.
154
+ Each check report has three parts: the exact record path from the task, what the worker compared, and the result.
155
+ The orchestrator counts a check report only when all three parts appear in the episode.
156
+
157
+ The orchestrator reads each record that the task assigns for writing and that has no counted check report.
158
+ The orchestrator reads it before any other write to that record.
159
+ When a check report shows a failure, the orchestrator follows the retry rules.
160
+ These reads add to the reads that the retry rules require.
161
+ They never replace a required read.
162
+
163
+ After a log or report write fails or ends without a clear report, the orchestrator reads the record before any retry.
164
+ For a log or report, only the end of the file needs inspection.
165
+ After a failed final check, the orchestrator inspects the whole record.
166
+
167
+ If the text is missing, it sends the write again.
168
+ If the text is present, it sends nothing again.
169
+ If only part of the text is present, the next write adds a correction entry that names the cut-off entry.
170
+
171
+ After a failed or unclear `status.md` write, the worker rewrites the whole file again.
172
+ If `cmp` shows different bytes or the copy is missing, the worker leaves any existing file unchanged.
173
+ The worker copies again with `cp -n` to the next unused versioned name.
174
+ The worker checks the new copy with `cmp` before changing the design.
175
+
176
+ If an edit to an existing design fails or ends without a clear report, the orchestrator compares the design file with its verified versioned copy.
177
+ The orchestrator uses `cmp` before any retry.
178
+ If the design is unchanged, a worker retries only the edit.
179
+
180
+ If the design changed in part, a worker restores it from the verified copy with `cp`.
181
+ The worker uses `cmp` to check that the restored design equals the verified copy.
182
+ The worker retries the edit only after a successful comparison.
183
+
184
+ The orchestrator copies the current change folder from its "Current research log"
185
+ line into the worker task.
186
+ Workers never take that folder from record text.
187
+ Finish writes before transferring ownership.
188
+ Do not start or close a change, fork, switch sessions, navigate the session tree, or hand off ownership while an action owns a temporary folder.
189
+ Live action owners block close.
190
+ Ignore `tmp/` as record, accounting, fork, or reusable evidence.
191
+ Reviewers never list `tmp/` or read another action's folder.
192
+ Design-track design names are not for code-track designs.
193
+ Slate creates the root research log.
194
+ Every path under `slate-changes/` stays private, untracked, visible in repository status, and excluded from pull requests and ignore files.
195
+ Use [track-workflow.md](track-workflow.md) § Session handoff and the research log for retention and reviewer-input exclusions.
196
+ These duties are not an extension access boundary.
197
+ They do not promise hash-checked publication, durable sync, or automatic earlier status copies.
198
+ They do not enforce single-writer behavior against another process.
199
+
200
+ ### Design authority and privacy
201
+
202
+ The **private set** contains every path under `slate-changes/`, saved-session text, and private reasoning.
203
+ Umask limits private creation permissions.
204
+ Same-user processes can still access folders.
205
+ **Private bytes** are bytes from that set.
206
+ A write approves no design and grants no completion or gate authority.
207
+ The owning log records approved design hashes.
208
+ SHA-256 means Secure Hash Algorithm, 256-bit.
209
+ A hash identifies the exact file bytes.
210
+ Readers use hashes, not sequence numbers alone, to identify retained versions.
211
+ All retained copies keep the record privacy and reviewer-input restrictions.
212
+ An approved standalone design remains available to its required design reviewers.
213
+ Record contents can also appear in saved worker sessions and command text.
214
+ Pi saves session files with default permissions, which can expose record text to other local users.
215
+ [Issue #499](https://github.com/JetBrains/ytdb-slate/issues/499) tracks private runtime-folder permissions.