Skip to main content

Git Notes Component

The <Notes> component adds or appends structured metadata to git commits via git notes.

Basic Usage

import { Notes } from "smithers-orchestrator";

<Notes
  data={{
    reviewedBy: "smithers",
    confidence: 0.95,
    issues: []
  }}
  onFinished={(result) => console.log("Notes added:", result)}
/>

Props

commitRef
string
default:"HEAD"
Git commit reference to attach notes to.
<Notes commitRef="abc123" data={{ reviewed: true }} />
data
Record<string, any>
required
Structured data to store in notes. Automatically includes smithers metadata.
<Notes data={{ 
  phase: "review",
  score: 85,
  suggestions: ["Add tests", "Update docs"]
}} />
append
boolean
default:false
Append to existing notes instead of replacing.
<Notes append data={{ additionalReview: true }} />
onFinished
(result: NotesResult) => void
Callback when notes are successfully added.
onError
(error: Error) => void
Callback on error.

NotesResult

interface NotesResult {
  commitRef: string;
  data: Record<string, any>;
  previousNotes: string | null;
}

Automatic Metadata

Notes automatically include smithers tracking:
{
  "smithers": true,
  "executionId": "exec-123",
  "timestamp": 1705596000000,
  "reviewedBy": "smithers",
  "confidence": 0.95
}

Example: Post-Review Notes

<Git.Commit message="feat: add auth">
  <Notes
    data={{
      reviewPassed: true,
      lintClean: true,
      testsRun: 42
    }}
  />
</Git.Commit>