|
| 1 | +# Generated Files and Commit Policy |
| 2 | + |
| 3 | +OpenCode++ writes both stable repository context and local runtime evidence. These files do not all belong in git. |
| 4 | + |
| 5 | +Default rule: |
| 6 | + |
| 7 | +- Commit stable guidance that helps every contributor or coding agent. |
| 8 | +- Do not commit local traces, sidecar reports, tool evidence, caches, or machine-specific config. |
| 9 | +- Treat execution evidence as potentially sensitive even when output previews are sanitized. |
| 10 | + |
| 11 | +## Policy Table |
| 12 | + |
| 13 | +| File or directory | Generated? | Commit? | May contain sensitive info? | Regenerate with | |
| 14 | +| -------------------------------------------------------------------------------------------------------- | ---------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------ | ----------------------------------------------------------------- | |
| 15 | +| `AGENTS.md` | Yes | Usually yes | Low, unless manual sources include secrets | `opencode-plusplus build .` | |
| 16 | +| `AGENTS.manual.md` | No, migration/helper only | Optional | Depends on what you write | Edit manually | |
| 17 | +| `.agent-context/AGENTS.generated.md` | Yes | Usually yes if your repo commits generated context | Low | `opencode-plusplus build .` | |
| 18 | +| `.agent-context/repo-summary.md`, `onboarding.md`, `context-layers.md` | Yes | Usually yes | Low | `opencode-plusplus build .` | |
| 19 | +| `.agent-context/key-files.md`, `module-map.md`, `architecture.md`, `dependency-graph.md`, `readiness.md` | Yes | Usually yes | Low to medium; includes repo structure | `opencode-plusplus build .` | |
| 20 | +| `.agent-context/contracts/*.json` | Yes | Usually yes | Low | `opencode-plusplus build .` | |
| 21 | +| `.agent-context/index/*.json`, `.agent-context/graphs/*`, `.agent-context/evidence/*` | Yes | Project choice | Medium; includes paths, symbols, summaries | `opencode-plusplus build .` | |
| 22 | +| `.agent-context/rag/*` | Yes | Project choice | Medium; optimized for retrieval and may include snippets | `opencode-plusplus build .` | |
| 23 | +| `.agent-context/tasks/*` | Yes | Optional | Medium; task text may reveal intent | `opencode-plusplus pack "<task>" .` | |
| 24 | +| `.agent-context/runs/<task-id>/*` | Yes | Usually no for local runs; optional for reviewed benchmark/demo artifacts | Medium; task prompts and boundaries may include repo details | `opencode-plusplus run "<task>" .` | |
| 25 | +| `.agent-context/runs/<task-id>/iterations/*` | Yes | Usually no | High; executor output, diffs, decisions, trace summaries | `opencode-plusplus orchestrate "<task>" . ...` | |
| 26 | +| `.agent-context/traces/*.json` | Yes | No by default | High; commands, files, hashes, sanitized output previews | `opencode-plusplus trace ...` or sidecar hooks | |
| 27 | +| `.agent-context/traces/opencode-sidecar-events.jsonl` | Yes | No | High; local sidecar events | Start OpenCode with `opencode-plusplus` | |
| 28 | +| `.agent-context/traces/tool-evidence/*.json` | Yes | No | High; command evidence payloads with sanitized previews and hashes | Sidecar `tool.execute.after` | |
| 29 | +| `.agent-context/sidecar/latest.json`, `latest.md` | Yes | No | Medium to high; local blocker/warning state | `opencode-plusplus sidecar verify .` | |
| 30 | +| `.agent-context/sidecar/policy.md`, `task-verify.md`, `hallucination.md`, `regression.md` | Yes | No by default | Medium to high; local verification reports | `opencode-plusplus sidecar verify .` | |
| 31 | +| `.agent-context/hallucination/*` | Yes | Usually no | Medium; transcript-derived claims | `opencode-plusplus hallucination . --trace <trace-id>` | |
| 32 | +| `.agent-context/regression/*.json` | Yes / curated | Commit curated memory, not transient reports | Medium; known issues and fragile modules | `opencode-plusplus build .`, `opencode-plusplus memory add-fix .` | |
| 33 | +| `.agent-context/memory/candidates/*.json` | Yes | No until reviewed | Medium | `opencode-plusplus memory learn-from-pr .` | |
| 34 | +| `.agent-context/cache/*` | Yes | No | Low to medium | `opencode-plusplus build .` | |
| 35 | +| `.agent-context/delta/*` | Yes | No by default | Medium; local change guidance | `opencode-plusplus delta .` or `opencode-plusplus evolve .` | |
| 36 | +| `.opencode/plugins/opencode-plusplus.ts` | Yes | Usually yes for OpenCode sidecar mode | Low; imports local OpenCode++ runtime | `opencode-plusplus` or `opencode-plusplus opencode init .` | |
| 37 | +| `.opencode/commands/opencode-plusplus.md`, `.opencode/commands/opencode-plusplus-verify.md` | Yes | Usually yes | Low | `opencode-plusplus opencode init .` | |
| 38 | +| `.opencode/agents/opencode-plusplus.md` | Yes | Usually yes | Low | `opencode-plusplus opencode init .` | |
| 39 | +| `opencode-plusplus.config.yml` | Starter generated, then user-owned | Yes | Low to medium | `opencode-plusplus init .` | |
| 40 | +| `opencode-plusplus.local.yml` | User-owned local config | No | High; can contain local paths or credentials | Copy from `opencode-plusplus.local.example.yml` | |
| 41 | + |
| 42 | +## Recommended `.gitignore` |
| 43 | + |
| 44 | +For most repositories, commit the stable context and OpenCode integration files, but ignore runtime evidence: |
| 45 | + |
| 46 | +```gitignore |
| 47 | +.agent-context/cache/ |
| 48 | +.agent-context/traces/ |
| 49 | +.agent-context/sidecar/ |
| 50 | +.agent-context/runs/*/iterations/ |
| 51 | +.agent-context/delta/ |
| 52 | +.agent-context/memory/candidates/ |
| 53 | +opencode-plusplus.local.yml |
| 54 | +``` |
| 55 | + |
| 56 | +If your team does not want generated repository context in git, ignore all of `.agent-context/` and regenerate it locally: |
| 57 | + |
| 58 | +```gitignore |
| 59 | +.agent-context/ |
| 60 | +AGENTS.md |
| 61 | +``` |
| 62 | + |
| 63 | +In that mode, keep `AGENTS.manual.md` or another human-authored guide if you still want stable agent instructions in the repository. |
| 64 | + |
| 65 | +## Why This Repository Commits `.agent-context` |
| 66 | + |
| 67 | +This project intentionally keeps a generated `.agent-context/` in the repository because it is both the product output and a test fixture for dogfooding. That does not mean every downstream project should commit every `.agent-context` file. |
| 68 | + |
| 69 | +Use this split: |
| 70 | + |
| 71 | +- **Commit:** stable guidance, contracts, generated summaries, OpenCode plugin/commands when shared with the team. |
| 72 | +- **Do not commit:** traces, sidecar latest reports, tool evidence, caches, local config, and transient task iterations. |
| 73 | + |
| 74 | +## Sensitive Evidence Notes |
| 75 | + |
| 76 | +OpenCode++ sidecar evidence is safer than raw logs, but it is still local runtime evidence: |
| 77 | + |
| 78 | +- long stdout/stderr is passed to `record-tool` through a JSON evidence file, not command-line arguments; |
| 79 | +- raw output is hashed; |
| 80 | +- stored previews are redacted and truncated; |
| 81 | +- missing exit code is recorded as `unknown`, not `passed`; |
| 82 | +- working-tree hashes and touched file lists can still reveal local activity. |
| 83 | + |
| 84 | +Keep `.agent-context/traces/` and `.agent-context/sidecar/` out of git unless you have a deliberate audit workflow. |
0 commit comments