DETERMINISTIC PIPELINE SPECIFICATION

From API Change to Verified Draft PR

A step-by-step technical breakdown of how MY OWL detects upstream breaking changes, traces affected call sites, verifies migrations, and stops at a Draft PR.

Read-Only Default Branch
Zero Auto-Merge Policy
4-Gate Compiler Verification
01CONNECT

Install GitHub App & Authorize Repositories

Install the official MY OWL GitHub App and select which repositories to protect. The installation establishes an isolated workspace with cryptographic state binding.

INPUT

GitHub Organization or User Account credentials with repository administration.

PROCESSING

MY OWL generates a cryptographically signed HMAC-SHA256 state token bound to the active user session and workspace ID (15-minute TTL). The GitHub App webhook listener registers events for push and release triggers.

OUTPUT

Authorized repository record in MY OWL database with scoped least-privilege installation credentials.

FAILURE CONDITION (FAIL CLOSED)

User denies permissions or state token HMAC validation expires / fails → Connection aborted.

SYSTEM ARTIFACT: CONNECT
// GitHub App Installation State Token Binding
{
  "installationId": "gh_inst_4829104",
  "workspaceId": "ws_alpha_prod",
  "requestedScopes": ["contents:read", "pull_requests:write"],
  "stateSignature": "hmac_sha256(payload, VERIFIER_SECRET)",
  "status": "AUTHORIZED"
}
02OBSERVE

Establish Immutable Analysis Snapshot

MY OWL reads your repository structure, discovers dependency manifests, and pins the exact 40-character Git commit SHA of your default branch as the baseline.

INPUT

Target repository default branch (e.g., main or master).

PROCESSING

Fetches repository file tree via Git transport. Resolves package manifests (package.json, lockfiles) and locks the exact HEAD commit SHA as the immutable analysis baseline.

OUTPUT

Repository baseline snapshot with baseline commit SHA and discovered dependency catalog.

FAILURE CONDITION (FAIL CLOSED)

Repository is empty, contains no supported manifest, or network transport fails → Scan exits cleanly with 'unsupported' status.

SYSTEM ARTIFACT: OBSERVE
// Baseline Snapshot Record
{
  "repository": "acme/billing-service",
  "defaultBranch": "main",
  "baselineSha": "7a3f89d1b0924e3c881023a9d20c56b7104e6721",
  "discoveredManifests": ["package.json"],
  "treeSize": 142
}
03DETECT

Match Upstream Breaking Change Rules

Our changelog ingestion pipeline continuously monitors vendor SDK releases, turning deprecation announcements into machine-readable AST change rules.

INPUT

Discovered package dependencies vs. verified upstream vendor catalog (Stripe, Twilio).

PROCESSING

Compares installed dependency version constraints against rule trigger ranges (e.g. stripe-node upgrade from v17.x to v18.0.0). Identifies candidate breaking changes.

OUTPUT

List of candidate change IDs to inspect for reachability in the target codebase.

FAILURE CONDITION (FAIL CLOSED)

No breaking change rules match installed package versions → Scan completes with 0 findings.

SYSTEM ARTIFACT: DETECT
// Candidate Breaking Change Rule
{
  "ruleId": "stripe-v18-sub-coupon",
  "provider": "stripe",
  "targetPackage": "stripe",
  "deprecatedParameter": "coupon",
  "breakingInVersion": "18.0.0",
  "severity": "breaking",
  "status": "CANDIDATE_MATCH"
}
04TRACE

Pinpoint Reachable Call Sites via AST Analysis

Instead of simplistic regex or package.json alerts, MY OWL parses TypeScript and JavaScript files into a typed Abstract Syntax Tree (AST) using ts-morph to find active call sites.

INPUT

TypeScript/JavaScript source files in target repository.

PROCESSING

Resolves import declarations, aliased identifiers, and custom client wrappers. Evaluates CallExpressions and PropertyAccessExpressions to determine whether arguments actively reference the breaking parameter.

OUTPUT

Confirmed Finding records with exact file paths, line numbers, symbols, and code snippets. Safe/untouched invocations are filtered out.

FAILURE CONDITION (FAIL CLOSED)

Symbol exists in dependency but is never invoked or never passes deprecated parameters → Classified as 'Detected' but 'Unaffected'. Zero noise.

SYSTEM ARTIFACT: TRACE
// Confirmed Reachable Finding Record
{
  "findingId": "find_8f21c904",
  "file": "src/billing.ts",
  "line": 42,
  "symbol": "stripe.subscriptions.create",
  "matchedProperty": "coupon",
  "reachability": "CONFIRMED_AFFECTED",
  "excludedSafeCalls": 26
}
05PLAN

Synthesize Context-Bound Migration Plan

The planning engine maps the confirmed finding to a deterministic transformation strategy, specifying the exact syntax tree modification.

INPUT

Confirmed finding + matching migration rule + target source context.

PROCESSING

Constructs a MigrationPlan defining the target AST node (PropertyAssignment), the replacement expression (discounts array), and bounding constraints.

OUTPUT

Structured, deterministic MigrationPlan JSON artifact.

FAILURE CONDITION (FAIL CLOSED)

Call-site structure contains ambiguous dynamic expressions that cannot be safely transformed deterministically → Flagged for manual review.

SYSTEM ARTIFACT: PLAN
// Structured Migration Plan
{
  "planId": "plan_9f82d1c0",
  "changeId": "stripe-v18-sub-coupon",
  "targetFile": "src/billing.ts",
  "nodeType": "PropertyAssignment",
  "before": "coupon: promoCouponId",
  "after": "discounts: [{ coupon: promoCouponId }]"
}
06PATCH

Generate Deterministic Source Patch

Applies the migration plan against the exact source text, preserving original indentation, quotation style, and developer comments.

INPUT

Baseline source snapshot + MigrationPlan.

PROCESSING

Executes minimal AST rewrite. Computes unified diff and calculates a canonical SHA256 patch digest of the resulting code.

OUTPUT

Unified patch diff and canonical patch digest bound to the baseline commit SHA.

FAILURE CONDITION (FAIL CLOSED)

Baseline source file has changed or digest does not match expected canonical representation → Patch generation halted.

SYSTEM ARTIFACT: PATCH
// Unified Source Diff
@@ -40,6 +40,6 @@ export async function createSubscription(customerId: string) {
   return await stripe.subscriptions.create({
     customer: customerId,
-    coupon: promoCouponId,
+    discounts: [{ coupon: promoCouponId }],
     items: [{ price: priceId }],
   });
07VERIFY

Run 4-Gate Pre-Flight Verification Harness

Before any Git branch or pull request is created, the candidate patch must pass four deterministic verification gates.

INPUT

Patched codebase snapshot in isolated execution sandbox.

PROCESSING

Gate 1: AST Syntax Validity parse. Gate 2: TypeScript compiler diagnostic check (tsc --noEmit). Gate 3: Call-site boundary constraint (verifies only allowed files & lines modified). Gate 4: Dry-run execution of repository test suite.

OUTPUT

Cryptographically signed Verification Evidence artifact binding baseline SHA, change ID, and patch digest.

FAILURE CONDITION (FAIL CLOSED)

Any compiler error, diagnostic failure, patch scope violation, or test failure → Process terminates. No PR is created.

SYSTEM ARTIFACT: VERIFY
// Cryptographically Signed Verification Evidence
{
  "proofLevel": "CONTRACT_VERIFIED",
  "syntaxValid": true,
  "typecheckPassed": true,
  "scopeValid": true,
  "testsPassed": true,
  "evidenceDigest": "d8a9c41f7e02b489e21190bc74a3..."
}
08PROPOSE

Push Isolated Branch & Open GitHub Draft PR

MY OWL enforces strict write isolation. It creates a dedicated branch with an explicit prefix (apiproof/*) and submits a GitHub Draft PR marked draft: true.

INPUT

Verified patch artifact + Signed Verification Evidence.

PROCESSING

Validates ControlledWriteRequest against write contract. Checks default branch HEAD SHA for divergence. Pushes single commit to apiproof/<change-id> and opens Draft PR via GitHub App API.

OUTPUT

GitHub Draft Pull Request containing side-by-side diffs, migration rationale, and verification reports.

FAILURE CONDITION (FAIL CLOSED)

Default branch HEAD has moved since the scan was performed (REPOSITORY_HEAD_DIVERGED) → Write rejected. Fresh scan required.

SYSTEM ARTIFACT: PROPOSE
// GitHub App Controlled Write Result
{
  "action": "DRAFT_PR_OPENED",
  "prNumber": 142,
  "branch": "apiproof/stripe-v18-update",
  "baseBranch": "main",
  "draft": true,
  "autoMerge": false
}
09REVIEW

Human Developer Review & Merge

Your engineering team retains total sovereignty. Engineers review the Draft PR, inspect automated test runs, and decide when to merge.

INPUT

GitHub Draft PR #142 on your repository.

PROCESSING

Your team conducts normal code review, runs your existing CI/CD checks, and merges the PR when ready.

OUTPUT

Safely migrated production code with complete audit history and zero silent failures.

FAILURE CONDITION (FAIL CLOSED)

Engineer closes or requests changes on PR → PR closed. MY OWL records resolution status in audit log.

SYSTEM ARTIFACT: REVIEW
// Developer Sovereignty Boundary
{
  "humanSignOffRequired": true,
  "autoMergePermissions": "NONE",
  "defaultBranchProtection": "PRESERVED",
  "status": "AWAITING_TEAM_REVIEW"
}
Connect GitHub Free
Read-only observation · Isolated branches · Human review boundary