slicekit 0.3.3 → 0.5.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.
@@ -1,21 +1,42 @@
1
1
  # Brief: ops
2
2
 
3
- You triage one symptom. You read the runbook, `observability.md`, the history of the files or services the symptom names and the last release record, and you return proposed actions. You change nothing outside your report.
3
+ You triage one symptom. The command gives you the symptom and its context: the files the symptom names, the history of those files (the slices and pull requests that touched them, each with its verdict and release), and the paths of the runbook, `observability.md` and the last release record. You read those three files and return proposed actions. You change nothing: you hold no tool that writes a file or runs a command.
4
4
 
5
5
  ## You write
6
6
 
7
- A proposed-actions report, at the path the command gives you, or as your reply when it names none. It holds:
7
+ No file. Your reply is the report, and the command saves it as you wrote it. It holds these three sections, under these headings:
8
8
 
9
- 1. The likely slices and pull requests, each with the files that tie it to the symptom.
10
- 2. The runbook's first checks for this symptom, quoted with their file and line.
11
- 3. The proposed actions, one per line, each marked by who may take it: `anyone`, `on-call`, or `owner` with the owner's name when the runbook gives one.
9
+ 1. `## Likely slices and pull requests`: one line per slice, with its address, its pull request as `#<n>` and the files that tie it to the symptom. Name only slices and pull requests the history you were given lists.
10
+ 2. `## First checks`: the runbook's first checks for this symptom, each quoted with its `<file>:<line>`. A check from `observability.md` or the release record carries its `<file>:<line>` the same way. When the runbook holds no check for the symptom, say so in one line.
11
+ 3. `## Proposed actions`: one list item per action, each ending with a mark of who may take it: `(anyone)`, `(on-call)`, or `(owner: <name>)` with the owner the runbook names. When you propose no action, the section holds the one line `None.` and nothing else.
12
+
13
+ A reply in this shape passes the check:
14
+
15
+ ```
16
+ ## Likely slices and pull requests
17
+
18
+ - P1/S-01, #1: src/billing/charge.js, src/billing/refund.js
19
+
20
+ ## First checks
21
+
22
+ - docs/runbook.md:14 When billing returns 500, read the charge and refund code first.
23
+
24
+ ## Proposed actions
25
+
26
+ - Read the service's log for the failing request (anyone)
27
+ - Revert pull request #1 on the host (on-call)
28
+ - Ask whether the charge limits changed (owner: Dana)
29
+
30
+ Skipped: the release record
31
+ Not checked: the service's log
32
+ ```
12
33
 
13
34
  ## You never
14
35
 
15
- - Change infrastructure, configuration, data or code.
16
- - Take an action you propose, even one marked `anyone`.
17
- - Run git, except the read-only `git diff`, `git log`, `git show` and `git status`. You never commit, push or revert.
36
+ - Change infrastructure, configuration, data, code or any document.
37
+ - Take an action you propose, even one marked `(anyone)`.
38
+ - Run git or any other command. You never commit, push or revert.
18
39
 
19
40
  ## Your report
20
41
 
21
- Your reply names the report's path, or holds the report. It ends with a `Skipped:` line naming the sources you did not read and then a `Not checked:` line naming what you did not verify. Each of these lines starts at the beginning of its line, with no list marker, bold or backticks. A reply without both lines is refused when you stop.
42
+ Your reply holds the report and nothing before it. It ends with a `Skipped:` line naming the sources you did not read and then a `Not checked:` line naming what you did not verify. Each of these lines starts at the beginning of its line, with no list marker, bold or backticks. The two lines end the Proposed actions section: nothing from the `Skipped:` line on is read as an action, so write every action above it. A reply without both lines is refused when you stop.
@@ -0,0 +1,40 @@
1
+ # /slicekit audit
2
+
3
+ Compare what the spec and the runbook claim with what the code, the tests and the CI history show,
4
+ and list each claim as `holds`, `drifted` or `unverifiable` (REQ-2.14). The area: {{args}}.
5
+
6
+ The area is a spec file's name without `.md`, a REQ prefix such as `REQ-2`, the word `runbook`, or
7
+ a path; `(none)` means every claim. This command changes no tracked file. Its report goes under
8
+ `.slicekit/reports/`, which the project's ignore rules cover, and is never committed. Every step
9
+ that reads the repository's history goes through `{{cli}}`; run no git or gh command yourself.
10
+
11
+ ## Steps
12
+
13
+ 1. Run `{{cli}} graph`, so the files the claims name are read from the latest history.
14
+ 2. Run `{{cli}} audit context {{args}}`; when the area is `(none)`, leave it out and run the command
15
+ with no area. Its first line is the report path. Then, for each claim in the area (each REQ block
16
+ of the spec, each `##` section of the runbook), it prints the claim's ID, its `<file>:<line>` and
17
+ its title, the files the claim names, and one `candidate` line for each commit that touched one of
18
+ those files after the claim's heading was last changed. It prints at most ten `candidate` lines
19
+ for a claim, the newest, then one line that counts the older ones and names the command that
20
+ prints them: `{{cli}} audit context <area> --all --no-report`. That form prints the context
21
+ alone, with every candidate and no report path, and reserves no report file, so the report of
22
+ this step stays the one the auditor writes. On exit 2 the area names no claim: print what it says and ask the human
23
+ for another area.
24
+ 3. Spawn the auditor in audit mode. Its brief is the output of `{{cli}} instructions auditor`. Give
25
+ it the whole output of step 2 and the report path, and tell it this is an audit, not a gap scan:
26
+ the claims are the ones listed, and the evidence is the code, the tests and the CI history. The
27
+ auditor writes the report at that path. Step 2 created that path as an empty file, so tell the
28
+ auditor to read it with the Read tool before the first write, or the Write tool refuses to
29
+ overwrite it.
30
+ 4. Run `{{cli}} audit check <report> {{args}} --every-claim`, with the same area as step 2 or none.
31
+ The check reads the area's claims from the spec and the runbook, as step 2 did. It prints
32
+ `ok <report>`, or one `<report>:<line> <message>` line per problem: a missing `## Claims` table,
33
+ a row for a claim that is not in the area, a claim of the area with no row, a claim with two
34
+ rows, a status that is not one of the three words, a
35
+ `drifted` row whose commit is not one of its claim's candidates. On findings, send them to the
36
+ auditor once and run the check again. When the check still finds a problem, print the findings
37
+ with the report path and go on to step 5.
38
+ 5. Print the report path and the count of rows for each status. Tell the human that the audit
39
+ changed nothing: each `drifted` row becomes a slice or a decision, by their hand, and each
40
+ `unverifiable` row is a claim with no test or check behind it.
@@ -0,0 +1,38 @@
1
+ # /slicekit ops
2
+
3
+ Triage one symptom: find the slices and pull requests that touched the files it names, the
4
+ runbook's first checks for it, and the actions someone could take, each marked by who may take it
5
+ (REQ-2.13). The symptom: {{args}}.
6
+
7
+ This command takes no action and changes no tracked file. Its report goes under
8
+ `.slicekit/reports/`, which the project's ignore rules cover, and is never committed. Every step
9
+ that reads the repository's history goes through `{{cli}}`; run no git or gh command yourself.
10
+
11
+ When the symptom is `(none)`, ask the human for it and stop until they answer.
12
+
13
+ ## Steps
14
+
15
+ 1. Run `{{cli}} graph`, so the history the next step reads holds the latest merged pull requests.
16
+ 2. Run `{{cli}} ops context "{{args}}"`, with the symptom in one pair of double quotes and any
17
+ double quote, backquote or dollar sign inside it removed. Its first line is the report path.
18
+ The rest names the files the symptom's words match, the history of those files, the runbook,
19
+ `observability.md` and the last release record.
20
+ - On exit 1 the symptom names no file in the graph. Ask the human which file, directory or
21
+ service is meant, then run the command again with `--path <path>` for each one they name.
22
+ - A `too broad:` line names a word that matches more than fifty files and was not expanded. Tell
23
+ the human; when that word is the one they meant, ask for a narrower path and add it with
24
+ `--path`.
25
+ 3. Spawn the ops agent. Its brief is the output of `{{cli}} instructions ops`. Give it the symptom
26
+ and the whole output of step 2, and tell it to read the runbook, `observability.md` and the
27
+ release record that output names. The agent holds no tool that writes a file or runs a command:
28
+ its reply is the report.
29
+ 4. Write the agent's reply, as it is, to the report path from step 2 with the Write tool. Change no
30
+ word of it. Step 2 created that path as an empty file, so read it with the Read tool before the
31
+ first write, or the Write tool refuses to overwrite it.
32
+ 5. Run `{{cli}} ops check <report>`. It prints `ok <report>`, or one `<report>:<line> <message>`
33
+ line per problem: a missing section, a slice or pull request the graph does not hold, a cited
34
+ `<file>:<line>` that does not exist, an action marked by no one. On findings, send them to the
35
+ agent once, write its new reply to the same path and run the check again. When the check still
36
+ finds a problem, print the findings with the report path and go on to step 6.
37
+ 6. Print the report path and the report's `## Proposed actions` section. Tell the human that no
38
+ action was taken: each proposed action is theirs, or the named owner's, to take.
@@ -9,8 +9,8 @@ what merged; it does not deploy (D-12).
9
9
 
10
10
  ## Steps
11
11
 
12
- 1. Run `{{cli}} release {{args}} --dry-run`. It writes nothing. When it exits 0 it prints the record
13
- it would write. When it exits 1 it prints one line per reason: a slice that is not merged, a
12
+ 1. Run `{{cli}} release {{args}} --dry-run`. It writes nothing but the migration of an older config,
13
+ which step 2 carries to the release branch. When it exits 0 it prints the record it would write. When it exits 1 it prints one line per reason: a slice that is not merged, a
14
14
  slice with no recorded pull request, a slice that says `runbook: yes` and neither changed a
15
15
  section of the runbook nor gave a Runbook line that begins "no operational change", or a record
16
16
  that already exists. Print those lines to the human and stop: the release waits for each one.
@@ -18,7 +18,9 @@ what merged; it does not deploy (D-12).
18
18
  puts the session on `release/<slug>` at the tip of the default branch as origin has it; a
19
19
  `release/<slug>` left behind that tip with no commit of its own is moved there, and the command
20
20
  says so. When `release/<slug>` holds commits the default branch lacks, it asks the git host for
21
- an open pull request of that branch and exits 1 with one of three lines:
21
+ an open pull request of that branch and exits 1 with one of three lines. It asks the same of
22
+ each numbered branch of the slug, `release/<slug>-<n>`, that holds such commits, whatever
23
+ `release/<slug>` holds, and the first two lines then name that branch:
22
24
  1. `release/<slug> is the branch of open pull request #<n> (<url>); the phase's release is
23
25
  already open`: print the line to the human and stop. Take no other slug: merging or closing
24
26
  that pull request is the human's.
@@ -45,7 +47,10 @@ what merged; it does not deploy (D-12).
45
47
  **Decisions:** <the lines under "## Decisions" in the record, one per line, or "none">
46
48
  ```
47
49
 
48
- 6. Run `{{cli}} pr open --title "[release] {{args}}" --body-file <file> --commit "docs(release): {{args}}" --paths <docsRoot>/releases/{{args}}.md,.slicekit/state,BUILD.md`.
50
+ 6. Run `{{cli}} pr open --title "[release] {{args}}" --body-file <file> --commit "docs(release): {{args}}" --paths <docsRoot>/releases/{{args}}.md,.slicekit/state,BUILD.md,.slicekit/config.json`.
51
+ The last path is the config: when an earlier command, such as step 1, wrote the migration of an
52
+ older config, step 2 carried it to the release branch, and this step commits it there (D-94).
53
+ A config with no change adds nothing to the commit.
49
54
  7. Print the pull request line `pr open` printed, and tell the human that merging the pull request
50
55
  is the release of {{args}} in this repository, and that it deploys nothing: deployment stays the
51
56
  team's (D-12).