AI Learning Hub › Learn AI › Self-Paced Courses › GitHub Without the Jargon › Supervise an AI-Made Change

Module 10 ยท Intermediate

Supervise an AI-Made Change

Set acceptance criteria first, compare the change against the request, stage and commit only what you intended, then publish and verify.

By the end

  • Compare an AI-made change against the original request
  • Define simple acceptance criteria before committing
  • Decide whether to accept, revise, or reject a change
  • Explain what staging does
  • Inspect exactly what is staged before committing
  • Commit only the intended change
  • Verify local history after the commit
  • Explain what Git history does and does not reveal about AI involvement
  • Push the reviewed branch to GitHub
  • Verify that GitHub changed only after publication

The AI finished. What should you do before accepting its work?

Module 9 asked what changed? and answered it with evidence: one file, five added lines, no commit, nothing on GitHub. That question is now settled.

This module asks a different one, and Git cannot answer it:

Is that the change we actually wanted? Verification tells you what changed; supervision decides what to do about it.

And a warning about where this is going, because the ending is not the dramatic one:

Supervision is a decision process rather than a requirement to rewrite the AI's work.

Three words to learn

Acceptance criteria

Observable conditions used to decide whether a change satisfies the task it was meant to perform.

Staging area

Git’s selection of changes that will be included in the next commit.

Provenance

Information about where a change came from or how it was produced.

Two of these are not GitHub’s words. Staging area is Git’s own concept, and git add is how you put something into it. Acceptance criteria and provenance are this course’s vocabulary for ideas GitHub does not name or represent as interface categories. That distinction matters later in the module.

Review against the task, not against your memory

The agent in Module 9 was given a specific task. Supervision starts by going back to it, rather than by forming an impression of whether the result “looks fine.”

It was asked to:

The prompt gives us the first version of the acceptance criteria.

Make “looks good” more concrete

Rewritten as things you can actually check:

Scope
Only README.md changed.
Existing content
No existing README content was altered.
Structure
Exactly one new ## AI practice section.
Content
Exactly two short bullet points.
Meaning
One bullet explains local AI file editing; one reminds the reader to inspect changes before committing.
Repository state
No stage, commit, or push occurred during the AI task.

Acceptance criteria turn the original request into things you can actually check.

This is not a formal specification method, and six lines is not a standard. It is the smallest useful step between “seems fine” and a decision you could explain to someone else.

Recheck the shape before touching anything

before any change
$ git status --short
 M README.md

$ git diff --stat
 README.md | 5 +++++
 1 file changed, 5 insertions(+)

$ git diff --check
$

One modified file, five added lines, nothing removed. The third command produced no output.

Say what that third result actually means. git diff --check looks for certain whitespace problems, such as trailing spaces. No output means no whitespace errors were reported by this check. It does not mean the writing is good, the facts are right, the change is accessible, or anything at all about correctness. It is one narrow check, and calling it “all tests passed” would be a small lie that grows.

Read the proposed change one more time

The diff, exactly as Git printed it:

git diff — README.md
@@ -9,3 +9,8 @@
 ## Review note

 This change is on a branch for
 review.
+
+## AI practice
+
+- An AI coding tool can edit the
+  files in your local copy of a
+  repository.
+- Review every change it makes
+  before you commit.

Long lines are wrapped here to fit a narrow screen. In the file the two bullets are one line each, and Git counts five added lines in total.

Against each criterion:

Met

  • Scope — one file.
  • Existing content — five insertions, zero deletions.
  • Structure — one ## AI practice heading.

Also met

  • Content — exactly two bullets.
  • Meaning — one on local editing, one on inspecting before committing.
  • Repository state — nothing staged, latest commit unchanged.

Accept, revise, or reject?

Three outcomes are available, and all three are legitimate:

Accept

The change satisfies the task and should continue.

Revise

The basic change is useful but needs modification.

Reject

The change should not become part of the project.

For this change the decision was accept unchanged: scope correct, structure correct, both bullets satisfy what was asked, existing content preserved, no unintended file touched, and no repository action taken outside the task.

Not one word of the AI’s text was edited. That was the right outcome, not a shortcut.

Verification still mattered even though the AI got it right

There is a temptation, writing a module like this, to arrange a mistake so supervision looks heroic. Nothing was arranged. The agent’s summary was accurate and its output met the request.

