Skip to content

feat: add Git-backed project fixtures#7

Open
kitlangton wants to merge 1 commit into
anomalyco:mainfrom
kitlangton:git-project-fixtures
Open

feat: add Git-backed project fixtures#7
kitlangton wants to merge 1 commit into
anomalyco:mainfrom
kitlangton:git-project-fixtures

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

Summary

  • add declarative project.git.files setup for scripted Drive runs
  • create a deterministic initial commit after project setup and before OpenCode launches
  • isolate Git metadata and environment from the host, reserve .git, and include ignored fixture files in the baseline
  • document the API and snapshot-enabled /undo workflow
export default defineScript({
  project: {
    git: {
      files: {
        "src/example.ts": "export const value = 1\n",
      },
    },
  },
  setup({ config }) {
    config.snapshots = true
  },
  async run({ ui, llm }) {
    // Simulated model responses can now call real file tools against a Git baseline.
  },
})

End-to-end proof

Tested against current OpenCode V2 using the real patch tool and /undo flow:

  1. Drive created an isolated Git project containing a deeply nested fixture file.
  2. The simulated model called OpenCode’s production patch tool.
  3. OpenCode Snapshot.Service captured the change.
  4. /undo populated revert.files and rendered …/navigation/deeply-nested/dialog-select-configuration.tsx with +1 -1.

A successful 3.75-second MP4 was recorded locally as recording-ddb072ae-5dcd-4da8-ae4c-e9fed1919dc1.mp4; no fixture or media artifacts are committed.

Verification

  • bun run test: 71 passed
  • bun run typecheck: passed
  • bun run lint: 0 errors, 21 pre-existing warnings
  • opencode-drive check /tmp/opencode-drive-git-project-proof.ts: passed
  • real OpenCode V2 Drive recording: passed
  • git diff --check: passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant