codeassembly-guidance 0.2.0 → 0.4.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/.meta/changelog.json +291 -0
- package/CHANGELOG.md +82 -0
- package/README.md +20 -121
- package/content/_partials/README.md +19 -3
- package/content/_partials/diff-audit-checklist.md +1 -0
- package/content/_partials/guidance-change-since-capture.md +9 -0
- package/content/_partials/kb-standard-tags.md +7 -0
- package/content/codeassembly-content.yaml +8 -0
- package/content/collections/recommended.md +1 -1
- package/content/guidance/README.md +1 -1
- package/content/guidance/rulebooks/cli-conventions.md +16 -2
- package/content/guidance/rulebooks/codeassembly-content-specification.md +19 -2
- package/content/guidance/rulebooks/commit-conventions.md +3 -2
- package/content/guidance/rulebooks/williamthorsen-collaboration-preferences.md +6 -2
- package/content/guidance/rulebooks/williamthorsen-writing-preferences.md +28 -1
- package/content/guidance/shared/AGENTS.md +31 -4
- package/content/scripts/check-prose.mjs +38 -38
- package/content/scripts/describe-change.mjs +69 -69
- package/content/scripts/manage-jira-ticket.mjs +73 -73
- package/content/scripts/select-lede-exemplars.mjs +53 -53
- package/content/scripts/validate-preferences.mjs +1 -1
- package/content/skills/_data/action-items.md +2 -0
- package/content/skills/_data/artifact-conventions.md +24 -3
- package/content/skills/_data/complexity-classification.md +1 -1
- package/content/skills/_data/design-priorities.md +12 -1
- package/content/skills/_data/spike-conventions.md +21 -6
- package/content/skills/_data/title-templates.md +3 -1
- package/content/skills/_partials/apply-guidance-edits.md +5 -0
- package/content/skills/_partials/cluster-feedback-events.md +21 -0
- package/content/skills/_partials/commit-title-rendering.md +1 -1
- package/content/skills/_partials/next-steps-after-plan.md +1 -1
- package/content/skills/_partials/option-format.md +2 -2
- package/content/skills/_partials/plan-template.md +4 -2
- package/content/skills/_partials/ticket-and-plan-completeness.md +1 -1
- package/content/skills/_partials/ticket-composition.md +40 -0
- package/content/skills/_partials/ticket-skeleton.md +15 -1
- package/content/skills/align-ticket-with-implementation/SKILL.md +1 -5
- package/content/skills/assess-code-health/SKILL.md +127 -0
- package/content/skills/assess-code-health/assess-code-health.mjs +77 -0
- package/content/skills/assess-usability/SKILL.md +3 -1
- package/content/skills/capture-event/SKILL.md +2 -0
- package/content/skills/capture-event/capture-event.mjs +32 -32
- package/content/skills/capture-feedback/SKILL.md +1 -1
- package/content/skills/collaborate/SKILL.md +2 -2
- package/content/skills/create-bitbucket-pr/SKILL.md +2 -1
- package/content/skills/create-commit/SKILL.md +1 -1
- package/content/skills/create-gh-pr/SKILL.md +4 -1
- package/content/skills/create-pr/SKILL.md +2 -1
- package/content/skills/create-ticket/SKILL.md +3 -7
- package/content/skills/curate-feedback/SKILL.md +102 -0
- package/content/skills/curate-feedback/curate-feedback.mjs +211 -0
- package/content/skills/derive-session-context/derive-session-context.mjs +94 -94
- package/content/skills/design-and-plan/SKILL.md +5 -9
- package/content/skills/implement-plan/SKILL.md +2 -2
- package/content/skills/index-prototypes/SKILL.md +1 -1
- package/content/skills/kb-add/SKILL.md +2 -0
- package/content/skills/kb-add/kb-add.mjs +53 -53
- package/content/skills/kb-curate/kb-curate.mjs +64 -64
- package/content/skills/kb-edit/SKILL.md +2 -0
- package/content/skills/kb-edit/kb-edit.mjs +59 -59
- package/content/skills/kb-retrieve/kb-retrieve.mjs +75 -75
- package/content/skills/kb-retrieve-events/SKILL.md +19 -10
- package/content/skills/kb-retrieve-events/kb-retrieve-events.mjs +75 -75
- package/content/skills/kb-update-events/SKILL.md +9 -6
- package/content/skills/kb-update-events/kb-update-events.mjs +86 -85
- package/content/skills/lesson-clusters/lesson-clusters.mjs +209 -0
- package/content/skills/migrate-feedback-memories/feedback-memories.mjs +75 -75
- package/content/skills/plan/SKILL.md +1 -1
- package/content/skills/refine-guidance/SKILL.md +97 -0
- package/content/skills/review-branch/SKILL.md +350 -1
- package/content/skills/revise-prose/revise-prose.mjs +103 -103
- package/content/skills/save-artifact/SKILL.md +1 -1
- package/content/skills/streamline-guidance/SKILL.md +10 -15
- package/content/skills/streamline-guidance/streamline-guidance.mjs +74 -74
- package/content/skills/summarize-change/SKILL.md +1 -1
- package/content/skills/testing-conventions/SKILL.md +7 -1
- package/content/skills/triage-feedback/SKILL.md +135 -0
- package/content/skills/triage-feedback/triage-feedback.mjs +70 -0
- package/content/skills/triage-spike-findings/SKILL.md +6 -6
- package/content/skills/triage-spike-findings/triage-spike-findings.mjs +30 -28
- package/content/skills/update-project-guidance/SKILL.md +10 -10
- package/content/subagents/code-health-assessor.md +98 -0
- package/content/subagents/feedback-coverage-judge.md +95 -0
- package/content/subagents/feedback-triage-challenger.md +86 -0
- package/content/subagents/lesson-clusterer.md +68 -0
- package/package.json +13 -13
- package/schemas/preferences.v1.json +22 -6
- package/schemas/work-types.v1.json +1 -1
- package/content/_partials/code-descriptions.md +0 -4
- package/content/_partials/code-style.md +0 -7
- package/content/_partials/live-repo-writes.md +0 -13
- package/content/_partials/reduced-object-relative.md +0 -28
- package/content/_partials/test-structure-audit-checklist.md +0 -7
- package/content/skills/_partials/acceptance-criteria-scaffold.md +0 -15
- package/content/skills/_partials/next-steps-after-review.md +0 -350
- package/content/skills/_partials/ticket-concision.md +0 -18
- package/content/skills/_partials/ticket-placement.md +0 -14
- package/content/skills/_partials/ticket-skeleton-tiers.md +0 -6
|
@@ -8,7 +8,7 @@ user-invocable: true
|
|
|
8
8
|
|
|
9
9
|
Record feedback on the agent's behavior as evidence for a future guidance refinement, applying the immediate fix when there is something concrete to change. The user describes a correction or a desired behavior, the agent applies it when applicable, and the agent appends a generalized record that a later recall-driven pass reads to refine guidance.
|
|
10
10
|
|
|
11
|
-
The actual guidance refinement is **deferred**: This skill captures the candidate, it does not edit the skill, subagent, rulebook, general guidance, or helper. A later pass refines the guidance in bulk, recalling the accumulated `feedback` records together, so a single data point never over-fits a rule.
|
|
11
|
+
The actual guidance refinement is **deferred**: This skill captures the candidate, it does not edit the skill, subagent, rulebook, general guidance, or helper. A later pass refines the guidance in bulk, recalling the accumulated `feedback` records together, so a single data point never over-fits a rule: {skill?:triage-feedback} clusters the records by lesson and surfaces the lessons worth a guidance change, and {skill?:refine-guidance} makes the change.
|
|
12
12
|
|
|
13
13
|
**Announce at start:** "Using capture-feedback to apply this and record it for guidance refinement."
|
|
14
14
|
|
|
@@ -13,7 +13,7 @@ This skill is invoked by a directive in the harness's global guidance during int
|
|
|
13
13
|
## Principles
|
|
14
14
|
|
|
15
15
|
- Act as a conscientious collaborator, not a mindless code generator.
|
|
16
|
-
- **Never make changes unless asked.** If the developer asks a question, answer it. If they comment on your work, address the comment. They are engaging in discussion.
|
|
16
|
+
- **Never make changes unless asked.** If the developer asks a question, answer it with an answer, not a procedure for them to run, and run any check that the answer needs. If they comment on your work, address the comment. They are engaging in discussion.
|
|
17
17
|
- Don't let refactoring grow beyond the task; recommend the scope call, build on it, and raise it at the checkpoint.
|
|
18
18
|
- Ask for guidance on naming and approach when the choice turns on the developer's preference; when a convention or the merits already settle it, state the decision with its reason and proceed.
|
|
19
19
|
- Proceed provisionally: Decide what the gate lets you decide, record it, and collect the surviving asks into one review at the checkpoint.
|
|
@@ -43,7 +43,7 @@ If the right answer depends on context that you don't yet have, get it before we
|
|
|
43
43
|
|
|
44
44
|
## Asking questions
|
|
45
45
|
|
|
46
|
-
Not every response needs to end with a question. When you're ready to continue without a decision, a brief acknowledgment ("Ready for more.", "Got it.") is often better than inventing a question to fill the slot. A question that you could answer from evidence that you already hold is the same failure in a more diligent form: Answer it, give the reason in a clause, and carry on.
|
|
46
|
+
Not every response needs to end with a question. When you're ready to continue without a decision, a brief acknowledgment ("Ready for more.", "Got it.") is often better than inventing a question to fill the slot. A question that you could answer from evidence that you already hold is the same failure in a more diligent form: Answer it, give the reason in a clause, and carry on. When the developer signals overload, stop asking until they ask for something, per the "Prompt formatting" section of the collaboration preferences.
|
|
47
47
|
|
|
48
48
|
When you do ask, prefer forms that the user can answer unambiguously:
|
|
49
49
|
|
|
@@ -21,6 +21,7 @@ This skill receives the following inputs from the orchestrator:
|
|
|
21
21
|
| `ticket_id` | string | Ticket ID for artifact path resolution |
|
|
22
22
|
| `project_slug` | string | Project slug for artifact path resolution |
|
|
23
23
|
| `artifact_base_dir` | string | Base directory for artifact storage |
|
|
24
|
+
| `initial_state` | string | `draft` to open the pull request as a draft, `ready` to open it ready for review |
|
|
24
25
|
|
|
25
26
|
## Process
|
|
26
27
|
|
|
@@ -32,7 +33,7 @@ Call `action: "create"` on the tool named in [Bitbucket pull-request access](../
|
|
|
32
33
|
- **Description**: Use `body` as provided.
|
|
33
34
|
- **Source branch**: Use the current branch, `git rev-parse --abbrev-ref HEAD`. The action requires it, and the delegate interface does not have a head-branch input.
|
|
34
35
|
- **Destination branch**: Use `base_branch`.
|
|
35
|
-
- **Draft/WIP**:
|
|
36
|
+
- **Draft/WIP**: When `initial_state` is `draft`, create as draft if the platform supports it. When it is `ready`, create an open pull request.
|
|
36
37
|
|
|
37
38
|
### 2. Report every label as skipped
|
|
38
39
|
|
|
@@ -46,7 +46,7 @@ Record each unit as it is finished. Several single-concern commits read better t
|
|
|
46
46
|
git commit --file "$body_path"
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
7. **Report the result**: the new commit's short SHA and title, or, when step 2 stopped or the commit failed, why nothing was committed.
|
|
49
|
+
7. **Report the result**: the new commit's short SHA and title, or, when step 2 stopped or the commit failed, why nothing was committed. Do not comment on the title's format. The template sets which tokens the title contains, a ticket reference among them, so neither a token that the title omits nor a difference from earlier commits is a finding.
|
|
50
50
|
|
|
51
51
|
## Work type test
|
|
52
52
|
|
|
@@ -21,6 +21,7 @@ This skill receives the following inputs from the orchestrator:
|
|
|
21
21
|
| `ticket_id` | string | Ticket ID for artifact path resolution |
|
|
22
22
|
| `project_slug` | string | Project slug for artifact path resolution |
|
|
23
23
|
| `artifact_base_dir` | string | Base directory for artifact storage |
|
|
24
|
+
| `initial_state` | string | `draft` to open the pull request as a draft, `ready` to open it ready for review |
|
|
24
25
|
|
|
25
26
|
## Process
|
|
26
27
|
|
|
@@ -41,11 +42,13 @@ gh pr create \
|
|
|
41
42
|
--title "{title}" \
|
|
42
43
|
--body-file "$body_path" \
|
|
43
44
|
--base "{base_branch}" \
|
|
44
|
-
|
|
45
|
+
{draft_flag} \
|
|
45
46
|
--assignee "@me" \
|
|
46
47
|
{label_flags}
|
|
47
48
|
```
|
|
48
49
|
|
|
50
|
+
`{draft_flag}` is `--draft` when `initial_state` is `draft`, and is left out of the call entirely when it is `ready`. Write it into the call as literal text, as the label flags are.
|
|
51
|
+
|
|
49
52
|
`--assignee "@me"` assigns the pull request to the authenticated `gh` user, who is the developer creating it.
|
|
50
53
|
|
|
51
54
|
`gh pr create` prints the pull-request URL. Read it from the command's output and include it in step 5's artifact and the completion line; never capture it into a shell variable.
|
|
@@ -21,7 +21,7 @@ Both are passed to `summarize-change`, which records them as overrides beside th
|
|
|
21
21
|
|
|
22
22
|
### 1. Get session context
|
|
23
23
|
|
|
24
|
-
Invoke `node {harness_home_dir}/skills/derive-session-context/derive-session-context.mjs` via Bash. The bundle emits the session-context manifest JSON to stdout; extract `ticket_id`, `ticket_ref`, `project_slug`, `scm`, `default_branch`, `branch_name`, and `
|
|
24
|
+
Invoke `node {harness_home_dir}/skills/derive-session-context/derive-session-context.mjs` via Bash. The bundle emits the session-context manifest JSON to stdout; extract `ticket_id`, `ticket_ref`, `project_slug`, `scm`, `default_branch`, `branch_name`, `artifact_base_dir`, and `pr_initial_state` from it.
|
|
25
25
|
|
|
26
26
|
### 2. Check branch sync
|
|
27
27
|
|
|
@@ -134,6 +134,7 @@ Pass the following inputs to the selected delegate per the delegate interface:
|
|
|
134
134
|
| `ticket_id` | From session context |
|
|
135
135
|
| `project_slug` | From session context |
|
|
136
136
|
| `artifact_base_dir` | From session context |
|
|
137
|
+
| `initial_state` | `pr_initial_state` from session context: `draft` or `ready` |
|
|
137
138
|
|
|
138
139
|
### 11. Persist the PR URL
|
|
139
140
|
|
|
@@ -61,18 +61,14 @@ Create the ticket body describing WHAT needs to be done: problem, context, and a
|
|
|
61
61
|
|
|
62
62
|
**Spike mode.** If the ticket describes a spike, use the spike ticket template in [spike conventions](../_data/spike-conventions.md) in place of the skeleton above.
|
|
63
63
|
|
|
64
|
-
<!-- include: ../_partials/ticket-
|
|
65
|
-
|
|
66
|
-
<!-- include: ../_partials/ticket-concision.md / -->
|
|
67
|
-
|
|
68
|
-
<!-- include: ../../_partials/prose-line-breaks.md / -->
|
|
69
|
-
|
|
70
|
-
<!-- include: ../_partials/ticket-placement.md / -->
|
|
64
|
+
<!-- include: ../_partials/ticket-composition.md / -->
|
|
71
65
|
|
|
72
66
|
`create-ticket` does not produce a plan, so _the implementation_ is derived when the work is later planned; state the subject and outcomes, and leave mechanism for that step.
|
|
73
67
|
|
|
74
68
|
<!-- include: ../_partials/ticket-criteria-conventions.md / -->
|
|
75
69
|
|
|
70
|
+
<!-- include: ../../_partials/prose-line-breaks.md / -->
|
|
71
|
+
|
|
76
72
|
Also draft the ticket string, per [`title-voice.md`](../_data/title-voice.md), for use in step 6.
|
|
77
73
|
|
|
78
74
|
Then decide the ticket's scope and type, for use in steps 5 and 6. The type is the [work type](../_data/work-types.json) of the change that the ticket asks for: a ticket reporting a defect is `fix`, and one asking for a new capability is `feat`. Append `!` only when the proposed change breaks consumers and the type's `breakingPolicy` admits the marker. The scope is the workspace that the change belongs to, per [Scope values](../_data/title-templates.md#scope-values); a change spanning more than one takes `*`, which does not render or label any scope. The pull request that implements the ticket compares its derived type with the type label applied here.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: curate-feedback
|
|
3
|
+
description: Cull the open feedback events that no longer need attention. Clusters the events by the lesson that they teach, has subagents without session context read the current guidance and sort every event into covered, duplicate, obsolete, or kept, and then, once the developer approves or under --apply, marks the culled events addressed-by or obsolete, recording the run in a curation artifact. Use when the feedback pool has grown with lessons that guidance has since absorbed, or before a triage-feedback run.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Curate feedback
|
|
8
|
+
|
|
9
|
+
Cull the feedback events that no longer need attention, and do nothing else: This skill does not surface lessons, file tickets, or edit guidance. You inventory and cluster the open `feedback` events, pin every guidance repository at a commit, have one {subagent:feedback-coverage-judge} per group of clusters sort each event into a bin, and then, once the developer approves, mark the culled events. Two bundled helpers do the mechanical work: `lesson-clusters` inventories and clusters the events, and `curate-feedback` prepares the judges' assignments, checks their bins, and writes the record and the artifact.
|
|
10
|
+
|
|
11
|
+
**Announce at start:** "Using curate-feedback to cull the feedback events that no longer need attention."
|
|
12
|
+
|
|
13
|
+
<HARD-GATE>
|
|
14
|
+
Never edit a guidance artifact: a skill, a subagent, a rulebook, a partial, a guidance file, or a helper. This skill marks events and nothing else.
|
|
15
|
+
</HARD-GATE>
|
|
16
|
+
|
|
17
|
+
## Arguments
|
|
18
|
+
|
|
19
|
+
| Argument | Effect | Default |
|
|
20
|
+
| ------------------ | ----------------------------------------------------------------------- | ----------- |
|
|
21
|
+
| `--store <name>` | The event store: a registry name, `@default`, or `@feedback`. | `@feedback` |
|
|
22
|
+
| `--apply` | Apply the marks without the approval checkpoint, for an unattended run. | Off |
|
|
23
|
+
| `--group-size <n>` | The most events in one judge's assignment. | 60 |
|
|
24
|
+
| `--list` | Show the per-event listing at the checkpoint and in the report. | Off |
|
|
25
|
+
|
|
26
|
+
## Bins and marks
|
|
27
|
+
|
|
28
|
+
Each judge sorts each event into one bin, and step 7 marks it accordingly:
|
|
29
|
+
|
|
30
|
+
- `covered`: Guidance at its pinned commit states the lesson, in a sentence that the judge quotes and that `validate` finds in the file. The event is marked `addressed-by` a GitHub permalink to the file at that commit.
|
|
31
|
+
- `duplicate`: An already-addressed event teaches the same lesson. The event is marked `addressed-by` that event's references, other than triage artifacts and covered permalinks.
|
|
32
|
+
- `obsolete`: The target was removed without a successor, a later deliberate decision overruled the lesson, or it concerns a harness or model no longer in use. The event is tagged `obsolete`.
|
|
33
|
+
- `kept`: The event stays in the pool, and nothing is written.
|
|
34
|
+
|
|
35
|
+
An event that is marked or tagged drops out of every later inventory, so a rerun continues where a run stopped.
|
|
36
|
+
|
|
37
|
+
## Process
|
|
38
|
+
|
|
39
|
+
`<store>` below is the `--store` argument, `@feedback` when it is omitted. Every helper command prints one JSON result. When a result has `ok: false`, stop and report its `error` and `message`, except when a step below says otherwise. Invoke the helpers as:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
node {harness_home_dir}/skills/lesson-clusters/lesson-clusters.mjs {command} {flags}
|
|
43
|
+
node {harness_home_dir}/skills/curate-feedback/curate-feedback.mjs {command} {flags}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 1. Preflight
|
|
47
|
+
|
|
48
|
+
1. Run `node {harness_home_dir}/skills/derive-session-context/derive-session-context.mjs` and read `artifact_base_dir`, `project_slug`, and `ticket_id`.
|
|
49
|
+
2. Fix the artifact's path. The directory is `{artifact_base_dir}/projects/{project_slug}/tickets/{ticket_id}/` when `ticket_id` is set, and `{artifact_base_dir}/projects/{project_slug}/feedback-curation/` otherwise; the `feedback-curation/` name is hardcoded. The filename is `{YYYYMMDD-HHMMSSZ}_{slug}_feedback-curation.md`, with the current UTC time and a slug per {skill:save-artifact}, or `curation` when nothing else suits.
|
|
50
|
+
3. Create the work directory `{timestamp}_work/` beside the artifact, where `{timestamp}` is the filename's prefix. Every working file goes there.
|
|
51
|
+
|
|
52
|
+
### 2. Pin the guidance
|
|
53
|
+
|
|
54
|
+
1. Run `codeassembly library list --json` and `codeassembly library list --global --json`, and collect the `dir` of every source in either listing. A listing that fails because its domain does not declare a source contributes nothing.
|
|
55
|
+
2. Run `curate-feedback pin --out {work}/pins.json`, with one `--source` for each collected directory and one for the current repository's root.
|
|
56
|
+
3. Report each `skipped` source with its reason: A judge cannot mark an event covered by guidance in a skipped source. Stop when `pins` is empty.
|
|
57
|
+
|
|
58
|
+
### 3. Cluster
|
|
59
|
+
|
|
60
|
+
<!-- include: ../_partials/cluster-feedback-events.md / -->
|
|
61
|
+
|
|
62
|
+
### 4. Assign
|
|
63
|
+
|
|
64
|
+
1. Run `curate-feedback references --store <store> --out {work}/references.json`.
|
|
65
|
+
2. Run `curate-feedback assign --inventory {work}/inventory.json --map {work}/map.json --references {work}/references.json --pins {work}/pins.json --out {work}/assignments`, adding `--group-size {n}` when it was given. Its `assignments` list gives each assignment's `path` and the `bins` path to which its judge writes.
|
|
66
|
+
|
|
67
|
+
### 5. Judge
|
|
68
|
+
|
|
69
|
+
1. Send one {tool:Task} call per assignment, all in one message, `subagent_type: feedback-coverage-judge`, each with this block and nothing else composed into it:
|
|
70
|
+
|
|
71
|
+
```dispatch
|
|
72
|
+
assignment: {assignment path}
|
|
73
|
+
output: {bins path}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
2. **A reply that lacks the `Phase: feedback-coverage` line is a judge stopped by its turn limit.** Resume that judge once, asking only for its bins file and its report; on Claude Code, send it a message with `SendMessage`, addressed by the agent ID that its dispatch returned.
|
|
77
|
+
3. Run `curate-feedback validate --assignments {work}/assignments --out {work}/record.json`. On `invalid-bins`, resume the judge of each bins file that the `violations` name once, sending it that file's violations and asking it to correct its bins file. Run `validate` again, and on a second failure, stop and report the violations.
|
|
78
|
+
|
|
79
|
+
### 6. Checkpoint: The marks
|
|
80
|
+
|
|
81
|
+
Under `--apply`, skip this step.
|
|
82
|
+
|
|
83
|
+
Present the `counts` lines that `validate` reports, one per bin, then the marks from `record.json`: one line per `marks.addressedBy` group, with its reference and event count, and one line for `marks.obsolete`. Under `--list`, add a table of every event in `record.json` with its summary, bin, reference, reason, and quote. Ask in the action-items block for one approval of every mark.
|
|
84
|
+
|
|
85
|
+
The developer may move events between bins by id in the reply. For each move, edit the entry in the bins file that the event's `file` in `record.json` names. A move into `covered` needs the guidance file, and a move into `duplicate` needs the addressed event; ask for either when the reply does not name it. For a move into `covered`, read the file at its pin with `git -C {root} show {sha}:{path}` and copy the sentence that states the lesson into the entry's `quote`. Then run `validate` again, and present only the changed counts and marks before writing. The approval covers every mark that step 7 applies.
|
|
86
|
+
|
|
87
|
+
<!-- include: ../_partials/action-items.md / -->
|
|
88
|
+
|
|
89
|
+
### 7. Apply
|
|
90
|
+
|
|
91
|
+
Nothing before this step writes to the store. For each group in `marks.addressedBy`, then for `marks.obsolete` when its `eventIds` is not empty, run {skill:kb-update-events} and write the result into the group's `result` in `record.json` as soon as it returns:
|
|
92
|
+
|
|
93
|
+
- **An `addressedBy` group**: `node {harness_home_dir}/skills/kb-update-events/kb-update-events.mjs --store <store> --add-addressed-by={the group's references, comma-joined} {event ids}`.
|
|
94
|
+
- **`obsolete`**: `node {harness_home_dir}/skills/kb-update-events/kb-update-events.mjs --store <store> --add-tag obsolete {event ids}`.
|
|
95
|
+
|
|
96
|
+
A result is `{ "ok": true, "failed": [] }` when every event's result has `ok: true`, and `{ "ok": false, "failed": [ids] }` otherwise. On a failed write or an `ok: false` result, stop applying, report which group failed, and continue to step 8, so that the artifact records what was applied.
|
|
97
|
+
|
|
98
|
+
### 8. Record and report
|
|
99
|
+
|
|
100
|
+
Run `curate-feedback render --file {work}/record.json --out {work}/artifact.md`. Save the rendered body, with frontmatter, at the artifact path fixed in step 1, per {skill:save-artifact}.
|
|
101
|
+
|
|
102
|
+
Report the `counts` lines, the marks applied, any failure, the skipped sources, and the artifact's path. Under `--list`, add the per-event table; otherwise leave the listing in the artifact. The report is the same under `--apply`.
|