Independent inspection still established four things the summary could not:

The value of verification is knowing what happened rather than hoping to catch the AI doing something wrong.

Select the change for the next commit

Accepting a change is a decision. Recording it takes a mechanism, and Git puts one deliberate step in the way first.

staging one named file
git add README.md

GitHub’s documentation is brisk about it: “git add stages a change,” and staging and committing separately “gives developers complete control over the history of their project.” When the scope is small, an explicit stage command makes the intended boundary easy to see.

git add . is not wrong, and experienced people use it constantly. Naming the file here does something specific: it states, in the command itself, that one known change is being selected. When you are supervising work you did not write, that is worth the extra keystrokes.

What changed after git add?

the same command, before and after
before:   M README.md
after:   M  README.md

Look closely — the M moved one column to the left.

Git’s compact status represents staged and unstaged state separately, in two columns. Before, the README was modified but not selected. After, that change is selected for the next commit. You do not need to memorize the columns; you need to know the two states exist and are different.

Staging neither publishes anything nor creates the commit.

Review the commit candidate

Staging creates something worth inspecting in its own right: the exact content of the commit you are about to make.

two diffs, two questions
$ git diff --cached --stat
 README.md | 5 +++++
 1 file changed, 5 insertions(+)

$ git diff
$

Staged diff

git diff --cached

What is selected for the next commit.

Here: the AI practice section, five lines, one file.

Unstaged diff

git diff

Any local changes not included in that selection.

Here: empty. Nothing is being left behind.

Review the commit candidate before you create the commit.

An empty unstaged diff is its own useful signal: everything modified is going in, so nothing will be quietly stranded outside the commit.

You still have not changed history

After staging: the file is changed, a selection exists, and the latest commit is still the one that was there before the agent ran. GitHub is still untouched. Staging creates a checkpoint between editing and committing.

It is a checkpoint, not a backup — nothing about staging protects your work. And not every Git tool surfaces the staging step the same way; some clients bundle it into a single action, which is convenient and worth knowing about when a colleague’s description of “committing” does not match yours.

Naming the commit

The message used was:

the commit message
Add AI practice guidance

It describes the repository change. Applying Module 3’s standard, a reader scanning history can tell what this commit did without opening it.

It does not describe the whole AI interaction, the verification commands, or the prompt — and it does not need to. A commit message is about what the commit changes.

Git knows who recorded the commit. It does not automatically know who drafted every line.

This is the module’s subtlest point, and the one most worth getting right.

Git commit metadata records real things: who recorded the commit, when, the message, and the change itself. What Git does not do is infer “this sentence was drafted by an AI tool.” Nothing in the commit says so, because nothing in Git is watching where text comes from.

We know it in this case for reasons outside Git entirely: the run was observed while it happened, and written down. Repository history records the commit, and provenance may require additional context.

This course sets no disclosure rule. Projects differ, and some have explicit expectations about recording AI assistance while others have none. If a project you work on expects that information, it will tell you where it belongs — and that place may not be the commit message. What this module claims is narrower and safer: do not assume history carries provenance it was never given.

Creating the commit

With the branch confirmed, exactly one file staged, nothing unstaged, and nothing untracked:

the commit, and what Git reported
$ git commit \
    -m "Add AI practice guidance"
[ai-practice 6b3fdae]
 Add AI practice guidance
 1 file changed, 5 insertions(+)

Afterwards, git status --short printed nothing at all — the working tree is clean, because everything that was modified is now recorded. The AI-made change is now part of local repository history, and GitHub still has not seen it.

Commit changed local history. It did not publish the branch.

Before pushing anything, the remote was checked again — read-only, and not merely in a browser:

Remote branches
Three. main, resource-note, review-note.
ai-practice on GitHub
Does not exist.
GitHub main
No AI practice section.
Pull request #2
Open and unchanged.

A commit is a local event. Nothing about making one reaches outward.

Publishing the branch

One last boundary check — right branch, right commit, clean tree, remote pointing at the practice repository, exactly one commit beyond main — and then:

git push origin ai-practice
$ git push origin ai-practice
remote: Create a pull request for
  'ai-practice' on GitHub by
  visiting: ...
To https://github.com/...
 * [new branch]
   ai-practice -> ai-practice

Selected output, wrapped and with the address shortened. Nothing substantive was altered.

