Skip to content

Commit 7a4b08b

Browse files
committed
fix(ci): improve auto bm note narrative
Signed-off-by: phernandez <paul@basicmachines.co>
1 parent a6cfed9 commit 7a4b08b

6 files changed

Lines changed: 526 additions & 63 deletions

File tree

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,51 @@
11
# Memory CI Capture
22

3-
You turn GitHub delivery context into a concise project update synthesis for
4-
Basic Memory. GitHub records the mechanics. Basic Memory remembers what changed
5-
and why.
3+
You turn GitHub delivery context into a durable project update for Basic Memory.
4+
GitHub records the mechanics. Basic Memory remembers what changed and why.
65

76
## Inputs
87

98
- Read `.github/basic-memory/project-update-context.json`.
9+
- Read the PR diff before writing when a SHA is available. Useful commands:
10+
`git show --stat --name-only <sha>` and `git show --format=fuller --no-patch <sha>`.
11+
- Use linked issue details, changed files, commit messages, PR body, labels, and
12+
source links as evidence.
1013
- Treat GitHub payload fields as immutable facts.
1114
- Do not invent tests, deployment status, issues, or user impact.
1215

16+
## Writing Standard
17+
18+
Do not write a fill-in-the-blanks note. Tell the story from the PR:
19+
problem -> solution -> impact.
20+
21+
Explain what problem was being addressed. If linked issue details are present,
22+
use them. If they are absent, ground the problem in the PR body, title, commits,
23+
and diff, and say when the original problem statement is unavailable.
24+
25+
Explain why the fix solves the problem, what complexity it introduced, what it
26+
refactored or removed, which components changed, and how the system is different
27+
after the merge. Prefer specific component names, file paths, modules, commands,
28+
and behavior over generic phrases.
29+
1330
## Output
1431

1532
Return only JSON that matches the provided AgentSynthesis schema:
1633

17-
- `summary`: what changed.
18-
- `why_it_matters`: why this project update matters for future humans and agents.
34+
- `summary`: one concise sentence; do not merely repeat the PR title.
35+
- `story`: 2-4 sentences that connect problem -> solution -> impact.
36+
- `problem_addressed`: the concrete problem, bug, missing capability, or delivery need.
37+
- `solution`: why this change solves the problem.
38+
- `system_impact`: how the system, workflow, or architecture changed after the merge.
39+
- `why_it_matters`: durable project-memory context for future humans and agents.
40+
- `components_changed`: modules, workflows, commands, schemas, docs, or services touched.
41+
- `complexity_introduced`: tradeoffs, new moving parts, operational costs, or edge cases.
42+
- `refactors_or_removals`: cleanup, simplification, deleted paths, or "none found".
1943
- `user_facing_changes`: visible behavior or product changes.
2044
- `internal_changes`: implementation, infrastructure, or operational changes.
2145
- `verification`: checks, tests, deploy evidence, or explicit unknowns.
2246
- `follow_ups`: concrete remaining work only.
2347
- `decision_candidates`: explicit product or architecture decisions only.
2448
- `task_candidates`: concrete future tasks only.
2549

26-
Prefer source links and grounded phrasing. This is project memory, not marketing
27-
copy and not a commit-by-commit changelog.
50+
Use empty arrays only when a list truly has no grounded entries. This is project
51+
memory, not marketing copy and not a commit-by-commit changelog.

.github/workflows/basic-memory.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
3232
- name: Collect project update context
3333
id: collect
34+
env:
35+
GITHUB_TOKEN: ${{ github.token }}
3436
run: |
3537
bm ci collect \
3638
--config .github/basic-memory/config.yml \

src/basic_memory/ci/README.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ Basic Memory CI turns meaningful GitHub delivery moments into durable
44
`project_update` notes in Basic Memory.
55

66
GitHub records the mechanics: pull requests, workflow runs, SHAs, URLs, labels,
7-
and timestamps. The agent reads those facts and writes a short synthesis of what
8-
changed and why it matters. The Basic Memory CLI owns authentication, schema
9-
guidance, idempotency, and publishing.
7+
changed files, commits, linked issues, and timestamps. The agent reads those
8+
facts and writes the delivery story: what problem was being addressed, why the
9+
fix solved it, what changed in the system, what complexity or cleanup came with
10+
it, and why future humans or agents should care. The Basic Memory CLI owns
11+
authentication, schema guidance, idempotency, and publishing.
1012

1113
The product voice is:
1214

@@ -127,15 +129,22 @@ Reads the current GitHub event payload and normalizes it into
127129
`ProjectUpdateContext`. This command decides whether the event is eligible.
128130
Merged pull requests and configured successful production deploy workflow runs
129131
are eligible. Routine CI runs, failed deploys, and unmerged PR closures are
130-
no-ops. In v0, collection is intentionally limited to the GitHub event payload;
131-
GitHub API enrichment for file lists, checks, reviews, or commit lists can be
132-
added later without changing the publishing boundary.
132+
no-ops.
133+
134+
For merged pull requests, the generated workflow passes `GITHUB_TOKEN` to
135+
`bm ci collect` so the context can include changed files, commit messages, and
136+
linked issue details. If `GITHUB_TOKEN` is unavailable, local collection still
137+
uses the event payload fields. If the token is present and GitHub API enrichment
138+
fails, the Auto BM workflow fails fast instead of publishing a weak note.
133139

134140
`bm ci agent-schema`
135141

136142
Writes the optional `AgentSynthesis` JSON schema used by the generated workflow
137143
as a CI guardrail. This schema is not a Basic Memory domain schema and is not
138-
committed by setup.
144+
committed by setup. The schema intentionally requires narrative fields such as
145+
`story`, `problem_addressed`, `solution`, `system_impact`,
146+
`components_changed`, `complexity_introduced`, and `refactors_or_removals` so
147+
the agent does more than fill out shallow buckets.
139148

140149
`bm ci publish`
141150

@@ -180,7 +189,7 @@ project-updates/github/<owner>/<repo>/
180189

181190
- `ProjectUpdateConfig`: non-secret repo configuration.
182191
- `ProjectUpdateContext`: normalized immutable GitHub facts.
183-
- `AgentSynthesis`: agent-authored summary fields.
192+
- `AgentSynthesis`: agent-authored narrative fields.
184193
- `ProjectUpdateNote`: final Basic Memory note payload.
185194
- workflow, prompt, and schema-note seed rendering.
186195

0 commit comments

Comments
 (0)