Skip to content

Commit c13aeb5

Browse files
author
Kim Harjamaki
committed
Add memory guidelines and fix recording script
1 parent 0ef24b2 commit c13aeb5

3 files changed

Lines changed: 106 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Codex Agent Guidelines
2+
3+
## Memory of successful fixes
4+
- After each successful fix, write a memory entry in `memory/examples/`.
5+
- Each entry must include: Issue Description, State, Action, Result, Diff Patch, and Rationale.
6+
- Keep entries short, factual, and scoped to the repo.
7+
- If a fix is later invalid, annotate the entry with an "Outdated" note instead of deleting it.
8+
9+
## Verification and retries
10+
- Always verify changes by running the relevant workflow/test when possible.
11+
- If verification fails, adjust strategy and retry with a clean state; avoid compounding changes.
12+
- Stop after 2-3 failed attempts and surface a clear summary for human review.
13+
14+
## Safety and scope
15+
- Make minimal, targeted changes. Avoid unrelated refactors.
16+
- Use least-privilege tokens; prefer `GITHUB_TOKEN`, fall back to PAT secrets only when required.
17+
- Do not assume files or APIs exist; confirm before using them.
18+
19+
## Cross-repo reuse
20+
- Reuse patterns from `memory/examples/` when a new issue matches prior symptoms.
21+
- Keep project-specific details inside project memory entries only.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Autopilot demo CI made non-failing
2+
3+
Issue Description:
4+
Demo CI intentionally exited with code 1, causing permanent failure.
5+
6+
State:
7+
Workflow failed on every run by design.
8+
9+
Action:
10+
Replaced the failing step with a non-blocking demo step.
11+
12+
Result:
13+
Demo CI now passes on dispatch and push.
14+
15+
Rationale:
16+
Demo workflows should validate plumbing without breaking CI status.
17+
18+
Diff Patch:
19+
```diff
20+
commit 0ef24b2523aefde86fdafc496ba248681bf059e5
21+
Author: Kim Harjamaki <ogeon@msn.com>
22+
Date: Mon Dec 22 23:12:45 2025 +0200
23+
24+
Make demo CI non-failing
25+
26+
diff --git a/.github/workflows/demo-ci.yml b/.github/workflows/demo-ci.yml
27+
index 2d57f3e..2c7758c 100644
28+
--- a/.github/workflows/demo-ci.yml
29+
+++ b/.github/workflows/demo-ci.yml
30+
@@ -9,7 +9,6 @@ jobs:
31+
demo:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- - name: Intentional failure
35+
+ - name: Demo sanity
36+
run: |
37+
- echo "Simulated failure for Autopilot demo."
38+
- exit 1
39+
+ echo "Simulated demo step (non-blocking)."
40+
```

scripts/record-fix.ps1

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
param(
2+
[Parameter(Mandatory=$true)][string]$Issue,
3+
[Parameter(Mandatory=$true)][string]$State,
4+
[Parameter(Mandatory=$true)][string]$Action,
5+
[Parameter(Mandatory=$true)][string]$Result,
6+
[Parameter(Mandatory=$true)][string]$Rationale,
7+
[string]$Title = "Fix summary",
8+
[string]$Commit = "HEAD"
9+
)
10+
11+
$ErrorActionPreference = "Stop"
12+
$repoRoot = Resolve-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) | Split-Path -Parent
13+
$memoryDir = Join-Path $repoRoot "memory\examples"
14+
if (-not (Test-Path $memoryDir)) { New-Item -ItemType Directory -Path $memoryDir | Out-Null }
15+
16+
$timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
17+
$diff = git -C $repoRoot show --no-color $Commit
18+
$path = Join-Path $memoryDir ("{0}_fix.md" -f $timestamp)
19+
20+
$content = @"
21+
# $Title
22+
23+
Issue Description:
24+
$Issue
25+
26+
State:
27+
$State
28+
29+
Action:
30+
$Action
31+
32+
Result:
33+
$Result
34+
35+
Rationale:
36+
$Rationale
37+
38+
Diff Patch:
39+
```diff
40+
$diff
41+
```
42+
"@
43+
44+
$content | Set-Content -Path $path -Encoding UTF8
45+
Write-Host "Wrote memory entry: $path"

0 commit comments

Comments
 (0)