بازگشت به مهندسی مدرن و کار با هوش مصنوعی · فصل صفر — جای خودت را در مسیر پیدا کن · 3

What Can AI Do in Programming—and What Should You Not Delegate to It?

Define what programming work AI may assist with and what verification, judgment, and accountability must remain human.

هوش مصنوعی در برنامه‌نویسی چه کارهایی می‌تواند انجام دهد و چه چیزهایی را نباید به آن بسپاریم؟ — fa-IR

Lesson summary

Define what programming work AI may assist with and what verification, judgment, and accountability must remain human.

Who it is for

Foundation

Explicit vocabulary + worked case + guided artifact.

Repair

Target the diagnosed misconception; do not replay mastered material.

Experienced

Compress explanation; increase ambiguity, contrast and transfer demand.

Prerequisites

No prerequisites — this is a starting point.

AI can quickly propose code, tests, explanations, alternatives, and debugging hypotheses. That speed creates a specific engineering risk: a plausible proposal can be mistaken for a justified decision. A clean diff or confident explanation still does not tell you whether the result matches the actual requirement, allowed data, system constraints, or acceptance standard.

This lesson does not build a permanent list of tasks that AI “can” or “cannot” do. Tool capabilities change. Instead, you will build a more durable decision boundary: for one bounded task, define what AI may propose, what must be verified independently, and who retains the final acceptance decision and accountability. Your output is an AI Delegation Boundary.

The key question is not whether AI can produce an answer; it is what you are justified in accepting

Suppose you ask AI to fix a bug. It produces a patch, gives a convincing explanation, and even writes a few tests. Is the change now acceptable? Not yet. Three different things are involved:

  • Candidate: something AI proposes or produces;
  • Evidence: something that actually tests the claim you care about;
  • Acceptance decision: a judgment, based on evidence and constraints, to accept, modify, defer, or route the change for further review.

For a bounded programming task, AI may help generate candidates, surface alternatives, summarize provided evidence, or propose tests. But its own output should not automatically count as sufficient evidence for the correctness of that same output. If a patch and an AI-generated test share the same mistaken assumption, “two AI outputs” are not necessarily two independent checks.

Your Delegation Boundary must make five things explicit:

  1. What bounded outcome do you want?
  2. What may AI do, and what context or tool access may it use?
  3. What output is still only a candidate?
  4. What independent evidence or oracle supports acceptance?
  5. Who makes the final decision and owns the consequence?

This lesson does not claim that a particular model is always good or bad, and it does not establish technical mastery or job readiness.

Replace “is AI good at this?” with a bounded decision

Statements such as “AI is good at programming” or “never trust AI” are too broad for engineering decisions. A tool can be useful for generating options while still being insufficient as the final authority. The access it receives can also change the risk of the same task.

Shrink the unit of decision. Instead of “coding,” write something like:

“For this bounded function, AI may propose a skeleton. Expected behavior comes from the accepted specification. The change is accepted only when checks tied to that behavior pass and the responsible reviewer approves it.”

Or:

“For this sensitive change, AI may inspect only the minimum approved context and has no direct write authority. Its output remains a proposal.”

The central issue is not the model's potential capability. It is the authority boundary and the evidence required for this task.

The model: Task → AI Role → Access → Candidate → Evidence → Human Decision

Build the AI Delegation Boundary with six questions.

1. Task: what bounded outcome are you trying to achieve?

Write the result precisely. “Improve this code” is vague. “Remove duplication from this function without changing its observable behavior” is more inspectable.

If the outcome is ambiguous, no test or review can fully rescue the decision because the acceptance target itself is unclear.

2. AI Role: what role may AI play?

The role might be candidate generation, option generation, explanation, summarization of supplied evidence, counterexample search, or test suggestion. Keep role separate from authority. “May propose” and “may decide” are not the same permission.

3. Access: what may the tool see or change?

Three simple modes are useful for reasoning:

  • No tool access: AI has no access to the real environment and works only from supplied context.
  • Read-only: it may inspect approved information but cannot mutate the environment.
  • Write-capable: it may create or apply changes or actions.

As the environment becomes more changeable, context scope, permission boundaries, reversibility, and acceptance evidence need to be more explicit. This does not mean write access is always forbidden; it means access should match the task and its risk.

4. Candidate: what is still only a proposal?

Code, tests, explanations, migration plans, queries, refactors, and reports remain candidates until they are checked against an independent acceptance basis. Clean presentation, confidence, or a large number of generated tests does not automatically change that status.

5. Evidence and oracle: how do you know the candidate is acceptable?

Evidence is something that tests a specific claim: observed behavior, relevant tests, an interface contract, an accepted specification, an invariant, trustworthy logs, compiler/type-checker results, or human review, depending on the claim.

In this lesson, an oracle is a source or rule that tells you what should count as correct for a particular claim. It might be a specification, agreed expected output, an invariant, or another authoritative reference. AI must not become its own oracle merely by repeating or endorsing the result it generated.

Evidence must fit the claim. Passing a unit test does not prove whole-system security; compiling does not prove product behavior is correct.

6. Human Decision: who approves accept, modify, defer, or route?

Human accountability does not mean humans must perform every check manually. Automated tests, static analysis, CI, and review workflows can provide strong evidence. But the acceptance standard, interpretation of evidence, and final acceptance decision must not simply be delegated back to the same generator that produced the candidate.

For higher-risk work, ownership may be shared across roles such as developer, reviewer, or product owner. What matters is that the ownership is explicit and traceable.

Build an inspectable AI Delegation Boundary

For each task, record one row with these fields:

FieldWhat to record
Task / OutcomeA bounded, inspectable result
AI RoleProposal, candidate generation, critique, summarization, or another role
Context / AccessWhat AI may see or change
Candidate OutputWhat remains a proposal
Acceptance EvidenceIndependent evidence or oracle for the relevant claim
Human Decision OwnerWho approves the final decision
Failure / RollbackWhat stops or reverses a bad candidate
Claim BoundaryWhat acceptance does not prove
Update ConditionWhat new evidence or context would change the boundary

Two rules matter.

Rule one: constrain the tool to the task, rather than expanding the task to match advertised capability. If read-only access is enough for the outcome, write access is not automatically required.

Rule two: define acceptance evidence before becoming attached to the candidate. If you invent the standard only after seeing an attractive result, you risk unconsciously reshaping the standard around the output.

Why “AI wrote the patch and the test” is not automatically independent verification

Suppose the requirement says empty input must return a specific error. AI writes a patch that converts empty input into an empty list. It then generates a test that expects exactly that behavior. The patch and test agree with each other, but they share the same mistaken interpretation of the requirement.

The problem is not that the test was written by AI. The problem is dependency of reasoning. If the candidate and its check originate from the same bad assumption, adding more checks from that assumption does not create independent confidence.

Break the loop by grounding at least part of the oracle or acceptance standard outside the same generator: an accepted specification, pre-defined cases, a clear invariant, reference behavior, or independent review that re-derives the claim.

Human accountability is ownership, not manual execution

Thousands of automated tests may run without a person reading each one. They can still be useful evidence if you understand what claims they test and what they do not test. The human role is to own the claim boundary, evidence threshold, and response to failure.

Context is part of the decision

A model may be technically capable of processing more information than you are justified in providing. Sensitive data, secrets, customer information, or irrelevant repository areas should be included only when required and permitted for the task. Technical capability does not grant permission to use every data source or access level.

Three examples: separate candidate generation from authority

Example 1: code skeleton, behavior from the specification

A small data transformation function must satisfy defined input, output, and two error cases. AI may propose a skeleton, naming options, and candidate tests.

A defensible boundary is:

  • AI Role: generate candidates;
  • Oracle: the accepted specification and expected behavior;
  • Evidence: checks tied to those requirements plus observed behavior;
  • Decision Owner: the responsible developer or reviewer;
  • Non-claim: passing those checks does not establish overall architecture quality or whole-system security.

Example 2: patch and test repeat the same mistake

AI writes a bug fix and a regression test. Both pass. Later you discover that the test copied the same incorrect assumption as the patch and omitted an edge condition from the requirement.

The conclusion is not “AI-generated tests are worthless.” The conclusion is that evidence independence must match the claim. A generated test may be useful, but acceptance still needs an expected behavior grounded somewhere other than the candidate's own reasoning.

Example 3: sensitive context and a write-capable tool

You are diagnosing a production defect. Real logs contain information that is not all necessary for the diagnosis, while the tool can both read files and apply changes.

A reasonable boundary might:

  • minimize context to the necessary, permitted subset;
  • begin with read-only analysis if that is enough;
  • make any write-capable change explicit, logged, and reversible;
  • accept the change only from system evidence and a named decision owner.

The fact that a tool can do more does not mean the task requires or permits more authority.

Four common delegation failures

Failure 1: “the answer sounds convincing, so it is correct”

Tone, length, confidence, and professional-looking code are not evidence.

Repair: name the claim and identify evidence that actually tests it.

Failure 2: “AI wrote tests too, so it verified itself”

The candidate and tests may share the same assumption.

Repair: define an independent oracle and connect at least one important check to a requirement, invariant, or other external evidence.

Failure 3: “more context is always better”

Extra context may be irrelevant, sensitive, or misleading.

Repair: provide only context needed for the task and constrain access to the minimum required for the bounded outcome.

Failure 4: “humans must manually check everything”

That is also a bad interpretation. The goal is not to remove automation.

Repair: use automated evidence, while keeping decision ownership and the claim boundary explicit.

For experienced engineers, compress the boundary around risk and reversibility

For a low-risk, reversible change, a reasonable flow may be: AI proposes the change, pre-existing tests run, the diff is reviewed, and the small change is accepted.

For a higher-risk change, the same model may require narrower access, stronger evidence, an independent reviewer, or an explicit rollback step. The difference is not simply whether AI is “smarter.” It comes from consequence of failure, reversibility, and the evidence threshold needed for the task.

An experienced engineer should be able to record that tradeoff briefly but explicitly rather than relying on intuition or tool confidence alone.

Three tool modes, one invariant principle

Compare the same task in three settings.

No tool access

AI has no tool or real-environment access, but it may still generate a candidate or alternatives from supplied context. Evidence must come from a claim-matched basis such as an accepted specification, an independent check, observed behavior, or human review. Human ownership of the final decision remains explicit.

Read-only tool

AI may inspect approved context, suggest likely causes, or summarize available evidence. Because it cannot mutate the environment, mutation risk is lower, but its recommendation is still not the authority.

Write-capable tool

AI may apply a candidate directly. That can reduce friction, but the acceptance gate must not disappear. Write scope, logging, reversibility, and evidence should remain explicit.

The invariant across all three modes is this: candidate generation, evidence collection, and acceptance are different roles. A tool may assist with more than one, but the authority boundary must remain visible.

Practice: build a Delegation Boundary for one real task

Round 1: bound the outcome

Choose one small real task. “Write the entire parser” is too broad; “support one defined format with three specified error cases” is more useful.

Round 2: choose AI role and access

State whether AI only proposes, has read-only access, or is write-capable. Exclude context that is not needed.

Round 3: define evidence before the candidate

State what must be true for acceptance. A requirement, independent test, invariant, compile/type check, runtime behavior, or review may contribute, as long as you match it to the claim.

Round 4: record the decision and non-claim

After inspecting evidence, choose accept, modify, defer, or route for review. Then state what this acceptance does not prove.

Round 5: transfer across three contexts

Redesign the same task for:

  1. no tool access;
  2. read-only access;
  3. write-capable access.

For each mode, explain what changes and what remains invariant. If the answer is only “AI does more or less work,” the authority boundary is incomplete. You must also account for access, evidence, and ownership.

Five questions before acceptance

  1. Is the task and outcome bounded and inspectable?
  2. Is AI's role separated from decision authority?
  3. Is context and access limited to what the task requires?
  4. Does acceptance evidence actually test the claim instead of merely echoing the candidate?
  5. Are the decision owner, non-claim, and update condition explicit?

If any answer is unclear, the Delegation Boundary is not yet strong enough to support an acceptance decision.

Main assessment: defend the boundary in a changed context

You will receive a new task for which AI can generate a candidate. You must define:

  • the bounded outcome;
  • AI's role;
  • permitted context and access;
  • what counts only as a candidate;
  • the independent oracle or evidence;
  • the decision owner;
  • what triggers accept, modify, defer, or escalation;
  • what the decision does not prove.

Then transfer the same task across no-tool, read-only, and write-capable modes. Passing this assessment only shows that you can construct and defend a bounded AI Delegation Boundary. It does not establish broad mastery of security, architecture, or all programming work.

Why this lesson does not maintain a list of current model capabilities

Tool capabilities change, while the core question here is more stable: what is the candidate, what evidence is required, and where does final authority remain? If a future version adds a current claim about a specific model, version, or provider capability, that claim must be checked separately against an official source with a review date. This version intentionally makes no provider-specific claims about current capabilities.

Assessment

There is no answer key in this lesson pack; answer it yourself and mark honestly. "Needs review" sends the lesson to your review queue.

Q1 retrieval

What is the difference between a Candidate, Evidence, and an Acceptance Decision?

lesson ✗AI ✗notes ✗

Q2 application

AI generated both a patch and a test for a function, and they agree. Build an AI Delegation Boundary that identifies what is still a candidate, where the oracle comes from, and what evidence is required for acceptance.

lesson ✗AI ✗notes ✗

Q3 diagnosis

Diagnose this reasoning: “If the tool has write access and applied the change, it is best positioned to decide whether the change is correct.”

lesson ✗AI ✗notes ✗

Q4 decision

For one real task, write the complete Delegation Boundary: outcome, role, context/access, candidate, evidence/oracle, owner, rollback, claim boundary, and update condition. Then defend accept/modify/defer/route.

lesson ✗AI ✗notes ✗

Q5 transfer

Compare the same task across three modes: no tool access, where AI may generate a candidate from supplied context but has no tool/real-environment access; read-only; and write-capable. Explain what changes in access, evidence, and safeguards/rollback and what authority principle remains invariant.

lesson ✗AI ✗notes ✗
Assessment rubric

Critical dimensions

1. Decision and scope correctness — critical

The task is bounded. AI role, access, and decision authority are separated. The response does not generalize into a permanent claim about all AI tools.

2. Evidence adequacy — critical

Acceptance evidence matches the exact claim. A generated patch, explanation, or test is not treated as sufficient merely because it agrees with another output from the same reasoning path.

3. Human accountability and non-claim — critical

A named human decision owner remains responsible for the final acceptance decision. The artifact states what acceptance does not prove.

4. Transfer — critical

The learner adapts the boundary across no-tool, read-only, and write-capable modes while preserving the separation between candidate, evidence, and acceptance authority.

Blocking failure conditions

  • final acceptance is delegated to the same generator without an independent acceptance basis;
  • AI output is used as its own oracle;
  • access is unspecified for a task where access materially changes the risk;
  • decision is made without claim-relevant evidence;
  • claim boundary or decision owner is missing in a blocking artifact;
  • transfer treats write capability as automatic permission or automatic correctness.

Human decision policy

AI may generate candidates, propose tests, critique, summarize evidence, or perform an authorized action. Automated evidence is allowed. The final acceptance decision remains owned by an accountable human role.

What passing does not prove

Passing this lesson does not prove technical programming mastery, security mastery, architecture mastery, job readiness, or whole-program mastery.

References & freshness

B01 protected orientation authority aggregate
MAKNOW internal authority · FOUNDATIONAL_STABLE
Protected orientation identity and bounded lesson scope only.
P1 resolved 340-lesson portfolio authority
MAKNOW internal authority · FOUNDATIONAL_STABLE
Starting gap, learner transformation, route/dependency/overlap, and bounded AI delegation outcome.
V01 Volume Bible authority
MAKNOW internal authority · FOUNDATIONAL_STABLE
V01 purpose, route convergence, terminology, anti-overlap, and handoff boundaries.
MAKNOW Deep Lesson Bible Schema v1.0
MAKNOW internal authority · FOUNDATIONAL_STABLE
Evidence, pedagogy, localization, package projection, and governance structure.

Case studies

Lesson visuals

Diagram from Task to AI Role/Access, then Candidate, Evidence/Oracle, and Human Decision, with a feedback arrow returning failed evidence to candidate revision.

Where are candidate generation, evidence/oracle, and human decision separated?

Three columns for no-tool, read-only, and write-capable modes; Candidate, Evidence/Oracle, and Human Decision remain separate in all three. As the mode changes, access, mutation risk, safeguards/rollback, and when needed the type or threshold of claim-matched Evidence also adapt.

What changes between no-tool, read-only, and write-capable modes, and what authority principle remains invariant?

Optional video script

Scenario

AI produces a patch and tests. The question is not “was AI good or bad?” The question is what remains a Candidate and what Evidence justifies acceptance.

Model

Bound the Task, state AI Role and Access, keep the Candidate separate, ground the Oracle in a specification or invariant, and name the Decision Owner.

Plausible failure

The patch and test share the same incorrect reading of the requirement. A passing test shows consistency between them, not correctness of the requirement interpretation.

Repair

Ground expected behavior independently and connect the check to the exact claim.

Transfer

Compare the same task with no tool access, read-only access, and write-capable access. Access changes, while Candidate, Evidence, and Human Decision remain distinct.

Passing this exercise does not establish broad programming or security mastery.

Lesson media & slides

slide-01.png
slide-01.png
slide-02.png
slide-02.png
slide-03.png
slide-03.png
slide-04.png
slide-04.png
slide-05.png
slide-05.png
slide-06.png
slide-06.png
slide-07.png
slide-07.png
slide-08.png
slide-08.png

Teaching files (download)

PPTXTEACHING DECK v1.0.1.pptxTeaching files (download)