gwrk Flamingo Icon > GWRK YOU BETTER GWRK!
FOXTROT CHARLIE // DOCS/PRODUCT/FOXTROT-CHARLIE.MD

What gets built is 1,000% more important than how it gets built.

Not rhetorically. Literally. [FOXTROT-CHARLIE.md:15-17]

"The scarce resource in AI-assisted engineering isn't code generation — it's architectural judgment."
gwrk is the automation of Foxtrot Charlie — an operating model built for outcomes, not ceremony. [WHAT_IS_GWRK.md:17, 59]
Mantra: Truth → Clarity → Throughput → Value [FOXTROT-CHARLIE.md:124-131]
  • • Discovery extracts truth.
  • • Definition creates clarity.
  • • Shipping creates throughput.
  • • Delivery creates value.
Sign in with Google
DOCS/BRANDING/GWRK-FLAMINGO-FLAT.PNG YOU BETTER GWRK!
gwrk — You better gwrk!

gwrk is pronounced "gwerk" — one syllable, rhymes with work. The name draws from the same well as grep, sed, awk, gawk — terse commands that do one thing ruthlessly well.

The precision of GNU tooling meets the audacity of the runway. A flamingo stands on one leg in the mud and looks like it owns the place. [WHAT_IS_GWRK.md:221-232]

INTEGRATED LOOP: THE FOUR PILLARS IN MOTION [FOXTROT-CHARLIE.MD:372-378]

Discovery → Definition → Shipping → Delivery → Back to Discovery

[Source: Foxtrot Charlie PDF Page 1 Lead Diagram]
Pillar What It Answers (Verbatim) Operating Principles (Verbatim) Citation
Pillar 1: Discovery (Truth Extraction)
Extract truth. Don't wait for it.
"What progress is the customer trying to make, and what's blocking it?" Messy truth > clean narratives • Direct exposure > filtered reports • Every insight maps to progress • Rapid probes: prototypes, instrumentation, small tests • Compress information: shared shorthand, simple truths FOXTROT-CHARLIE.md:135-183
Pillar 2: Definition (Clarity & Commitments)
Say what we will do, and when.
"What are we building, for whom, what is 'done', and when will it be completed?" Specs and commitments are written artifacts, not conversations • ACs describe testable behavior, not interpretation • Internal Roadmap = The Commitment Spine • Strong Definition eliminates 70% of rework FOXTROT-CHARLIE.md:187-240
Pillar 3: Shipping (Execution & Learning)
Learn fast, fix fast.
"How do we build and ship well, and learn fast?" Ship to learn • Fast reds: surface problems early • State > story — tickets, tests, dashboards are truth • QA + automation daily, not a phase • No heroics; shipping is a reflex FOXTROT-CHARLIE.md:244-282
Pillar 4: Delivery (Value Realization)
Prove value, not activity.
"Did this create value in the real world, and how do we know?" Shipped ≠ delivered • Value = adoption + outcomes • External Roadmap = Delivery's Trust Artifact • Field-facing truth must match product reality • Delivery produces value signal that becomes new Discovery truth FOXTROT-CHARLIE.md:286-330
# Foxtrot Charlie Operating Invariants (Verbatim) Failure Modes & Self-Correction (Verbatim) Citation
1 Every initiative has a single accountable owner. No shared ownership. No rotating responsibility. When execution degrades, Foxtrot Charlie assumes one of three failures:

• Truth is missing → return to Discovery.
• Clarity is broken → rewrite commitments.
• Throughput is stalled → reduce batch size and ship.

No new process is added. No ceremonies are created. The system tightens around reality.
FOXTROT-CHARLIE.md:98-120

FOXTROT-CHARLIE.md:334-346
2 Reality is expressed as state, not narrative. If it cannot be pointed to, it does not exist.
3 All commitments exist as written artifacts. If it is not written, it is not committed.
4 Shipping happens frequently enough to surface truth. Long cycles hide error. Short cycles reveal it.
5 Value is measured in adoption or outcome, not effort. Activity without impact is noise.
FORTHCOMING ARTICLE
"Absorb and Cascade" — Running Foxtrot Charlie at WISEcode and in Personal Initiatives
REFERENCE ARCHITECTURE // HEXAGONAL-FUNCTIONAL & FROZEN PORTS [.gwrk/architecture.md • ADR-011 • ADR-013 • ADR-014]
Rule Hexagonal-Functional Target Rules (Verbatim) Citation
2.1 Domain policy MUST depend inward. Ports declare boundaries. Adapters implement effects. Composition wires dependencies. .gwrk/architecture.md:15 • ADR-013 §2.1
2.2 Domain code MUST NOT access external state. Isolate filesystem and network effects in adapters. Pass environment and clock values as inputs. .gwrk/architecture.md:17 • ADR-013 §2.2
2.3 Core operations MUST return explicit results without hidden mutable state. Equal inputs produce equal outputs. Test domain laws. .gwrk/architecture.md:18 • ADR-013 §2.3
2.4 Functions MUST separate policy from effects. Use one domain term per concept. Identify duplicate work and explicit error paths. .gwrk/architecture.md:19 • ADR-013 §2.4
2.5 Implementation MUST follow observed RED tests with GREEN execution evidence. Passing checks do not erase uncovered design defects. .gwrk/architecture.md:20 • ADR-013 §2.5
Frozen Port Interface (Verbatim) Responsibility (Verbatim) Adapter Boundary (Verbatim) Citation
GoogleIdentityVerifierPort Verify RS256 Google ID tokens via JWKS and live allowlist src/adapters/auth/google-id-token.ts ADR-014 §2.2:34
CredentialCryptoPort Generate 32-byte secrets and compare SHA-256 verifiers in constant time src/adapters/auth/credential-crypto.ts ADR-014 §2.2:35
AuthStorePort Persist API credential verifiers, session digests and audit events src/adapters/sqlite/auth-store.ts ADR-014 §2.2:36
CredentialGrantAdminPort Atomically create or rotate credentials with project role bindings src/adapters/sqlite/auth-store.ts ADR-014 §2.2:37
BrowserCsrfPort Issue and verify session-bound browser CSRF tokens src/adapters/auth/browser-csrf.ts ADR-014 §2.2:38
ProxySessionLogoutPort Clear proxy cookies after origin digest revocation src/adapters/auth/proxy-logout.ts ADR-014 §2.2:39
HttpClientCredentialPort Attach origin-bound HTTPS credentials on remote CLI probes src/adapters/auth/http-client-credential.ts ADR-014 §2.2:40
DOCS/PRODUCT/FOXTROT-CHARLIE.MD // VERBATIM PUBLIC ARTICLE

Foxtrot Charlie: The Four Pillars of Product Work Unburdened by Ceremony

A concise operating model for execution, clarity, and customer value across PM, Engineering, QA, Sales, and Success.
Also, a work-friendly euphemism for Fuck Ceremony.

If the way we build software mattered more than what we build, the world would be run by black-belt Scrum masters, TDD ninjas, and CAPM-certified project managers. Every cargo-cult Agile shop would be minting millionaires. Jira burndowns and perfect sprint ceremonies would have produced empires.

But that’s not how this game works.
It never has.

I will grant that for established leaders in the market, the marginal gains of building things correctly do matter—at least until someone else builds the right thing for right now and ships it quickly.

After almost two decades doing this, the cleanest truth I’ve earned is this:

What gets built is 1,000% more important than how it gets built.

Not rhetorically. Literally.

And building the right thing has always been a messy collision of obsession, skill, insight, timing, and blind luck—not of pristine process or textbook agility.

The thing that matters most is a near-maniacal obsession with figuring out the exact right thing to build.

Facebook was built under the mantra “move fast and break things,” and they did—spectacularly. The engineering stories are legendary disasters. Spaghetti code was the only kind of code. And yet, they built the right thing at the right moment. The market rewarded truth, not tidiness. They earned passage to a place where they could obsess about process and build things correctly.

Meanwhile, companies like DataRobot had every chance to win. If they’d built the right thing, they’d be worth billions today. Shortly after I arrived we were autopsying tech debt, identifying product gaps, play-testing PLG, and fretting timing failures. But the postmortems miss the point. The brutal reality is:

They didn’t build the right product, and for most of their life, they didn’t build it well.

Only until later did seasoned, high-caliber builders arrive—cleaning up the codebase, tightening CI/CD, writing Google-grade PRDs with dense front-matter and beautiful acceptance criteria.

All the “best practices” finally showed up.

And it still didn’t matter.

Because no amount of flawless process can salvage a bad bet.
You cannot cargo-cult your way into product-market fit.
You can have immaculate sprints and still sprint straight into irrelevance.

And this brings me to tooling—the third rail of product conversations.

Tooling doesn’t matter.

Not the fancy tools.
Not the “industry-standard” tools.
Not the ones everyone swears by.
Not the ones that claim to generate strategy with AI.

What I’ve seen work:
Paper notes, AHHah, index cards, Confluence pages, spreadsheets, 300-slide decks, gold-star PRDs, front-matter that occupies 1/4 of the page, Miro boards, whiteboards, Notion tables, napkin sketches, etc.

What I’ve seen fail:
Every single item above and thinking that tools will do the thinking for you.

Tools don’t extract truth—people do.
Tools don’t make decisions—leaders do.
Tools don’t create clarity—precision does.

Tool choice is second-order.
Truth extraction and clear thinking are first-order.

The only thing I’ve seen that truly matters is velocity inspected and protected daily.

Velocity gives you reps.
Reps give you truth.
Truth gives you direction.

And the only thing that reliably increases velocity is clarity.

Agile is supposed to help teams operate in the liminal space of unknown unknowns. But if the biggest unknown is exactly what the hell you should be building, then no amount of sprint discipline, story-point virtuosity, or retrospective poetry will save you. You’ll simply execute beautifully—in the wrong direction.

Here’s the part people avoid because it’s politically incorrect:

When the landscape is dominated by unknown unknowns, high command-and-control communication isn’t authoritarian—it’s literally battle-tested best practice.

It’s the only approach proven—in war rooms, outages, turnarounds, rescues, and existential pivots—to cut through ambiguity fast enough to matter. Not because it’s fun, and not because people enjoy being managed, but because in conditions of chaos and uncertainty:

  • Someone must extract the truth.

  • Someone must assign clarity.

  • Someone must enforce follow-through.

  • Someone must call the shot.

That’s the backbone of Foxtrot Charlie.

Not ceremony.
Not performance Agile.
Not the cargo-cult rituals companies mistake for real discipline.
Not tool worship masquerading as thinking.

Truth → Clarity → Throughput → Value.

Everything else is decoration.

The four pillars—Discovery, Definition, Shipping, and Delivery—are the machinery that operationalizes this reality.
Together they form an execution model built not for theater, but for outcomes.


Foxtrot Charlie Operating Invariants

Foxtrot Charlie is not a philosophy.
It is a system that only works if these conditions are enforced:

  1. Every initiative has a single accountable owner.
    No shared ownership. No rotating responsibility.

  2. Reality is expressed as state, not narrative.
    If it cannot be pointed to, it does not exist.

  3. All commitments exist as written artifacts.
    If it is not written, it is not committed.

  4. Shipping happens frequently enough to surface truth.
    Long cycles hide error. Short cycles reveal it.

  5. Value is measured in adoption or outcome, not effort.
    Activity without impact is noise.

When any invariant breaks, ceremony rushes in to compensate.

This is not ideological. It is diagnostic.


Mantra: Truth → Clarity → Throughput → Value

  • Discovery extracts truth.

  • Definition creates clarity.

  • Shipping creates throughput.

  • Delivery creates value.

Alignment is the shadow cast by this healthy system—not its goal.


Pillar 1: Discovery (Truth Extraction)

Extract truth. Don’t wait for it.

Purpose:
Actively extract, synthesize, and validate the truths that determine what must be built and why.
Discovery is not passive—it is truth extraction from customers, the market, and the system.

What Discovery Answers (The most meaningful jobs to be done)

“What progress is the customer trying to make, and what’s blocking it?”

Truth Extraction Means

  • Pulling insights customers cannot articulate on their own

  • Reconciling contradictory stakeholder perspectives

  • Identifying progress patterns that drive differentiation

  • Recognizing technical and operational pains that shape feasibility

  • Running probes to validate assumptions

  • Translating raw signal into strategic clarity

Sources of Truth

  • Customer interviews & discovery calls

  • Support threads & implementation observations

  • SE/Sales insights & competitive intel

  • Telemetry, usage data, analytics

  • Engineering pain points & architectural limits

JTBD Interpretation

  • Pushes: friction forcing change

  • Pulls: desired outcomes

  • Habits: anchors to status quo

  • Anxieties: risks inhibiting action

JTBD Anchor

A Job is a promise you’ll make needed progress—we enable progress, not features.

Discovery Operating Principles

  • Messy truth > clean narratives

  • Direct exposure > filtered reports

  • Every insight maps to progress

  • Rapid probes: prototypes, instrumentation, small tests

  • Compress information: shared shorthand, simple truths

Discovery extracts truth. Everything else depends on it.


Pillar 2: Definition (Clarity & Commitments)

Say exactly what we will do, and when.

Purpose:
Translate extracted truth into buildable, testable commitments with crisp boundaries and explicit ownership.

What Definition Answers

“What exactly are we building, for whom, what is ‘done’, and when will it be completed?”

Core Artifacts

  • Lean PRDs / roadmap-aligned specs

  • Acceptance Criteria (binary, observable)

  • Definition of Done (DoD)

  • UAT & QA acceptance matrices

  • Architectural constraints

  • Internal Roadmap (Definition’s backbone)

Internal Roadmap: The Commitment Spine

The internal roadmap exists to:

  • Translate truth into sequenced, feasible commitments

  • Clarify scope, order, dependencies, and capacity

  • Provide substrate for PRDs, engineering planning, QA

  • Reflect real system state with continuous RAGB updates

Internal Roadmap Principles

  • A commitment artifact, not a marketing artifact

  • Granular, honest, tied to RAGB

  • If learning in Discovery doesn’t update it, it isn’t real learning

Execution Compression Lives Here

Definition is where vision turns into execution:

  • Clear tasking

  • Explicit owners

  • Follow-up

  • Follow-through

Clarity accelerates execution. Ambiguity destroys it.

Definition Operating Principles

  • Specs and commitments are written artifacts, not conversations

  • ACs describe testable behavior, not interpretation

  • Collaborate early across PM, Eng, QA, Field

  • Strong Definition eliminates 70% of rework

Definition converts truth into commitments.


Pillar 3: Shipping (Execution & Learning)

Learn fast, fix fast.

Purpose:
Build and ship increments that generate learning and converge quickly toward customer value.

What Shipping Answers

“How do we build and ship well, and learn fast?”

Cadence

  • Weekly shipping

  • Daily RAGB state

  • Small batch sizes

  • Instrumented increments

Shipping Operating Principles

  • Ship to learn

  • Fast reds: surface problems early

  • State > story—tickets, tests, dashboards are truth

  • QA + automation daily, not a phase

  • No heroics; shipping is a reflex

Core Responsibilities

  • Engineering → throughput & correctness

  • PM → clarity & sequencing

  • QA → verification & safety

  • Ops → reliability & observability

Truth + Shipping

Shipping reveals truth—but Discovery interprets it.
Shipping produces the signal; Discovery updates truth.

Shipping creates throughput. Throughput reveals signal.


Pillar 4: Delivery (Value Realization)

Prove value, not activity.

Purpose:
Ensure shipped work produces measurable customer value and business outcomes.

What Delivery Answers

“Did this create value in the real world, and how do we know?”

Delivery Activities

  • Field enablement & positioning

  • Sales readiness

  • Onboarding, implementation, configuration

  • Usage, adoption, sentiment, renewal metrics

  • Closing the loop back to Discovery

External Roadmap: Delivery’s Trust Artifact

The external roadmap belongs to Delivery because it expresses market-facing truth, not internal commitments.

Its purpose:

  • Set expectations

  • Enable field alignment

  • Anchor renewal & expansion

  • Show how customer progress will improve

External Roadmap Principles

  • Outcome-led, not feature-led

  • Directional, high-level

  • JTBD-framed

  • Credibility > optimism

Delivery Operating Principles

  • Shipped ≠ delivered

  • Value = adoption + outcomes

  • Field-facing truth must match product reality

  • Delivery produces value signal that becomes new Discovery truth

Delivery creates value. Value becomes new truth.


Failure Modes and Self-Correction

When execution degrades, Foxtrot Charlie assumes one of three failures:

  • Truth is missing → return to Discovery.

  • Clarity is broken → rewrite commitments.

  • Throughput is stalled → reduce batch size and ship.

No new process is added.
No ceremonies are created.
The system tightens around reality.

This is how Foxtrot Charlie corrects without bureaucracy.


Why Foxtrot Charlie Scales Better Than Agile

Agile optimizes execution once the problem is known.

Foxtrot Charlie exists for when the problem is still being discovered.

Agile assumes:

  • Relative stability

  • Shared understanding

  • Incremental optimization

Foxtrot Charlie assumes:

  • Ambiguity

  • Disagreement

  • The need for fast, authoritative clarity

Foxtrot Charlie scales by compressing decision latency, not by managing consensus.


Integrated Loop: The Four Pillars in Motion

Discovery → Definition → Shipping → Delivery → Back to Discovery

A continuous loop of truth, clarity, throughput, and value.

Alignment is a trailing indicator of a system wired to reality.


Summary

  • Internal roadmap → Definition (commitment spine)

  • External roadmap → Delivery (trust artifact)

Together, the Four Pillars form the Foxtrot Charlie operating system:

Truth → Clarity → Throughput → Value
Discovery → Definition → Shipping → Delivery

Truth extracted.
Clarity committed.
Throughput shipped.
Value delivered.

SPHINX DOCUMENTATION // BUILT WITH SPHINX 9.1.1 & MYST-PARSER

gwrk Documentation & Reference Architecture

You better gwrk! Truth → Clarity → Throughput → Value.

Sources: docs/product/FOXTROT-CHARLIE.md & docs/product/WHAT_IS_GWRK.md

gwrk is the automation of Foxtrot Charlie (Discovery → Definition → Shipping → Delivery → Back to Discovery). It takes the architectural judgment you have already done and turns written commitments into autonomous shipped code.

Mantra: Truth → Clarity → Throughput → Value

From docs/product/FOXTROT-CHARLIE.md:

  • Discovery extracts truth.

  • Definition creates clarity.

  • Shipping creates throughput.

  • Delivery creates value.

Alignment is the shadow cast by this healthy system—not its goal.

The Four Pillars (Verbatim from docs/product/FOXTROT-CHARLIE.md)

Pillar

Opening Line

Purpose

What It Answers

Closing Line

Pillar 1: Discovery (Truth Extraction)

Extract truth. Don’t wait for it.

Actively extract, synthesize, and validate the truths that determine what must be built and why.

“What progress is the customer trying to make, and what’s blocking it?”

Discovery extracts truth. Everything else depends on it.

Pillar 2: Definition (Clarity & Commitments)

Say exactly what we will do, and when.

Translate extracted truth into buildable, testable commitments with crisp boundaries and explicit ownership.

“What exactly are we building, for whom, what is ‘done’, and when will it be completed?”

Definition converts truth into commitments.

Pillar 3: Shipping (Execution & Learning)

Learn fast, fix fast.

Build and ship increments that generate learning and converge quickly toward customer value.

“How do we build and ship well, and learn fast?”

Shipping creates throughput. Throughput reveals signal.

Pillar 4: Delivery (Value Realization)

Prove value, not activity.

Ensure shipped work produces measurable customer value and business outcomes.

“Did this create value in the real world, and how do we know?”

Delivery creates value. Value becomes new truth.

Foxtrot Charlie: The Four Pillars of Product Work Unburdened by Ceremony

A concise operating model for execution, clarity, and customer value across PM, Engineering, QA, Sales, and Success.
Also, a work-friendly euphemism for Fuck Ceremony.

If the way we build software mattered more than what we build, the world would be run by black-belt Scrum masters, TDD ninjas, and CAPM-certified project managers. Every cargo-cult Agile shop would be minting millionaires. Jira burndowns and perfect sprint ceremonies would have produced empires.

But that’s not how this game works.
It never has.

I will grant that for established leaders in the market, the marginal gains of building things correctly do matter—at least until someone else builds the right thing for right now and ships it quickly.

After almost two decades doing this, the cleanest truth I’ve earned is this:

What gets built is 1,000% more important than how it gets built.

Not rhetorically. Literally.

And building the right thing has always been a messy collision of obsession, skill, insight, timing, and blind luck—not of pristine process or textbook agility.

The thing that matters most is a near-maniacal obsession with figuring out the exact right thing to build.

Facebook was built under the mantra “move fast and break things,” and they did—spectacularly. The engineering stories are legendary disasters. Spaghetti code was the only kind of code. And yet, they built the right thing at the right moment. The market rewarded truth, not tidiness. They earned passage to a place where they could obsess about process and build things correctly.

Meanwhile, companies like DataRobot had every chance to win. If they’d built the right thing, they’d be worth billions today. Shortly after I arrived we were autopsying tech debt, identifying product gaps, play-testing PLG, and fretting timing failures. But the postmortems miss the point. The brutal reality is:

They didn’t build the right product, and for most of their life, they didn’t build it well.

Only until later did seasoned, high-caliber builders arrive—cleaning up the codebase, tightening CI/CD, writing Google-grade PRDs with dense front-matter and beautiful acceptance criteria.

All the “best practices” finally showed up.

And it still didn’t matter.

Because no amount of flawless process can salvage a bad bet.
You cannot cargo-cult your way into product-market fit.
You can have immaculate sprints and still sprint straight into irrelevance.

And this brings me to tooling—the third rail of product conversations.

Tooling doesn’t matter.

Not the fancy tools.
Not the “industry-standard” tools.
Not the ones everyone swears by.
Not the ones that claim to generate strategy with AI.

What I’ve seen work:
Paper notes, AHHah, index cards, Confluence pages, spreadsheets, 300-slide decks, gold-star PRDs, front-matter that occupies 1/4 of the page, Miro boards, whiteboards, Notion tables, napkin sketches, etc.

What I’ve seen fail:
Every single item above and thinking that tools will do the thinking for you.

Tools don’t extract truth—people do.
Tools don’t make decisions—leaders do.
Tools don’t create clarity—precision does.

Tool choice is second-order.
Truth extraction and clear thinking are first-order.

The only thing I’ve seen that truly matters is velocity inspected and protected daily.

Velocity gives you reps.
Reps give you truth.
Truth gives you direction.

And the only thing that reliably increases velocity is clarity.

Agile is supposed to help teams operate in the liminal space of unknown unknowns. But if the biggest unknown is exactly what the hell you should be building, then no amount of sprint discipline, story-point virtuosity, or retrospective poetry will save you. You’ll simply execute beautifully—in the wrong direction.

Here’s the part people avoid because it’s politically incorrect:

When the landscape is dominated by unknown unknowns, high command-and-control communication isn’t authoritarian—it’s literally battle-tested best practice.

It’s the only approach proven—in war rooms, outages, turnarounds, rescues, and existential pivots—to cut through ambiguity fast enough to matter. Not because it’s fun, and not because people enjoy being managed, but because in conditions of chaos and uncertainty:

  • Someone must extract the truth.

  • Someone must assign clarity.

  • Someone must enforce follow-through.

  • Someone must call the shot.

That’s the backbone of Foxtrot Charlie.

Not ceremony.
Not performance Agile.
Not the cargo-cult rituals companies mistake for real discipline.
Not tool worship masquerading as thinking.

Truth → Clarity → Throughput → Value.

Everything else is decoration.

The four pillars—Discovery, Definition, Shipping, and Delivery—are the machinery that operationalizes this reality.
Together they form an execution model built not for theater, but for outcomes.


Foxtrot Charlie Operating Invariants

Foxtrot Charlie is not a philosophy.
It is a system that only works if these conditions are enforced:

  1. Every initiative has a single accountable owner.
    No shared ownership. No rotating responsibility.

  2. Reality is expressed as state, not narrative.
    If it cannot be pointed to, it does not exist.

  3. All commitments exist as written artifacts.
    If it is not written, it is not committed.

  4. Shipping happens frequently enough to surface truth.
    Long cycles hide error. Short cycles reveal it.

  5. Value is measured in adoption or outcome, not effort.
    Activity without impact is noise.

When any invariant breaks, ceremony rushes in to compensate.

This is not ideological. It is diagnostic.


Mantra: Truth → Clarity → Throughput → Value

  • Discovery extracts truth.

  • Definition creates clarity.

  • Shipping creates throughput.

  • Delivery creates value.

Alignment is the shadow cast by this healthy system—not its goal.


Pillar 1: Discovery (Truth Extraction)

Extract truth. Don’t wait for it.

Purpose:
Actively extract, synthesize, and validate the truths that determine what must be built and why.
Discovery is not passive—it is truth extraction from customers, the market, and the system.

What Discovery Answers (The most meaningful jobs to be done)

“What progress is the customer trying to make, and what’s blocking it?”

Truth Extraction Means

  • Pulling insights customers cannot articulate on their own

  • Reconciling contradictory stakeholder perspectives

  • Identifying progress patterns that drive differentiation

  • Recognizing technical and operational pains that shape feasibility

  • Running probes to validate assumptions

  • Translating raw signal into strategic clarity

Sources of Truth

  • Customer interviews & discovery calls

  • Support threads & implementation observations

  • SE/Sales insights & competitive intel

  • Telemetry, usage data, analytics

  • Engineering pain points & architectural limits

JTBD Interpretation

  • Pushes: friction forcing change

  • Pulls: desired outcomes

  • Habits: anchors to status quo

  • Anxieties: risks inhibiting action

JTBD Anchor

A Job is a promise you’ll make needed progress—we enable progress, not features.

Discovery Operating Principles

  • Messy truth > clean narratives

  • Direct exposure > filtered reports

  • Every insight maps to progress

  • Rapid probes: prototypes, instrumentation, small tests

  • Compress information: shared shorthand, simple truths

Discovery extracts truth. Everything else depends on it.


Pillar 2: Definition (Clarity & Commitments)

Say exactly what we will do, and when.

Purpose:
Translate extracted truth into buildable, testable commitments with crisp boundaries and explicit ownership.

What Definition Answers

“What exactly are we building, for whom, what is ‘done’, and when will it be completed?”

Core Artifacts

  • Lean PRDs / roadmap-aligned specs

  • Acceptance Criteria (binary, observable)

  • Definition of Done (DoD)

  • UAT & QA acceptance matrices

  • Architectural constraints

  • Internal Roadmap (Definition’s backbone)

Internal Roadmap: The Commitment Spine

The internal roadmap exists to:

  • Translate truth into sequenced, feasible commitments

  • Clarify scope, order, dependencies, and capacity

  • Provide substrate for PRDs, engineering planning, QA

  • Reflect real system state with continuous RAGB updates

Internal Roadmap Principles

  • A commitment artifact, not a marketing artifact

  • Granular, honest, tied to RAGB

  • If learning in Discovery doesn’t update it, it isn’t real learning

Execution Compression Lives Here

Definition is where vision turns into execution:

  • Clear tasking

  • Explicit owners

  • Follow-up

  • Follow-through

Clarity accelerates execution. Ambiguity destroys it.

Definition Operating Principles

  • Specs and commitments are written artifacts, not conversations

  • ACs describe testable behavior, not interpretation

  • Collaborate early across PM, Eng, QA, Field

  • Strong Definition eliminates 70% of rework

Definition converts truth into commitments.


Pillar 3: Shipping (Execution & Learning)

Learn fast, fix fast.

Purpose:
Build and ship increments that generate learning and converge quickly toward customer value.

What Shipping Answers

“How do we build and ship well, and learn fast?”

Cadence

  • Weekly shipping

  • Daily RAGB state

  • Small batch sizes

  • Instrumented increments

Shipping Operating Principles

  • Ship to learn

  • Fast reds: surface problems early

  • State > story—tickets, tests, dashboards are truth

  • QA + automation daily, not a phase

  • No heroics; shipping is a reflex

Core Responsibilities

  • Engineering → throughput & correctness

  • PM → clarity & sequencing

  • QA → verification & safety

  • Ops → reliability & observability

Truth + Shipping

Shipping reveals truth—but Discovery interprets it.
Shipping produces the signal; Discovery updates truth.

Shipping creates throughput. Throughput reveals signal.


Pillar 4: Delivery (Value Realization)

Prove value, not activity.

Purpose:
Ensure shipped work produces measurable customer value and business outcomes.

What Delivery Answers

“Did this create value in the real world, and how do we know?”

Delivery Activities

  • Field enablement & positioning

  • Sales readiness

  • Onboarding, implementation, configuration

  • Usage, adoption, sentiment, renewal metrics

  • Closing the loop back to Discovery

External Roadmap: Delivery’s Trust Artifact

The external roadmap belongs to Delivery because it expresses market-facing truth, not internal commitments.

Its purpose:

  • Set expectations

  • Enable field alignment

  • Anchor renewal & expansion

  • Show how customer progress will improve

External Roadmap Principles

  • Outcome-led, not feature-led

  • Directional, high-level

  • JTBD-framed

  • Credibility > optimism

Delivery Operating Principles

  • Shipped ≠ delivered

  • Value = adoption + outcomes

  • Field-facing truth must match product reality

  • Delivery produces value signal that becomes new Discovery truth

Delivery creates value. Value becomes new truth.


Failure Modes and Self-Correction

When execution degrades, Foxtrot Charlie assumes one of three failures:

  • Truth is missing → return to Discovery.

  • Clarity is broken → rewrite commitments.

  • Throughput is stalled → reduce batch size and ship.

No new process is added.
No ceremonies are created.
The system tightens around reality.

This is how Foxtrot Charlie corrects without bureaucracy.


Why Foxtrot Charlie Scales Better Than Agile

Agile optimizes execution once the problem is known.

Foxtrot Charlie exists for when the problem is still being discovered.

Agile assumes:

  • Relative stability

  • Shared understanding

  • Incremental optimization

Foxtrot Charlie assumes:

  • Ambiguity

  • Disagreement

  • The need for fast, authoritative clarity

Foxtrot Charlie scales by compressing decision latency, not by managing consensus.


Integrated Loop: The Four Pillars in Motion

Discovery → Definition → Shipping → Delivery → Back to Discovery

A continuous loop of truth, clarity, throughput, and value.

Alignment is a trailing indicator of a system wired to reality.


Summary

  • Internal roadmap → Definition (commitment spine)

  • External roadmap → Delivery (trust artifact)

Together, the Four Pillars form the Foxtrot Charlie operating system:

Truth → Clarity → Throughput → Value
Discovery → Definition → Shipping → Delivery

Truth extracted.
Clarity committed.
Throughput shipped.
Value delivered.

Getting Started & Configuration

gwrk layers configuration across three files so project identity stays tracked in Git while personal agent choices and secrets remain private.

Configuration Layering

Layer

Path

Tracked

Purpose

Project

.gwrkrc.json

Yes

Project identity, loopback port (18790), parallelism defaults

Local

.gwrkrc.local.json

No

Personal agent backend choice (agy, claude, gemini) and local registry

Global

~/.gwrk/config.json

No

Machine-wide credentials and notification tokens

First-Time Setup

# 1. Copy the local agent configuration template
cp .gwrkrc.local.json.example .gwrkrc.local.json

# 2. Initialize or repair project state and ~/.gwrk/setup.json
gwrk init

# 3. Verify architecture and ADR citation integrity
gwrk define adr --check

Define -> Ship Workflow

Every feature follows a strict four-stage definition pipeline before autonomous execution begins:

# Stage 1: Specification with binary acceptance criteria
gwrk define spec 051-hosted-aws-pilot

# Stage 2: Phased implementation plan and contracts
gwrk define plan 051-hosted-aws-pilot

# Stage 3: RED test suite and coverage matrix
gwrk define tests 051-hosted-aws-pilot

# Stage 4: Task decomposition and executable bash gate scripts
gwrk define tasks 051-hosted-aws-pilot

# Autonomous phase execution in an isolated git worktree
gwrk ship 051-hosted-aws-pilot phase-01 --worktree --max-iterations 2

CLI Command Grammar & Reference

All commands follow the Foxtrot Charlie grammar:

gwrk <verb> [subverb] <feature> [phase] [--options]

Feature arguments support prefix aliasing (051 resolves to specs/051-hosted-aws-pilot).

Pillar 1 & 2: Discovery & Definition (define)

Command

Description

gwrk define research <topic>

Scaffold a Discovery initiative using JTBD, ontology, or technical methodology

gwrk define spec <feature>

Create or refine spec.md with binary acceptance criteria

gwrk define plan <feature>

Generate plan.md with phased architecture and test coverage matrix

gwrk define tests <feature>

Author RED tests and verify coverage alignment

gwrk define tasks <feature>

Produce .gwrk/tasks.json and executable gates/phase-XX.sh scripts

gwrk define adr --check

Validate Architecture Decision Record headers, approvals, and index

Pillar 3: Shipping (ship, tasks, gate)

Command

Description

gwrk ship <feature> [phase]

Run autonomous implement -> build -> test -> review loop

gwrk ship <feature> --dry-run

Verify pre-flight setup and worktree readiness without launching agents

gwrk gate <feature> <taskId>

Execute a single task gate script directly

gwrk tasks list <feature>

Inspect phase and task RAGB statuses from .gwrk/tasks.json

gwrk tasks next <feature> <phase>

Print the next actionable task in a phase

Execution Compression & Velocity Signals (measure)

Command

Description

gwrk measure pulse

Inspect daily repository shipping velocity and commit activity

gwrk measure compression <feature>

Inspect execution compression (LOC-derived effort forecast vs. actual shipping time)

Hosted Reference Architecture Operations (auth, db, server)

Command

Description

gwrk server start --foreground

Start the Fastify control-plane daemon on loopback 127.0.0.1:18790

gwrk auth key create --label <name> --grant <slug>=<role> --expires-at <iso> --out <file>

Provision a scoped gwrk_ak_v1_ operator API credential into a 0600 file

gwrk auth key list

List active and revoked operator API credentials without exposing secrets

gwrk auth key rotate <credentialId> --expires-at <iso> --out <file>

Atomically rotate an operator API key and revoke the predecessor

gwrk auth key revoke <credentialId>

Immediately revoke an operator API credential

gwrk db backup --out <dir>

Create a verified SQLite snapshot with SHA-256 manifest

gwrk db restore --from <dir> --force

Restore SQLite state fail-closed from a verified backup directory

gwrk db rollback-check --target-release <path>

Verify migration compatibility before rolling back a release symlink

Reference Architecture: Hexagonal-Functional & Hosted Auth (ADR-011, ADR-013, ADR-014)

1. Hexagonal-Functional Target Rules (.gwrk/architecture.md & ADR-013)

  • Rule 2.1: Domain policy MUST depend inward. Ports declare boundaries. Adapters implement effects. Composition wires dependencies.

  • Rule 2.2: Domain code MUST NOT access external state. Isolate filesystem and network effects in adapters. Pass environment and clock values as inputs.

  • Rule 2.3: Core operations MUST return explicit results without hidden mutable state. Equal inputs produce equal outputs. Test domain laws.

  • Rule 2.4: Functions MUST separate policy from effects. Use one domain term per concept. Identify duplicate work and explicit error paths.

  • Rule 2.5: Implementation MUST follow observed RED tests with GREEN execution evidence. Passing checks do not erase uncovered design defects.

2. Four-Layer Hexagonal Package Structure (ADR-011 §2.1)

  1. src/domain/: Pure domain types, parsers, and solvers with zero imports from application, ports, adapters, node:fs, node:child_process, or better-sqlite3.

  2. src/ports/: Inbound and outbound port interfaces (AgentPort, ToolchainPort, NotificationPort, repository ports) importing only from src/domain/.

  3. src/application/: Orchestrators and use-case services importing only from src/domain/ and src/ports/.

  4. src/adapters/: Infrastructure implementations (cli, server, sqlite, git, agents, plugins, toolchain) implementing src/ports/.

3. Hosted Production Authentication Architecture (ADR-014 §2.2)

Decision (ADR-014): Authenticate hosted browsers through origin-verified Google OpenID Connect (OIDC) ID tokens with digest-only sessions and authenticate automation through finite-expiry opaque API credentials bound to existing role bindings.

Constraint (ADR-014): Hosted HTTP origins MUST verify Google ID tokens or opaque API credential verifiers before executing operational handlers, and MUST NOT trust public identity headers, store raw credentials or Google tokens, or grant roles automatically on login.

Interface

Responsibility

Adapter boundary

GoogleIdentityVerifierPort

Verify RS256 Google ID tokens via JWKS and live allowlist

src/adapters/auth/google-id-token.ts

CredentialCryptoPort

Generate 32-byte secrets and compare SHA-256 verifiers in constant time

src/adapters/auth/credential-crypto.ts

AuthStorePort

Persist API credential verifiers, session digests and audit events

src/adapters/sqlite/auth-store.ts

CredentialGrantAdminPort

Atomically create or rotate credentials with role bindings

src/adapters/sqlite/auth-store.ts

BrowserCsrfPort

Issue and verify session-bound browser CSRF tokens

src/adapters/auth/browser-csrf.ts

ProxySessionLogoutPort

Clear proxy cookies after origin digest revocation

src/adapters/auth/proxy-logout.ts

HttpClientCredentialPort

Attach origin-bound HTTPS credentials on remote CLI probes

src/adapters/auth/http-client-credential.ts

4. Operational SQLite State & Fail-Closed Guarantees (ADR-014 §2.3–2.4)

  • Digest-Only Persistence: Operational authentication tables (api_credentials, google_sessions and auth_audit_events) persist SHA-256 verifiers and token digests only. They store zero raw API credentials and zero raw Google tokens.

  • Closed Route Policy: Every hosted route declares its policy in a closed table (src/domain/auth-policy.ts). Unclassified routes return HTTP 404 and disallowed methods return HTTP 405.

  • Origin-First Logout: Public /oauth2/sign_out is denied so browser logout revokes the origin session digest before clearing proxy cookies.

  • Browser Mutation CSRF: Browser mutations require a matching same-origin Origin header and a header-only Cross-Site Request Forgery (CSRF) token bound to the verified Google session digest.

HTTP Control Plane API Reference

The complete OpenAPI 3.1 specification is stored at docs/openapi/gwrk-openapi.yaml and rendered interactively in the root portal at https://gwrk.gforge.ai/#api.

Route Policy Table (classifyHostedRoute)

Route

Methods

Auth Policy

Required Access

Public Edge

/

GET, HEAD

public_browser_entry

none

Yes

/oauth2/start

GET, HEAD

public_oauth_start

none

Yes

/oauth2/callback

GET, HEAD

public_oauth_callback

none

Yes

/api/auth/session

GET, HEAD

google_session_only

own_session

Yes (no-store)

/api/auth/logout

POST

google_session_only

own_session + CSRF

Yes (no-store)

/api/status

GET, HEAD

google_or_api_key

read

Yes

/api/health

GET, HEAD

google_or_api_key

read

Yes

/api/dispatch

POST

google_or_api_key

operate (+ CSRF if browser)

Yes

/api/dispatch/queue

GET, HEAD

google_or_api_key

read

Yes

/api/dispatch/:feature/:phase

GET, HEAD

google_or_api_key

read

Yes

/api/notify

POST

google_or_api_key

operate (+ CSRF if browser)

Yes

/webhook/github

POST

provider_webhook

enrolled_repository (HMAC)

Yes

/health

GET, HEAD

private_liveness_only

Loopback only

No (404 at edge)

Quick cURL Examples

Check Google Session (Browser)

curl -s https://gwrk.gforge.ai/api/auth/session \
  -H "Cookie: __Host-gwrk_session=<cookie>"

Query Project Status with Operator API Key

curl -s "https://gwrk.gforge.ai/api/status?project=pilot-probe-a" \
  -H "Authorization: Bearer $(cat /var/lib/gwrk/operator-keys/operator-pilot-probe-a.secret)"

Enqueue Phase Dispatch

curl -s -X POST "https://gwrk.gforge.ai/api/dispatch" \
  -H "Authorization: Bearer $(cat /var/lib/gwrk/operator-keys/operator-pilot-probe-a.secret)" \
  -H "Content-Type: application/json" \
  -d '{"projectId":"pilot-probe-a","featureId":"051-hosted-aws-pilot","phaseId":"phase-08","backend":"agy"}'
OPENAPI 3.1.0 // DOCS/OPENAPI/GWRK-OPENAPI.YAML ADR-014
GET / Solarized TUI & Flamingo root portal PUBLIC
TAG // Browser Entry & Session

Public landing page on `https://gwrk.gforge.ai/`. Serves the Solarized TUI + Flamingo Splash portal with Google OAuth sign-in, interactive session detection, Sphinx operator guides, and embedded OpenAPI reference.

RESPONSES
HTTPOutcome
200Static HTML portal with zero identity or project leakage.
429Login admission rate limit exceeded (60 checks / 120s per client IP).
GET /oauth2/start Start Google OIDC sign-in flow PUBLIC
TAG // Browser Entry & Session

Checked by origin ForwardAuth rate admission before OAuth2 Proxy mints a per-request PKCE + nonce CSRF state cookie and redirects to Google OIDC (`accounts.google.com`).

PARAMETERS
NameInReqNotes
rdqueryoptionalRelative post-login redirect path on `gwrk.gforge.ai`.
RESPONSES
HTTPOutcome
302Redirect to Google OIDC authorization endpoint.
429Login admission rate limit exceeded.
GET /api/auth/session Verify Google session and issue bound CSRF token GoogleSessionCookie
TAG // Browser Entry & Session

Verifies the forwarded Google ID token against the live host allowlist and SQLite revocation table, then issues a `__Host-gwrk_csrf` cookie and returns the session expiry and CSRF header token.

RESPONSES
HTTPOutcome
200Active Google session verified.
401Missing, expired, or revoked Google session.
403Authenticated Google account is not in the live host allowlist (`AUTH_ACCOUNT_DENIED`).
POST /api/auth/logout Revoke Google session and clear proxy cookies GoogleSessionCookieBrowserCsrfHeader
TAG // Browser Entry & Session

Origin-first logout (`ADR-014`). Requires `Origin: https://gwrk.gforge.ai` and a valid `X-Gwrk-Csrf-Token` header. Records durable session digest revocation in SQLite (`google_sessions`) so replayed cookies fail closed with `401 AUTH_SESSION_REVOKED`.

RESPONSES
HTTPOutcome
200Session revoked in SQLite and cleared in OAuth2 Proxy.
401Unauthenticated or already revoked session.
403Missing or invalid CSRF token or cross-site `Origin` header.
GET /api/status Query project-scoped server, resource, and dispatch queue status OperatorApiKeyGoogleSessionCookie
TAG // System & Readiness

Requires `read` access (`viewer`, `operator`, or `maintainer`) on the target project.

PARAMETERS
NameInReqNotes
projectqueryoptionalEnrolled project slug or `projectId` (required in hosted mode when multiple projects exist).
projectIdqueryoptionalExplicit enrolled project ID alias for `project`.
RESPONSES
HTTPOutcome
200Scoped status snapshot for the requested project.
401Missing or invalid credentials.
403Principal lacks role binding on the requested project.
GET /api/health Query project-scoped readiness, outbox, and harvest health OperatorApiKeyGoogleSessionCookie
TAG // System & Readiness

Requires `read` access on the requested project. Private loopback `/health` is never routed publicly at the edge.

PARAMETERS
NameInReqNotes
projectqueryoptionalEnrolled project slug or `projectId` (required in hosted mode when multiple projects exist).
projectIdqueryoptionalExplicit enrolled project ID alias for `project`.
RESPONSES
HTTPOutcome
200Durable readiness report for the authorized project.
401Missing or invalid credentials.
403Principal lacks role binding on the requested project.
POST /api/dispatch Enqueue an autonomous feature phase dispatch OperatorApiKeyGoogleSessionCookieBrowserCsrfHeader
TAG // Autonomous Dispatch

Requires `operate` access (`operator` or `maintainer`) on the target project. Browser callers must also provide `Origin` and `X-Gwrk-Csrf-Token`.

RESPONSES
HTTPOutcome
201Dispatch operation accepted and queued.
200Idempotent duplicate dispatch returned existing receipt.
401Missing or invalid credentials.
403Principal lacks `operate` access or CSRF check failed.
GET /api/dispatch/queue List active and queued dispatches for a project OperatorApiKeyGoogleSessionCookie
TAG // Autonomous Dispatch

Requires `read` access on the requested project.

PARAMETERS
NameInReqNotes
projectqueryoptionalEnrolled project slug or `projectId` (required in hosted mode when multiple projects exist).
projectIdqueryoptionalExplicit enrolled project ID alias for `project`.
RESPONSES
HTTPOutcome
200Project queue snapshot.
401Missing or invalid credentials.
403Principal lacks `read` access on the requested project.
GET /api/dispatch/{feature}/{phase} Inspect a specific feature phase dispatch operation OperatorApiKeyGoogleSessionCookie
TAG // Autonomous Dispatch

PARAMETERS
NameInReqNotes
featurepathrequired
phasepathrequired
projectqueryoptionalEnrolled project slug or `projectId` (required in hosted mode when multiple projects exist).
projectIdqueryoptionalExplicit enrolled project ID alias for `project`.
RESPONSES
HTTPOutcome
200Dispatch record details.
404Dispatch operation not found.
POST /api/notify Emit a project-scoped Slack notification card OperatorApiKeyGoogleSessionCookieBrowserCsrfHeader
TAG // Notifications & Webhooks

Requires `operate` access on the target project.

RESPONSES
HTTPOutcome
200Notification delivered or queued in durable outbox.
401Missing or invalid credentials.
403Principal lacks `operate` role or thread project mismatch.
POST /webhook/github Receive signed GitHub webhook events for harvest and issue routing GitHubWebhookHmac
TAG // Notifications & Webhooks

Verifies `X-Hub-Signature-256` using the configured webhook secret before parsing JSON or touching SQLite. Triggers durable PR merge harvest and compression recording for enrolled repositories.

PARAMETERS
NameInReqNotes
X-GitHub-Eventheaderrequired
X-GitHub-Deliveryheaderrequired
RESPONSES
HTTPOutcome
200Webhook verified and processed.
400Malformed payload or unenrolled repository.
401Missing or invalid `X-Hub-Signature-256` digest.
COMPONENT SCHEMAS (OPENAPI 3.1)
components.schemas.ErrorEnvelope
{
  "type": "object",
  "required": [
    "ok",
    "code",
    "error"
  ],
  "properties": {
    "ok": {
      "type": "boolean",
      "const": false
    },
    "code": {
      "type": "string",
      "examples": [
        "AUTH_REQUIRED",
        "AUTH_ACCOUNT_DENIED",
        "AUTH_SESSION_REVOKED",
        "AUTH_CSRF_INVALID",
        "UNAUTHORIZED_USER",
        "INSUFFICIENT_ROLE",
        "ROUTE_NOT_FOUND",
        "METHOD_NOT_ALLOWED",
        "RATE_LIMIT_EXCEEDED"
      ]
    },
    "error": {
      "type": "string",
      "example": "Request denied"
    },
    "requestId": {
      "type": "string",
      "example": "req-42"
    }
  }
}
components.schemas.SessionResponse
{
  "type": "object",
  "required": [
    "ok",
    "expiresAt",
    "csrfToken"
  ],
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time",
      "example": "2026-11-25T23:58:55.000Z"
    },
    "csrfToken": {
      "type": "string",
      "description": "Bound CSRF token for browser `POST` mutations."
    }
  }
}
components.schemas.LogoutResponse
{
  "type": "object",
  "required": [
    "ok",
    "proxyCleared"
  ],
  "properties": {
    "ok": {
      "type": "boolean",
      "const": true
    },
    "proxyCleared": {
      "type": "boolean",
      "example": true
    }
  }
}
components.schemas.SystemStatusResponse
{
  "type": "object",
  "required": [
    "server",
    "system",
    "network",
    "dispatch",
    "sandboxes"
  ],
  "properties": {
    "projectId": {
      "type": "string",
      "example": "pilot-probe-a"
    },
    "server": {
      "type": "object",
      "required": [
        "status",
        "lifecycle",
        "pid",
        "uptime"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "running"
          ]
        },
        "lifecycle": {
          "type": "string",
          "enum": [
            "ready",
            "degraded"
          ]
        },
        "pid": {
          "type": "integer",
          "example": 1960577
        },
        "uptime": {
          "type": "integer",
          "description": "Server uptime in seconds.",
          "example": 14820
        },
        "port": {
          "type": "integer",
          "example": 18790
        }
      }
    },
    "system": {
      "type": "object",
      "required": [
        "cpuPercent",
        "memPercent",
        "diskFreeGb"
      ],
      "properties": {
        "cpuPercent": {
          "type": "number",
          "example": 6.4
        },
        "memPercent": {
          "type": "number",
          "example": 38.2
        },
        "diskFreeGb": {
          "type": "number",
          "example": 41.8
        }
      }
    },
    "network": {
      "type": "object",
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "online",
            "offline"
          ]
        }
      }
    },
    "dispatch": {
      "type": "object",
      "required": [
        "queueDepth",
        "activeCount",
        "completedCount",
        "failedCount",
        "paused"
      ],
      "properties": {
        "queueDepth": {
          "type": "integer",
          "example": 0
        },
        "activeCount": {
          "type": "integer",
          "example": 1
        },
        "completedCount": {
          "type": "integer",
          "example": 14
        },
        "failedCount": {
          "type": "integer",
          "example": 0
        },
        "paused": {
          "type": "boolean",
          "example": false
        }
      }
    },
    "sandboxes": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "workDir",
          "featureId",
          "taskId",
          "status",
          "startedAt"
        ],
        "properties": {
          "workDir": {
            "type": "string"
          },
          "featureId": {
            "type": "string",
            "example": "051-hosted-aws-pilot"
          },
          "taskId": {
            "type": "string",
            "example": "T049"
          },
          "status": {
            "type": "string",
            "enum": [
              "running"
            ]
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    }
  }
}
components.schemas.DurableHealthResponse
{
  "type": "object",
  "required": [
    "status",
    "daemonLiveness",
    "projectReadiness",
    "slackDelivery",
    "telegram",
    "components"
  ],
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "ok",
        "degraded"
      ]
    },
    "daemonLiveness": {
      "type": "string",
      "const": "alive"
    },
    "projectReadiness": {
      "type": "object",
      "required": [
        "status",
        "readyCount",
        "totalCount",
        "projects"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "ready",
            "degraded",
            "unconfigured"
          ]
        },
        "readyCount": {
          "type": "integer"
        },
        "totalCount": {
          "type": "integer"
        },
        "projects": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "projectId",
              "slug",
              "trunkBranch",
              "checkoutReady",
              "runnerAllowed",
              "slackBound",
              "status"
            ],
            "properties": {
              "projectId": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              },
              "repoSlug": {
                "type": "string",
                "nullable": true
              },
              "trunkBranch": {
                "type": "string"
              },
              "checkoutPath": {
                "type": "string",
                "nullable": true
              },
              "checkoutReady": {
                "type": "boolean"
              },
              "runnerAllowed": {
                "type": "boolean"
              },
              "slackBound": {
                "type": "boolean"
              },
              "status": {
                "type": "string",
                "enum": [
                  "ready",
                  "degraded",
                  "misconfigured"
                ]
              },
              "reason": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "slackDelivery": {
      "type": "object",
      "required": [
        "mode",
        "connected"
      ],
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "socket_connected",
            "degraded",
            "disabled"
          ]
        },
        "connected": {
          "type": "boolean"
        }
      }
    },
    "telegram": {
      "type": "object",
      "required": [
        "enabled"
      ],
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "reason": {
          "type": "string"
        }
      }
    },
    "components": {
      "type": "object",
      "properties": {
        "server": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "ok",
                "degraded"
              ]
            }
          }
        },
        "git": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "ok",
                "unavailable"
              ]
            }
          }
        },
        "network": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "ok",
                "unavailable"
              ]
            }
          }
        },
        "slack": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "ok",
                "degraded",
                "unavailable"
              ]
            }
          }
        }
      }
    }
  }
}
components.schemas.DispatchRequest
{
  "type": "object",
  "required": [
    "featureId",
    "phaseId"
  ],
  "properties": {
    "projectId": {
      "type": "string",
      "example": "pilot-probe-a"
    },
    "featureId": {
      "type": "string",
      "example": "051-hosted-aws-pilot"
    },
    "phaseId": {
      "type": "string",
      "example": "phase-08"
    },
    "backend": {
      "type": "string",
      "enum": [
        "agy",
        "claude",
        "gemini",
        "codex"
      ],
      "example": "agy"
    },
    "recipient": {
      "type": "object",
      "nullable": true,
      "properties": {
        "surface": {
          "type": "string",
          "enum": [
            "slack",
            "http"
          ]
        },
        "projectId": {
          "type": "string"
        },
        "workspaceId": {
          "type": "string"
        },
        "channelId": {
          "type": "string"
        },
        "threadTs": {
          "type": "string"
        },
        "opsOnly": {
          "type": "boolean"
        }
      }
    }
  }
}
components.schemas.DispatchReceipt
{
  "type": "object",
  "required": [
    "id",
    "featureId",
    "phaseId",
    "status"
  ],
  "properties": {
    "id": {
      "type": "string",
      "example": "op_94f1c2e7"
    },
    "projectId": {
      "type": "string"
    },
    "featureId": {
      "type": "string"
    },
    "phaseId": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "completed",
        "failed"
      ]
    },
    "deduplicated": {
      "type": "boolean"
    }
  }
}
components.schemas.NotifyRequest
{
  "type": "object",
  "required": [
    "type",
    "feature"
  ],
  "properties": {
    "projectId": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "phase_start",
        "phase_complete",
        "phase_fail",
        "ci_result",
        "review_ready",
        "done_done",
        "pulse",
        "define_spec_ready",
        "define_plan_ready"
      ]
    },
    "feature": {
      "type": "string",
      "example": "051-hosted-aws-pilot"
    },
    "phase": {
      "type": "string",
      "example": "phase-09"
    },
    "backend": {
      "type": "string",
      "example": "agy"
    },
    "prUrl": {
      "type": "string"
    },
    "prNumber": {
      "type": "integer"
    },
    "opsOnly": {
      "type": "boolean"
    }
  }
}
Raw OpenAPI 3.1 YAML (docs/openapi/gwrk-openapi.yaml)
openapi: 3.1.0
info:
  title: gwrk Control Plane API
  version: 1.6.0-beta.1
  summary: Principal Engineer operating system for autonomous spec-to-ship orchestration.
  description: |
    HTTP control plane for `gwrk`, the Foxtrot Charlie execution engine (`Truth -> Clarity -> Throughput -> Value`).

    ### Authentication Modes (`ADR-014`)
    - **Browser Google Session (`google_id_token`)**: Interactive operators sign in at `/oauth2/start`. Edge OAuth2 Proxy verifies the Google account against the host allowlist and forwards a signed Google ID token to the private loopback origin (`127.0.0.1:18790`). Mutating requests require `Origin: https://gwrk.gforge.ai` and `X-Gwrk-Csrf-Token` matching `__Host-gwrk_csrf`.
    - **Scoped Operator API Key (`api_key`)**: Headless CLI and automation callers pass `Authorization: Bearer gwrk_ak_v1_<id>.<secret>`. Keys carry per-project role grants (`viewer`, `operator`, or `maintainer`).
    - **GitHub Webhook HMAC (`webhook`)**: GitHub deliveries to `/webhook/github` authenticate via `X-Hub-Signature-256` (`HMAC-SHA256`) and enrolled repository verification.
  license:
    name: MPL-2.0
    url: https://mozilla.org/MPL/2.0/
servers:
  - url: https://gwrk.gforge.ai
    description: Hosted production control plane gateway
tags:
  - name: Browser Entry & Session
    description: Public Solarized TUI landing page, Google OAuth entry, session inspection, and origin-first logout.
  - name: System & Readiness
    description: Project-scoped runtime telemetry, sandbox state, and durable operations health.
  - name: Autonomous Dispatch
    description: Enqueue and inspect autonomous phase implementation and review loops.
  - name: Notifications & Webhooks
    description: Slack control-plane notifications and GitHub PR merge harvest webhooks.
components:
  securitySchemes:
    OperatorApiKey:
      type: http
      scheme: bearer
      bearerFormat: gwrk_ak_v1_<credentialId>.<secret>
      description: Scoped operator API credential created with `gwrk auth key create`.
    GoogleSessionCookie:
      type: apiKey
      in: cookie
      name: __Host-gwrk_session
      description: Encrypted OAuth2 Proxy Google OIDC session cookie validated on every request.
    BrowserCsrfHeader:
      type: apiKey
      in: header
      name: X-Gwrk-Csrf-Token
      description: Double-submit HMAC CSRF token issued by `GET /api/auth/session` and paired with `__Host-gwrk_csrf`.
    GitHubWebhookHmac:
      type: apiKey
      in: header
      name: X-Hub-Signature-256
      description: GitHub webhook `sha256=<hex>` HMAC signature computed over the raw request body.
  parameters:
    ProjectQuery:
      name: project
      in: query
      required: false
      description: Enrolled project slug or `projectId` (required in hosted mode when multiple projects exist).
      schema:
        type: string
        example: pilot-probe-a
    ProjectIdQuery:
      name: projectId
      in: query
      required: false
      description: Explicit enrolled project ID alias for `project`.
      schema:
        type: string
        example: pilot-probe-a
  schemas:
    ErrorEnvelope:
      type: object
      required:
        - ok
        - code
        - error
      properties:
        ok:
          type: boolean
          const: false
        code:
          type: string
          examples:
            - AUTH_REQUIRED
            - AUTH_ACCOUNT_DENIED
            - AUTH_SESSION_REVOKED
            - AUTH_CSRF_INVALID
            - UNAUTHORIZED_USER
            - INSUFFICIENT_ROLE
            - ROUTE_NOT_FOUND
            - METHOD_NOT_ALLOWED
            - RATE_LIMIT_EXCEEDED
        error:
          type: string
          example: Request denied
        requestId:
          type: string
          example: req-42
    SessionResponse:
      type: object
      required:
        - ok
        - expiresAt
        - csrfToken
      properties:
        ok:
          type: boolean
          const: true
        expiresAt:
          type: string
          format: date-time
          example: "2026-11-25T23:58:55.000Z"
        csrfToken:
          type: string
          description: Bound CSRF token for browser `POST` mutations.
    LogoutResponse:
      type: object
      required:
        - ok
        - proxyCleared
      properties:
        ok:
          type: boolean
          const: true
        proxyCleared:
          type: boolean
          example: true
    SystemStatusResponse:
      type: object
      required:
        - server
        - system
        - network
        - dispatch
        - sandboxes
      properties:
        projectId:
          type: string
          example: pilot-probe-a
        server:
          type: object
          required:
            - status
            - lifecycle
            - pid
            - uptime
          properties:
            status:
              type: string
              enum: [running]
            lifecycle:
              type: string
              enum: [ready, degraded]
            pid:
              type: integer
              example: 1960577
            uptime:
              type: integer
              description: Server uptime in seconds.
              example: 14820
            port:
              type: integer
              example: 18790
        system:
          type: object
          required:
            - cpuPercent
            - memPercent
            - diskFreeGb
          properties:
            cpuPercent:
              type: number
              example: 6.4
            memPercent:
              type: number
              example: 38.2
            diskFreeGb:
              type: number
              example: 41.8
        network:
          type: object
          required:
            - status
          properties:
            status:
              type: string
              enum: [online, offline]
        dispatch:
          type: object
          required:
            - queueDepth
            - activeCount
            - completedCount
            - failedCount
            - paused
          properties:
            queueDepth:
              type: integer
              example: 0
            activeCount:
              type: integer
              example: 1
            completedCount:
              type: integer
              example: 14
            failedCount:
              type: integer
              example: 0
            paused:
              type: boolean
              example: false
        sandboxes:
          type: array
          items:
            type: object
            required:
              - workDir
              - featureId
              - taskId
              - status
              - startedAt
            properties:
              workDir:
                type: string
              featureId:
                type: string
                example: 051-hosted-aws-pilot
              taskId:
                type: string
                example: T049
              status:
                type: string
                enum: [running]
              startedAt:
                type: string
                format: date-time
    DurableHealthResponse:
      type: object
      required:
        - status
        - daemonLiveness
        - projectReadiness
        - slackDelivery
        - telegram
        - components
      properties:
        status:
          type: string
          enum: [ok, degraded]
        daemonLiveness:
          type: string
          const: alive
        projectReadiness:
          type: object
          required:
            - status
            - readyCount
            - totalCount
            - projects
          properties:
            status:
              type: string
              enum: [ready, degraded, unconfigured]
            readyCount:
              type: integer
            totalCount:
              type: integer
            projects:
              type: array
              items:
                type: object
                required:
                  - projectId
                  - slug
                  - trunkBranch
                  - checkoutReady
                  - runnerAllowed
                  - slackBound
                  - status
                properties:
                  projectId:
                    type: string
                  slug:
                    type: string
                  repoSlug:
                    type: string
                    nullable: true
                  trunkBranch:
                    type: string
                  checkoutPath:
                    type: string
                    nullable: true
                  checkoutReady:
                    type: boolean
                  runnerAllowed:
                    type: boolean
                  slackBound:
                    type: boolean
                  status:
                    type: string
                    enum: [ready, degraded, misconfigured]
                  reason:
                    type: string
        slackDelivery:
          type: object
          required:
            - mode
            - connected
          properties:
            mode:
              type: string
              enum: [socket_connected, degraded, disabled]
            connected:
              type: boolean
        telegram:
          type: object
          required:
            - enabled
          properties:
            enabled:
              type: boolean
            reason:
              type: string
        components:
          type: object
          properties:
            server:
              type: object
              properties:
                status:
                  type: string
                  enum: [ok, degraded]
            git:
              type: object
              properties:
                status:
                  type: string
                  enum: [ok, unavailable]
            network:
              type: object
              properties:
                status:
                  type: string
                  enum: [ok, unavailable]
            slack:
              type: object
              properties:
                status:
                  type: string
                  enum: [ok, degraded, unavailable]
    DispatchRequest:
      type: object
      required:
        - featureId
        - phaseId
      properties:
        projectId:
          type: string
          example: pilot-probe-a
        featureId:
          type: string
          example: 051-hosted-aws-pilot
        phaseId:
          type: string
          example: phase-08
        backend:
          type: string
          enum: [agy, claude, gemini, codex]
          example: agy
        recipient:
          type: object
          nullable: true
          properties:
            surface:
              type: string
              enum: [slack, http]
            projectId:
              type: string
            workspaceId:
              type: string
            channelId:
              type: string
            threadTs:
              type: string
            opsOnly:
              type: boolean
    DispatchReceipt:
      type: object
      required:
        - id
        - featureId
        - phaseId
        - status
      properties:
        id:
          type: string
          example: op_94f1c2e7
        projectId:
          type: string
        featureId:
          type: string
        phaseId:
          type: string
        status:
          type: string
          enum: [queued, running, completed, failed]
        deduplicated:
          type: boolean
    NotifyRequest:
      type: object
      required:
        - type
        - feature
      properties:
        projectId:
          type: string
        type:
          type: string
          enum:
            - phase_start
            - phase_complete
            - phase_fail
            - ci_result
            - review_ready
            - done_done
            - pulse
            - define_spec_ready
            - define_plan_ready
        feature:
          type: string
          example: 051-hosted-aws-pilot
        phase:
          type: string
          example: phase-09
        backend:
          type: string
          example: agy
        prUrl:
          type: string
        prNumber:
          type: integer
        opsOnly:
          type: boolean
paths:
  /:
    get:
      tags:
        - Browser Entry & Session
      summary: Solarized TUI & Flamingo root portal
      description: |
        Public landing page on `https://gwrk.gforge.ai/`. Serves the Solarized TUI + Flamingo Splash portal with Google OAuth sign-in, interactive session detection, Sphinx operator guides, and embedded OpenAPI reference.
      responses:
        "200":
          description: Static HTML portal with zero identity or project leakage.
          content:
            text/html:
              schema:
                type: string
        "429":
          description: Login admission rate limit exceeded (60 checks / 120s per client IP).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
  /oauth2/start:
    get:
      tags:
        - Browser Entry & Session
      summary: Start Google OIDC sign-in flow
      description: |
        Checked by origin ForwardAuth rate admission before OAuth2 Proxy mints a per-request PKCE + nonce CSRF state cookie and redirects to Google OIDC (`accounts.google.com`).
      parameters:
        - name: rd
          in: query
          required: false
          description: Relative post-login redirect path on `gwrk.gforge.ai`.
          schema:
            type: string
            default: /
      responses:
        "302":
          description: Redirect to Google OIDC authorization endpoint.
        "429":
          description: Login admission rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
  /api/auth/session:
    get:
      tags:
        - Browser Entry & Session
      summary: Verify Google session and issue bound CSRF token
      description: |
        Verifies the forwarded Google ID token against the live host allowlist and SQLite revocation table, then issues a `__Host-gwrk_csrf` cookie and returns the session expiry and CSRF header token.
      security:
        - GoogleSessionCookie: []
      responses:
        "200":
          description: Active Google session verified.
          headers:
            Cache-Control:
              schema:
                type: string
                example: no-store
            Set-Cookie:
              schema:
                type: string
                example: __Host-gwrk_csrf=<token>; Path=/; HttpOnly; Secure; SameSite=Lax
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SessionResponse"
        "401":
          description: Missing, expired, or revoked Google session.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Authenticated Google account is not in the live host allowlist (`AUTH_ACCOUNT_DENIED`).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
  /api/auth/logout:
    post:
      tags:
        - Browser Entry & Session
      summary: Revoke Google session and clear proxy cookies
      description: |
        Origin-first logout (`ADR-014`). Requires `Origin: https://gwrk.gforge.ai` and a valid `X-Gwrk-Csrf-Token` header. Records durable session digest revocation in SQLite (`google_sessions`) so replayed cookies fail closed with `401 AUTH_SESSION_REVOKED`.
      security:
        - GoogleSessionCookie: []
          BrowserCsrfHeader: []
      responses:
        "200":
          description: Session revoked in SQLite and cleared in OAuth2 Proxy.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LogoutResponse"
        "401":
          description: Unauthenticated or already revoked session.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Missing or invalid CSRF token or cross-site `Origin` header.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
  /api/status:
    get:
      tags:
        - System & Readiness
      summary: Query project-scoped server, resource, and dispatch queue status
      description: Requires `read` access (`viewer`, `operator`, or `maintainer`) on the target project.
      security:
        - OperatorApiKey: []
        - GoogleSessionCookie: []
      parameters:
        - $ref: "#/components/parameters/ProjectQuery"
        - $ref: "#/components/parameters/ProjectIdQuery"
      responses:
        "200":
          description: Scoped status snapshot for the requested project.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SystemStatusResponse"
        "401":
          description: Missing or invalid credentials.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Principal lacks role binding on the requested project.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
  /api/health:
    get:
      tags:
        - System & Readiness
      summary: Query project-scoped readiness, outbox, and harvest health
      description: Requires `read` access on the requested project. Private loopback `/health` is never routed publicly at the edge.
      security:
        - OperatorApiKey: []
        - GoogleSessionCookie: []
      parameters:
        - $ref: "#/components/parameters/ProjectQuery"
        - $ref: "#/components/parameters/ProjectIdQuery"
      responses:
        "200":
          description: Durable readiness report for the authorized project.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DurableHealthResponse"
        "401":
          description: Missing or invalid credentials.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Principal lacks role binding on the requested project.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
  /api/dispatch:
    post:
      tags:
        - Autonomous Dispatch
      summary: Enqueue an autonomous feature phase dispatch
      description: |
        Requires `operate` access (`operator` or `maintainer`) on the target project. Browser callers must also provide `Origin` and `X-Gwrk-Csrf-Token`.
      security:
        - OperatorApiKey: []
        - GoogleSessionCookie: []
          BrowserCsrfHeader: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DispatchRequest"
      responses:
        "201":
          description: Dispatch operation accepted and queued.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DispatchReceipt"
        "200":
          description: Idempotent duplicate dispatch returned existing receipt.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DispatchReceipt"
        "401":
          description: Missing or invalid credentials.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Principal lacks `operate` access or CSRF check failed.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
  /api/dispatch/queue:
    get:
      tags:
        - Autonomous Dispatch
      summary: List active and queued dispatches for a project
      description: Requires `read` access on the requested project.
      security:
        - OperatorApiKey: []
        - GoogleSessionCookie: []
      parameters:
        - $ref: "#/components/parameters/ProjectQuery"
        - $ref: "#/components/parameters/ProjectIdQuery"
      responses:
        "200":
          description: Project queue snapshot.
          content:
            application/json:
              schema:
                type: object
                properties:
                  paused:
                    type: boolean
                  queued:
                    type: array
                    items:
                      $ref: "#/components/schemas/DispatchReceipt"
                  active:
                    type: array
                    items:
                      $ref: "#/components/schemas/DispatchReceipt"
        "401":
          description: Missing or invalid credentials.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Principal lacks `read` access on the requested project.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
  /api/dispatch/{feature}/{phase}:
    get:
      tags:
        - Autonomous Dispatch
      summary: Inspect a specific feature phase dispatch operation
      security:
        - OperatorApiKey: []
        - GoogleSessionCookie: []
      parameters:
        - name: feature
          in: path
          required: true
          schema:
            type: string
            example: 051-hosted-aws-pilot
        - name: phase
          in: path
          required: true
          schema:
            type: string
            example: phase-08
        - $ref: "#/components/parameters/ProjectQuery"
        - $ref: "#/components/parameters/ProjectIdQuery"
      responses:
        "200":
          description: Dispatch record details.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DispatchReceipt"
        "404":
          description: Dispatch operation not found.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
  /api/notify:
    post:
      tags:
        - Notifications & Webhooks
      summary: Emit a project-scoped Slack notification card
      description: Requires `operate` access on the target project.
      security:
        - OperatorApiKey: []
        - GoogleSessionCookie: []
          BrowserCsrfHeader: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NotifyRequest"
      responses:
        "200":
          description: Notification delivered or queued in durable outbox.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    const: true
        "401":
          description: Missing or invalid credentials.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "403":
          description: Principal lacks `operate` role or thread project mismatch.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
  /webhook/github:
    post:
      tags:
        - Notifications & Webhooks
      summary: Receive signed GitHub webhook events for harvest and issue routing
      description: |
        Verifies `X-Hub-Signature-256` using the configured webhook secret before parsing JSON or touching SQLite. Triggers durable PR merge harvest and compression recording for enrolled repositories.
      security:
        - GitHubWebhookHmac: []
      parameters:
        - name: X-GitHub-Event
          in: header
          required: true
          schema:
            type: string
            enum: [ping, pull_request, issues]
        - name: X-GitHub-Delivery
          in: header
          required: true
          schema:
            type: string
            format: uuid
      responses:
        "200":
          description: Webhook verified and processed.
        "400":
          description: Malformed payload or unenrolled repository.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
        "401":
          description: Missing or invalid `X-Hub-Signature-256` digest.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorEnvelope"
SIGNED-IN SESSION // GOOGLE OIDC & ORIGIN-FIRST LOGOUT SESSION
1. Google Session (GET /api/auth/session)
Checking /api/auth/session...
2. Origin-First Logout (POST /api/auth/logout)
Ready.