Afterwards: four remote branches instead of three, ai-practice present at the same commit as the local branch, and its README containing the accepted section. Push published the branch without merging it into main.

GitHub’s main still has no AI practice section. Pull request #2 is unchanged and still open. And no pull request exists for ai-practice — even though, as you can see in that output, GitHub helpfully offered a link to create one.

Working tree, local history, remote branch

Working tree

The AI-generated edit existed here first.

Local history

After the commit, the accepted change became a recorded local commit.

GitHub branch

After the push, that commit became visible on remote ai-practice.

And through all three, main did not change. Supervision happened before publication rather than after it.

Git can carry out the decision. It cannot make the judgment for you.

Judgment

  • Does this satisfy the task?
  • Should it be accepted?
  • Does anything need revision?

Mechanics

  • Stage.
  • Commit.
  • Push.

Git is excellent at recording and measuring state. It has no view about whether the state is the one you wanted.

None of this means one person must decide alone. Teams, review requirements, automated checks, and project rules can all participate — Module 6 met several. The point is that the judgment exists as a distinct step, wherever it lives.

What did the AI actually decide?

Worth being precise, because the answer is narrower than “the AI did the work.”

Within the bounded task, the agent decided the wording of two bullets. That is the whole of it.

It did not decide whether the change should be accepted, what should be staged, whether to commit, what the commit message should say, whether to push, whether to propose the change to main, or whether to merge. Delegating drafting did not require delegating publication.

We are stopping before the proposal

GitHub now knows about ai-practice. It contains reviewed, accepted, committed work. And main does not contain any of it, because nothing has proposed that it should. Publishing a branch is not the same thing as proposing that it become part of the default branch.

That is deliberate, and it is where the capstone begins.

Does supervision always mean changing the draft?

The change touched only the README, preserved existing text, added the requested heading, added exactly two short bullets, fulfilled both requested meanings, and created no extra repository action.

which outcome is justified?
A. Reject because AI wrote it.

B. Rewrite it so a human has
   changed something.

C. Accept it unchanged.

D. Commit without reviewing
   because the summary was
   accurate.
One possible answer

C.

A rejects on origin rather than on merit, which is not review — it is a policy, and a different conversation. B is the tempting one: editing something so a person has visibly contributed. That produces a worse README and a false sense of oversight. D gets the same outcome as C by luck, having checked nothing.

Human supervision means making the decision rather than performing ceremonial edits.

What does staging do?

The README is modified. You run git add README.md.

what happened?
A. GitHub received the file.

B. A commit was created.

C. The README change was selected
   for the next commit.

D. The branch merged.
One possible answer

C.

A would need a push, and nothing had left the computer. B would need git commit — the latest commit was unchanged after staging. D is a different operation entirely.

Staging is the quietest step in Git and the easiest to skip past mentally. It selects; it does not record and it does not publish.

Which evidence answers which question?

match each to what it tells you
git diff
git diff --cached
git log -1
the GitHub branch page
One possible answer
  • git diff — what local unstaged file changes remain?
  • git diff --cached — what is selected for the next commit?
  • git log -1 — what is the latest recorded local commit?
  • The GitHub branch page — what has actually been published remotely?

Different views answer different state questions.

Reaching for the wrong one is how people end up confidently describing a state that is not the one they are in.

Where is the change now?

four moments
A. AI edited the file.
   No stage, commit, or push.

B. README staged.

C. Commit created.

D. Branch pushed.

Where does the change live at each moment — and at which moment does main receive it?

One possible answer
  • A — working tree only.
  • B — working tree plus the staging selection. Still not history.
  • C — local history.
  • D — local history plus the remote branch.

And main receives it at none of them.

Four moments, four different answers, and the default branch is unaffected by every one. main would need a separate integration action — such as merging a pull request, which is what Modules 5 and 6 were about, and what the capstone will ask you to judge.

What to notice

Supervising an AI-made change is a sequence of questions, each with somewhere to look:

What was requested?
Acceptance criteria.
What actually changed?
git status and git diff.
Do I accept it?
Judgment. Nothing else answers this one.
What exactly will the commit contain?
The staged diff.
Did history change?
The commit.
Did GitHub change?
The push.
Did main change?
Not yet.

Review before the commit. Verify after the commit. Publish deliberately.

Before you continue

You are ready for the capstone if you can: