You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scratchpad/dev.md
+208-2Lines changed: 208 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# Developer Instructions
2
2
3
-
**Version**: 3.8
4
-
**Last Updated**: 2026-03-06
3
+
**Version**: 3.9
4
+
**Last Updated**: 2026-03-18
5
5
**Purpose**: Consolidated development guidelines for GitHub Agentic Workflows
6
6
7
7
This document consolidates specifications from the scratchpad directory into unified developer instructions. It provides architecture patterns, security guidelines, code organization rules, and testing practices.
@@ -20,6 +20,8 @@ This document consolidates specifications from the scratchpad directory into uni
20
20
-[MCP Integration](#mcp-integration)
21
21
-[Go Type Patterns](#go-type-patterns)
22
22
-[Quick Reference](#quick-reference)
23
+
-[Repo Memory](#repo-memory)
24
+
-[Release Management](#release-management)
23
25
-[Additional Resources](#additional-resources)
24
26
25
27
---
@@ -313,6 +315,37 @@ maybe_needed_utils.go
313
315
314
316
**Solution**: Wait until 2-3 use cases emerge, then extract common patterns.
315
317
318
+
### String Processing: Sanitize vs Normalize
319
+
320
+
The codebase uses two distinct patterns for string transformation:
**Anti-pattern**: Do not sanitize already-normalized strings. `normalizeWorkflowName` output is already valid — additional sanitization is unnecessary processing.
346
+
347
+
See `scratchpad/string-sanitization-normalization.md` for full function reference and decision tree.
2. Create new files with domain-specific package headers and loggers
539
+
3. Move functions preserving signatures
540
+
4. Split test files to match the new structure (one test file per validation file)
541
+
5. Update `validation.go` package documentation to reference new files
542
+
543
+
**Shared helpers**: If a helper is used by only one domain, keep it in that domain's file. If used equally across domains, create `{domain}_helpers.go`.
544
+
545
+
See `scratchpad/validation-refactoring.md` for a complete step-by-step guide using the `bundler_validation.go` split as a reference implementation.
546
+
547
+
---
548
+
487
549
### YAML Parser Compatibility
488
550
489
551
GitHub Agentic Workflows uses **`goccy/go-yaml` v1.18.0** (YAML 1.2 compliant parser). This affects validation behavior and tool integration.
@@ -2088,6 +2150,144 @@ type Everything interface {
2088
2150
2089
2151
---
2090
2152
2153
+
## Repo Memory
2154
+
2155
+
Repo Memory provides persistent, git-backed storage for AI agents across workflow runs. Agents read and write files in `/tmp/gh-aw/repo-memory/{id}/`, which are automatically committed to a `memory/{id}` branch after each job.
The prompt path always includes a trailing slash to indicate a directory for agent file operations.
2180
+
2181
+
**File glob patterns** match against **relative paths from the artifact root** — branch names are not part of the path:
2182
+
2183
+
```yaml
2184
+
# ✅ Correct: relative path from artifact root
2185
+
file-glob:
2186
+
- "*.jsonl"
2187
+
- "metrics/**"
2188
+
2189
+
# ❌ Wrong: includes branch name
2190
+
file-glob:
2191
+
- "memory/default/*.jsonl"
2192
+
```
2193
+
2194
+
### Configuration
2195
+
2196
+
```yaml
2197
+
tools:
2198
+
# Boolean: enable with defaults (id: default, branch: memory/default)
2199
+
repo-memory: true
2200
+
2201
+
# Object: custom configuration
2202
+
repo-memory:
2203
+
target-repo: myorg/memory-repo
2204
+
branch-name: memory/agent-state
2205
+
max-file-size: 524288# 512 KB
2206
+
file-glob: ["*.md", "*.json"]
2207
+
2208
+
# Array: multiple independent memories
2209
+
repo-memory:
2210
+
- id: session
2211
+
branch-name: memory/session
2212
+
- id: logs
2213
+
branch-name: memory/logs
2214
+
max-file-size: 2097152# 2 MB
2215
+
```
2216
+
2217
+
### Validation Limits
2218
+
2219
+
| Parameter | Default | Maximum |
2220
+
|-----------|---------|---------|
2221
+
| `max-file-size` | 10 KB | 100 MB |
2222
+
| `max-file-count` | 100 files | 1000 files |
2223
+
| `max-patch-size` | 10 KB | 100 KB |
2224
+
2225
+
Patch size is validated after `git add .` by computing `git diff --cached`. If the total diff exceeds `max-patch-size`, the push is aborted. Both upload and push steps run unconditionally (`if: always()`) to preserve memory state even when the agent job fails.
2226
+
2227
+
### Implementation Files
2228
+
2229
+
- `pkg/workflow/repo_memory.go`- Core configuration and compilation
- Clean working tree (all changes committed or stashed)
2278
+
- On `main` branch
2279
+
2280
+
**Standard release workflow**:
2281
+
1. Add changeset files to `.changeset/` for each significant change
2282
+
2. Run `make version` to preview the next version and CHANGELOG entry
2283
+
3. Run `make release` to create the release (updates CHANGELOG, deletes changeset files, commits, tags, and pushes)
2284
+
2285
+
**Releasing without changesets**: When no changeset files exist, the CLI defaults to `patch` and adds a generic "Maintenance release" entry to the CHANGELOG.
2286
+
2287
+
See `scratchpad/changesets.md` for complete documentation.
2288
+
2289
+
---
2290
+
2091
2291
## Additional Resources
2092
2292
2093
2293
### Agent Instruction Files
@@ -2115,6 +2315,11 @@ These files are loaded automatically by compatible AI tools (e.g., GitHub Copilo
2115
2315
- [YAML Version Gotchas](./yaml-version-gotchas.md) - YAML 1.1 vs 1.2 parser compatibility: `on:`key behavior, false positive prevention
2116
2316
- [Architecture Diagram](./architecture.md) - Package structure and dependency diagram for the `gh-aw` codebase
2117
2317
- [Guard Policies Specification](./guard-policies-specification.md) - GitHub MCP guard policies: `repos`scope and `min-integrity` access control
- [Changesets CLI](./changesets.md) - Version release management: changeset file format, release workflow, and CLI commands
2320
+
- [Validation Refactoring Guide](./validation-refactoring.md) - Step-by-step process for splitting large validation files into focused single-responsibility validators
2321
+
- [String Sanitization vs Normalization](./string-sanitization-normalization.md) - Distinction between sanitize and normalize patterns; function reference and decision tree
2322
+
- [Serena Tools Quick Reference](./serena-tools-quick-reference.md) - Tool usage statistics and efficiency analysis for Serena MCP integration
2118
2323
2119
2324
### External References
2120
2325
@@ -2126,6 +2331,7 @@ These files are loaded automatically by compatible AI tools (e.g., GitHub Copilo
0 commit comments