Methodology

/apt

v24

APT v24 orchestrator — KG 정본 기반. SA→SP→ST→SCW 순환.

사용법

/apt

Claude Code CLI 또는 연결된 에이전트에서 호출합니다.

상세 설명

APT v21 Orchestrator -- Anti-Rubber-Stamp Adversarial Validation

Master coordinator for APT development with MANDATORY adversarial validation at every gate.
No gate may be passed without: (1) adversarial critic review, (2) ground truth verification,
(3) human sigma_oracle approval, (4) evidence-backed verdicts (HR11), (5) post-gate reflection.
These are HARD requirements -- not guidelines.

```
SA --> SP --[adversarial]--> ST --[adversarial]--> SCW --[adversarial + test]--> PH6
            |                     |                       |
       Critic attacks        Critic attacks          Critic + cargo test
            |                     |                       |
       KG log + fix          KG log + fix            KG log + fix
            |                     |                       |
       sigma_oracle (HUMAN)  sigma_oracle (HUMAN)    sigma_orac

0. HARD RULES (v21 -- cannot be overridden)

These rules are BLOCKING. If any is violated, the orchestrator MUST halt and refuse to proceed.

| # | Rule | Enforcement |
|---|------|-------------|
| HR1 | **Adversarial round at EVERY gate** | No gate passes without AdversarialRound() completing |
| HR2 | **sigma_oracle is ALWAYS human** | `allow_agent_sigma: false` -- agent cannot self-approve |
| HR3 | **Critic model differs from design model** | Same-model critique is BLOCKED (exception: Lite Mode with full D22.3 template) |
| HR4 | **Minimum 3 findings per adversarial round** | If critic returns < 3: re-run with stronger prompt |
| HR5 | **KG density check before decomposition** | INFORMED_BY < 5 or source_types < 3: BLOCK and run KAL |
| HR6 | **Ground truth before gate pass** | SCW: cargo test MUST pass. SP/ST: WebSearch evidence

1. Configuration (v21)

```yaml
# apt-config.yaml -- v21 ENFORCED settings
apt:
  version: 21

  # --- LOCKED: cannot be changed by agent ---
  adversarial:
    enabled: true                          # LOCKED: always true in v17
    min_critic_findings: 3                 # LOCKED: minimum findings per round
    critic_model: "sonnet"                 # Model for adversarial-critic agent
    design_model: "opus"                   # Model for design agent
    blocker_auto_return: true              # Auto-return if BLOCKERs found
    max_adversarial_rounds: 3              # Max re-attacks per gate (prevent infinite loops)
    re_attack_on_insufficient_findings: true  # If < 3 findings, re-run with stronger prompt
    gates_requiring_adversarial:           # ALL gates -- no exceptions
      - "C_S_sigma"
      - "Refi

2. Phase Detection Algorithm

Before any action, determine the current phase by querying the KG.

### 2.1 Per-Branch Phase Detection

```cypher
// Phase Detection -- per branch, not global
MATCH (span:AptSpan {name: $target_span})
OPTIONAL MATCH (span)-[:CRYSTALLIZES_TO]->(st:SemanticTwin)
OPTIONAL MATCH (st)-[:HAS_CONTRACT]->(c:AptContract)
OPTIONAL MATCH (c)-[:MATERIALIZES]->(src:SourceCodeNode)
RETURN span.name,
  CASE
    WHEN src IS NOT NULL THEN 'PH5/PH6: SCW (code exists, use /apt-scw for feedback)'
    WHEN c IS NOT NULL THEN 'PH5: SCW (contract ready, use /apt-scw to implement)'
    WHEN st IS NOT NULL THEN 'PH4: ST (twin exists but no contract, use /apt-st)'
    WHEN span:AtomicSpan THEN 'PH4: ST (atomic, ready to crystallize, use /apt-st)'
    ELSE 'PH3: SP (needs decomposition, use /apt-sp)'
  END AS curren

3. Flow Control with Adversarial Gates

Phases are NOT sequential steps for the whole project. Each **branch** progresses independently.
At any moment, branch A may be in PH3, branch B in PH4, branch C in PH5.

### 3.1 Master Flow

```
User Request
    |
    v
[/apt] Phase Detection (per branch)
    |
    +-- No SA exists -----------------> /apt-sa (PH1+PH2: bootstrap)
    |                                        |
    |                           SA created   v
    |                                   /apt-sp (PH3: decompose)
    |
    +-- Branch not decomposed ---------> /apt-sp (PH3)
    |       |
    |       +-- [GATE: KG Density Check (D21)] -- BLOCK if fails
    |       +-- [GATE: C(S) predicate check]
    |       +-- [GATE: Adversarial Round (C_S_sigma)]
    |       +-- [GATE: sigma_oracle (HUMAN)] -- BLOCK until human resp

4. Adversarial Round Protocol (D20 -- MANDATORY)

### 4.1 The Four Stages

Every adversarial round follows these four stages. None may be skipped.

```
AdversarialRound(artifact, gate_name):

  Stage A -- PROPOSE:
    Design Agent presents artifact for gate passage.
    Artifact = {decomposition plan | contract draft | implemented code}.

  Stage B -- ATTACK:
    Critic Agent (adversarial-critic agent, sonnet model) reviews artifact.
    Critic MUST produce minimum 3 findings (HARD requirement).
    Each finding classified: BLOCKER | PERFORMANCE | DESIGN_DEBT | NITPICK.
    Critic also runs:
      - WebSearch for counter-evidence (compatibility, prior art, known issues)
      - KG knowledge contradiction check
    IF findings < 3:
      Re-run with stronger prompt (see Section 7.2)
      IF still < 3 after re-run: log anomaly, proceed wit

Your role

You are the CRITIC, not the designer. Your job is to FIND FLAWS, not to approve.
A review with zero findings is a FAILED review -- it means you didn't look hard enough.

Rules

1. You MUST produce at least 3 findings. No exceptions.
2. Each finding must be SPECIFIC and FALSIFIABLE -- not vague concerns.
3. At least 1 finding must challenge a CORE ASSUMPTION, not just surface issues.
4. You must check for these failure modes:
   - Missing edge cases (null, empty, overflow, concurrent access)
   - Incorrect assumptions about dependencies or APIs
   - Violations of APT axioms (A1-A4) or design principles (D1-D24)
   - Untestable or ambiguous postconditions
   - Performance cliffs under realistic load
5. If you genuinely find no issues after thorough review, you must document
   your review methodology (what you checked) as evidence of diligence,
   and still produce 3 findings at NITPICK level minimum.

Anti-rubber-stamp checklist (you MUST address each):

- [ ] Did I check the PRECONDITIONS, not just the happy path?
- [ ] Did I verify the OUTPUT TYPE is concrete and sufficient?
- [ ] Did I look for what is MISSING, not just what is present?
- [ ] Did I consider CONCURRENT/PARALLEL execution scenarios?
- [ ] Did I check consistency with SIBLING spans/contracts?
- [ ] Did I verify INFORMED_BY sources are actually relevant?
- [ ] Did I check for violations of SINGLE FILE PROJECTION (D5)?
- [ ] Did I consider what happens when this FAILS at runtime?
- [ ] Did I verify the test sketch actually TESTS the postcondition?
- [ ] Did I check if this duplicates or conflicts with EXISTING code?

Artifact under review

{artifact_content}

Context

{relevant_kg_context}

Output format

Produce findings as structured YAML, then a verdict.

### Findings

finding:
  id: "F-{gate}-{n}"
  severity: "BLOCKER" | "PERFORMANCE" | "DESIGN_DEBT" | "NITPICK"
  category: "correctness" | "completeness" | "consistency" | "efficiency" | "maintainability"
  claim: "What is wrong (specific, falsifiable)"
  evidence: "Why this is wrong (reference to code/spec/external source)"
  suggestion: "How to fix (concrete, actionable)"
  ground_truth_testable: true | false

### Verdict: REJECT | CONDITIONAL_PASS | PASS
  REJECT:           >= 1 BLOCKER finding
  CONDITIONAL_PASS: 0 BLOCKER, >= 1 PERFORMANCE finding
  PASS:             0 BLOCKER, 0 PERFORMANCE (only DESIGN_DEBT + NITPICK)
```

---

5. KG Density Check (D21 -- MANDATORY)

### 5.1 When to Run

BEFORE any SP decomposition begins. This is a prerequisite, not a post-check.

### 5.2 Three Requirements

| # | Requirement | Threshold | On Fail |
|---|------------|-----------|---------|
| 1 | Min INFORMED_BY links | >= 5 | BLOCK --> run KAL to acquire knowledge |
| 2 | Min source type diversity | >= 3 distinct types | BLOCK --> diversify via targeted KAL |
| 3 | Foundation:composite ratio | >= 2:1 | BLOCK --> acquire more foundational sources |

### 5.3 Source Types (Enumerated)

```
paper          - Academic paper, arXiv, journal
implementation - Existing codebase, library source
documentation  - Official docs, API reference, man pages
experiment     - Empirical test results, benchmarks, PoC outcomes
expert         - Domain expert knowledge, design rationale
speci

6. Ground Truth Primacy (D23 -- MANDATORY)

### 6.1 Authority Hierarchy

```
For FACTUAL claims (does code compile? do tests pass? is this API compatible?):

  AUTHORITATIVE (cannot be overridden by opinion):
    1. Compiler output (cargo build, rustc, gcc, tsc)
    2. Test execution results (cargo test, pytest, jest)
    3. Runtime behavior (browser execution, WASM execution)
    4. External evidence (WebSearch for API docs, compatibility tables)

  ADVISORY (informs decisions but cannot override authoritative sources):
    5. Critic Agent findings
    6. Design Agent claims

  LEAST AUTHORITATIVE for factual matters:
    7. Human intuition ("I think this should work")

For DESIGN/ARCHITECTURAL decisions:
  Human judgment (sigma_oracle) remains supreme.
  D23 does NOT apply to design decisions.
```

### 6.2 Ground Truth Override Ru

7. Anti-Bypass Mechanisms

### 7.1 Detection Rules

| # | Bypass Attempt | Detection | Response |
|---|---------------|-----------|----------|
| 1 | Critic returns < 3 findings | Count check | Re-run with stronger prompt (Section 7.2) |
| 2 | Same model for design and critique | Model comparison | BLOCK -- switch critic model |
| 3 | No human response to sigma_oracle | Response check | BLOCK and re-ask. Never assume approval. |
| 4 | Agent tries to auto-approve sigma | Config check | BLOCKED by allow_agent_sigma: false |
| 5 | Gate transition without adversarial round | KG audit (V28) | BLOCK -- run adversarial round |
| 6 | Ground-truth-testable claim not tested | KG audit (V29) | BLOCK -- run ground truth command |
| 7 | Critic produces only NITPICK findings 5+ times | Severity distribution | Rotate critic model +

8. KG Logging Procedures (MANDATORY)

### 8.1 AptDecisionLog Node (Every Gate Transition)

```cypher
CREATE (dl:AptDecisionLog {
  id: randomUUID(),
  gate_type: $gate_type,
  span_name: $span_name,
  decision: $decision,
  decided_by: $decided_by,
  decided_at: datetime(),
  adversarial_verdict: $adversarial_verdict,
  adversarial_findings_count: $findings_count,
  adversarial_blockers: $blocker_count,
  ground_truth_pass: $ground_truth_pass,
  ground_truth_details: $ground_truth_details,
  evidence_summary: $evidence_summary,
  override_reason: $override_reason
})
WITH dl
MATCH (s:AptSpan {name: $span_name})
MERGE (dl)-[:TARGETS]->(s)
RETURN dl.id, dl.gate_type, dl.decision
```

**gate_type values**: `DensityCheck`, `C_S_sigma`, `RefinementGate`, `FulfillmentGate`, `IntegrationGate`

**decision values**: `PASS`, `RETURN`, `E

9. Error Handling

### 9.1 When Critic Disagrees with Design Agent

```
IF critic verdict = REJECT (>= 1 BLOCKER):
  1. Design agent reviews BLOCKER findings
  2. For ground_truth_testable findings: run ground truth command
     - If ground truth CONFIRMS: fix the issue, re-submit
     - If ground truth CONTRADICTS: finding dismissed (log override)
  3. For non-testable findings: present to sigma_oracle with both perspectives
  4. sigma_oracle decides: fix it | dismiss with reason | escalate
  5. Log decision as AptDecisionLog

IF critic verdict = CONDITIONAL_PASS (PERFORMANCE findings):
  1. Design agent reviews PERFORMANCE findings
  2. Run benchmarks if applicable
  3. sigma_oracle decides: fix now | accept with tech debt | escalate
  4. Log decision

IF critic verdict = PASS (only DESIGN_DEBT + NITPICK):

10. Validation Commands (V1-V29)

### 10.1 Axiom Checks (P1 -- Critical)

| V# | Target | What It Checks |
|----|--------|---------------|
| V1 | A1: ContractOnlyAtST | Contract owner is SemanticTwin |
| V2 | A3: SiblingIndependence | No DEPENDS_ON between siblings |
| V5 | A4: FrontierUniqueness | CRYSTALLIZES_TO is sole SP->ST bridge |
| V6 | Cycle Detection | No cycles in DECOMPOSES_TO |
| V15 | Self-Approval | executor != reviewer |

### 10.2 Structural Checks (P2-P3)

| V# | Target | What It Checks | Severity |
|----|--------|---------------|:--------:|
| V3 | A2: BranchingFactor | Non-atomic Spans have >= 2 children | P2 |
| V4 | A2: Termination | All leaves are AtomicSpan | P3 |
| V7 | Injective CRYSTALLIZES_TO | 1 AtomicSpan -> 1 Twin | P2 |
| V8 | Functional HAS_CONTRACT | 1 Twin -> 1 Contract | P2 |
| V9 | Label 

11. Phase Transition Guards

### 11.1 Before /apt-sa

No prerequisite. This is the entry point for new projects.

### 11.2 Before /apt-sp

```cypher
MATCH (sa:SemanticAnchor {name: $project}) RETURN sa.name
MATCH (span:AptSpan {name: $target}) RETURN span.name, labels(span)
```

**v17 ADDITION**: Run Density Check (Section 5) BEFORE decomposition begins.

### 11.3 Before /apt-st (C(S) gate)

All 5 crystallization criteria must pass. Evaluation order: cheap rejection first.

| Order | Symbol | Criterion | Gate | On Fail |
|:-----:|:------:|-----------|:----:|---------|
| 1st | v | Complexity <= 500 lines | auto | Split -- too large |
| 2nd | tau | Type Expressibility -- concrete I/O types | auto | Split by type boundary |
| 3rd | iota | Test Feasibility -- concrete assertions | auto | Sharpen with examples |
| 4th | de

12. Gate Evidence Table (v17)

```
Gate Evidence Table (v17):
+---------------+--------------------------------------------------------------+
| Transition    | Required Evidence                                            |
+---------------+--------------------------------------------------------------+
| -> PH3 (SP)  | SA exists AND root span created                              |
| SP internal   | KAL complete AND INFORMED_BY >= 5                            |
|               | v17: source_types >= 3 AND foundation:composite >= 2:1       |
|               | v17: DensityCheck logged in KG                               |
+---------------+--------------------------------------------------------------+
| -> PH4 (ST)  | C(S) auto pass AND sigma_oracle approved                     |
|               | v17: AdversarialRound(C_

13. Parallel Execution (D12)

### 13.1 Five Rules

| Rule | Description |
|------|-------------|
| SameLayer | Same parent's children = all parallel (A3 guarantees independence) |
| ParentChild | Parent decomposition complete -> then children. Vertical = sequential. |
| CrossBranch | Independent branches may be in different phases simultaneously. |
| AtomicIndependent | Sibling becomes AtomicSpan -> proceeds to PH4 independently. |
| LayerGateFirst | All children created -> RefinementGate -> then descend. |

### 13.2 SharedType (D14-D16)

Parent Span defines boundary types shared between children BEFORE children enter ST.

```
(Parent)--DEFINES_SHARED_TYPE-->(World:SharedType)<--OUTPUTS_TYPE--(CT_WorldGen)
                                       ^
                              INPUTS_TYPE
                               

14. Feedback System

### 14.1 Categories (10)

| # | Category | When to Use |
|---|----------|-------------|
| 1 | Bug | Code defect, postcondition violation |
| 2 | Confusion | Spec ambiguity, interpretation divergence |
| 3 | Missing | Missing Span, Contract, or test |
| 4 | Improvement | Feature enhancement request |
| 5 | Violation | Axiom or Principle violation detected |
| 6 | Conflict | Contradiction between Contracts or Spans |
| 7 | FalsePositive | Validation flagged normal as violation |
| 8 | FalseNegative | Validation missed a real violation |
| 9 | PerformanceDrift | Performance metric below baseline |
| 10 | SLABreach | SLA exceeded |

### 14.2 Record Feedback

```cypher
MERGE (fb:AptFeedback {name: $title})
SET fb.category = $category,
    fb.severity = $severity,
    fb.status = 'open',
    fb.

15. Mode Collapse Detection (D24)

### 15.1 Detection Signals

| Signal | Threshold | Action |
|--------|-----------|--------|
| Exactly 3 findings (minimum) for 5+ consecutive rounds | 5 rounds | Alert: critic may be rubber-stamping |
| Same NITPICK-only verdict for 3+ consecutive rounds | 3 rounds | Rotate critic model |
| Design agent does not modify artifact after PERFORMANCE findings | 2 rounds | Escalate to sigma_oracle |
| All findings dismissed by ground truth override | 3 rounds | Review critic prompt for hallucination |
| sigma_oracle approves without reading critic findings | 1 occurrence | Alert (meta-discriminator failure) |

### 15.2 The Human as Meta-Discriminator

sigma_oracle remains essential even with automated adversarial rounds. The adversarial system
can itself fail (both agents converge on a shared bl

16. Auto Mode (Restricted in v17)

Auto Mode is available but with MANDATORY adversarial gates at every transition.
sigma_oracle is STILL HUMAN even in auto mode -- the agent handles KAL, decomposition,
and ground truth automatically, but BLOCKS at each sigma_oracle checkpoint.

### 16.1 Auto Mode Algorithm (v17 Modified)

```
ALGORITHM AutoMode_v17(project_name, description):
  // PH1-PH2: SA
  INVOKE /apt-sa with {project_name, description}
  WAIT for SA + RootSpan creation

  // PH3-PH6: Loop until all spans materialized
  WHILE true:
    unfinished = QUERY all non-materialized AtomicSpans
    IF unfinished is empty: BREAK

    FOR EACH span IN unfinished (parallel, max 4):
      phase = detect_phase(span)

      IF phase = 'PH3':
        // v17: Density check FIRST
        density = DensityCheck(span)
        IF NOT den

17. Diffusion Analogy

| Diffusion | APT | Role |
|-----------|-----|------|
| prompt/conditioning | SA | Initial identity |
| noise -> coarse structure | SP | Abstract -> Span decomposition |
| coarse -> fine detail | ST | Span -> Contract specification |
| fine -> pixel-level | SCW | Contract -> Code (TDD) |
| U-Net | /apt orchestrator | Drives the denoising loop |
| denoising step | Phase transition | Each step reduces ambiguity |
| discriminator | adversarial-critic | Validates each denoising step (v17) |

---

18. GAN-Context Analogy (D24 -- Theoretical Foundation)

### 18.1 The Mapping

| GAN Concept | Agent Analog | Key Difference |
|------------|-------------|----------------|
| Generator | Design Agent | Produces code/architecture |
| Discriminator | Critic Agent | Evaluates quality |
| Weight space | Context Window + KG | Ephemeral + persistent |
| Training iteration | Adversarial round (D20) | 2-3 rounds vs thousands |
| Loss function | Ground truth: compiler, tests (D23) | Binary pass/fail |
| Mode collapse | Rushing through gates, self-approving | Detected by human |
| Overfitting | Confirmation bias / echo chamber | Fix: model separation (D22) |
| Gradient backprop | Context filling with critique text | Discrete chunks vs continuous |
| Nash equilibrium | Consensus or human decision | sigma_oracle breaks tie |
| Regularization | Anti-rubber-s

19. Mold Flow Diagram

```
Governance Mold -STARTS_WITH-> Intent Mold -NEXT-> Boundary Mold -NEXT-> Execution Mold -NEXT-> Assurance Mold
     |                |              |              |              |
     | Hook Engine     | Span Planner | Contract Reg | Work Queue   | Eval Harness
     | Agent Profile   | Req Graph    | Twin Registry| Subagent Rtr | Adversarial Gate (v17)
     |                |              |              | Runtime Trace|
     |                |              |              |              |
     +--- /apt -------+-- /apt-sp ---+-- /apt-st --+-- /apt-scw --+

     Memory Mold -CROSS_CUTS-> (all phases)
     | Memory Tier Manager / Reflection Memory / Checkpoint Ledger

     Adversarial Layer (v17) -CROSS_CUTS-> (SP, ST, SCW gates)
     | Critic Agent / Ground Truth / KG Logging / Anti-Byp

20. Quick Reference -- Decision Tree

```
"I need to..."
    |
    +-- "...start a new project"
    |       -> /apt-sa (create SemanticAnchor, bootstrap context)
    |
    +-- "...break down a feature"
    |       -> /apt-sp (density check -> decompose -> adversarial -> sigma_oracle)
    |
    +-- "...write a contract/spec"
    |       -> /apt-st (crystallize -> adversarial -> sigma_oracle)
    |
    +-- "...implement code"
    |       -> /apt-scw (TDD -> cargo test -> adversarial -> sigma_oracle)
    |
    +-- "...check APT compliance"
    |       -> /apt (run V1-V29 including V28/V29 adversarial checks)
    |
    +-- "...find what phase I'm in"
    |       -> /apt (phase detection query, Section 2)
    |
    +-- "...report a problem"
    |       -> /apt (feedback system, Section 14)
    |
    +-- "...see adversarial history"

21. When to Use Each Skill

| Situation | Skill | Why |
|-----------|-------|-----|
| New project / no SA | `/apt-sa` | Bootstrap identity first |
| "Implement feature X" (unknown phase) | `/apt` -> detect phase -> delegate | Don't assume phase |
| "Plan the architecture for Y" | `/apt-sp` directly | Clearly SP work |
| "Write the contract for Z" | `/apt-st` directly | Clearly ST work |
| "Code the function for W" | `/apt-scw` directly | Clearly SCW work |
| "Check APT compliance" | `/apt` validation | Run V1-V29 |
| "Where does this feature go?" | `/apt` + KG query | Phase detection |
| "Audit the KG" | `/apt` validation | Full health check |
| "What phase am I in?" | `/apt` phase detection | Per-branch detection |
| "Review adversarial history" | `/apt` + Section 8.5 query | Decision audit trail |

---

22. Core Concepts Summary

### 22.1 Axioms (violation = not APT)

- **A1: ContractOnlyAtST** -- Contracts owned only by SemanticTwin
- **A2: RecursiveDecomposition + Termination** -- min 2 children, all paths end at AtomicSpan
- **A3: SiblingIndependence** -- no DEPENDS_ON between siblings
- **A4: CrystallizationFrontierUniqueness** -- CRYSTALLIZES_TO is the sole SP->ST bridge

### 22.2 Key Design Principles (D1-D24)

| Principle | Description |
|-----------|-------------|
| D1 | HyperedgeHub -- CrystallizationEvent as bipartite incidence hub |
| D3 | TaskAsScaffolding -- Task (NL) != Contract (formal spec) |
| D4 | DenseBeforeContract -- links(S) >= 5 before crystallization |
| D5 | SingleFileProjection -- AtomicSpan -> 1 file <= 500 lines |
| D9 | GenerativeFlowOrdering -- SA->SP->ST->SCW forward; reverse for Bott

23. Approval Gates Table (v17)

| Gate | Who | SLA | On Timeout |
|------|-----|-----|------------|
| sigma_auto (v,tau,iota,delta) | automated | instant | N/A |
| sigma_oracle | **HUMAN (LOCKED)** | 0 (immediate) | BLOCK -- re-ask |
| Adversarial Critic | automated (sonnet) | <= 60s per round | ESCALATE -- critic timeout = gate blocked |
| Ground truth (compiler/test) | automated | <= 300s | BLOCK -- ground truth must complete |
| DensityCheck | automated | <= 30s | BLOCK -- KAL must complete |

---

24. Events (v17)

| Event | Payload | When |
|-------|---------|------|
| SpanDecomposed | `{span, children, executor}` | After SP decomposition |
| CrystallizationCompleted | `{atom, twin, contract, hub}` | After ST crystallization |
| FulfillmentCompleted | `{contract, source, tests}` | After SCW implementation |
| FeedbackCreated | `{feedback, category, severity}` | When feedback recorded |
| **AdversarialRoundCompleted** | `{gate, span, critic_model, findings_count, blockers, verdict, ground_truth_pass}` | After each adversarial round |
| **GroundTruthOverride** | `{finding_id, gate, original_severity, ground_truth_result, action}` | When ground truth contradicts/confirms critic |
| **GateDecisionLogged** | `{decision_log_id, gate_type, decision, decided_by}` | After every gate decision logged to KG |

25. Clarifications (v17)

| # | Clarification |
|---|--------------|
| C36 | Adversarial rounds are not code review. They challenge assumptions and completeness. Both may occur. |
| C37 | Ground truth primacy does NOT apply to design decisions. sigma_oracle is supreme for design. |
| C38 | The critic agent is not an enemy. Adversarial = structured opposition, not hostility. |
| C39 | Lite Mode uses self-critique with full D22.3 template. Weaker but still required. |
| C40 | Foundation:composite ratio is per-Span, not per-KG. |
| **C41** | **v17: allow_agent_sigma: false is LOCKED. No configuration can change this. Agent cannot self-approve.** |
| **C42** | **v17: Every gate transition creates an AptDecisionLog node. No silent transitions allowed.** |
| **C43** | **v17: If adversarial critic returns < 3 findings, it

26. Project-Specific Invariants

Each SemanticAnchor may define domain invariants:
```cypher
MATCH (sa:SemanticAnchor {name: $project})-[:HAS_INVARIANT]->(inv)
RETURN inv.name, inv.description, inv.check_query
```

---

27. Reference Files

| File | Content | When to Read |
|------|---------|-------------|
| `references/apt_core.md` | SS1-SS9: Sets, Functions, Predicates, Relations, Axioms, Dual Guidance, Design Principles, KAL Config | Understanding foundations |
| `references/apt_infra.md` | SS23-SS30: Kafka Events, KG-Git Sync, MERGE-Only, Indexes, HA, Observability, Incident Response, CI/CD | Infrastructure setup |
| `references/apt_reference.md` | SS31-SS40: V1-V17 Queries, Traceability, Gap Resolution, Theory, Errors, Anti-Patterns, Feedback, Tutorials | Validation details |

---

28. Theoretical Foundations

| Domain | APT Element |
|--------|-------------|
| Dynamic Programming | SP decomposition (independent subproblems, memoization) |
| P-Coalgebra | DECOMPOSES_TO (branching with termination) |
| Hoare Logic | Contract as {P}f{Q} analogy, SEQUENCED_WITH |
| Extended Mind | KG as external cognition (Clark & Chalmers 1998) |
| Thompson Sampling | Gap Resolution (70% exploitation, 30% exploration) |
| DDD | Bounded contexts, ubiquitous language |
| CSP | Agent -> Kafka -> KG (no shared state) |
| Kuhn / Godel | Version evolution, sigma_oracle irreducibility |
| Wolfram Hypergraph | Bipartite incidence, EXPLORES_VIA, confluence |
| **GAN Theory** | **Adversarial validation, mode collapse detection, regularization (v17)** |

---

29. Version History

| Ver | Key Change |
|-----|-----------|
| v14 | Harness techniques executable, eval-optimizer, hook engine |
| v15 | Adversarial Validation Layer (D20-D24), FulfillmentGate 13/13, V27-V29 |
| v16 | Skill file consolidation, Auto Mode, Mold Flow, full orchestrator |
| **v17** | **MANDATORY adversarial enforcement. allow_agent_sigma: false LOCKED. Every gate: adversarial + ground truth + HUMAN sigma_oracle. Anti-bypass mechanisms. KG logging for all decisions. Stronger re-attack prompts. Mode collapse detection. 29 validations. Cannot be bypassed.** |

---

30. ENFORCEMENT CHECKLIST (for orchestrator self-check)

Before allowing ANY gate passage, the orchestrator MUST verify:

```
[ ] 1. Adversarial critic invoked (not skipped)
[ ] 2. Critic model differs from design model (or Lite Mode with full template)
[ ] 3. Critic produced >= 3 findings (or escalated prompt ran)
[ ] 4. Ground truth commands executed (cargo test for SCW, WebSearch for SP/ST)
[ ] 5. All ground-truth-testable findings verified
[ ] 6. sigma_oracle is HUMAN (allow_agent_sigma: false)
[ ] 7. HUMAN has responded (not assumed, not skipped)
[ ] 8. AptDecisionLog created in KG
[ ] 9. All AptFeedback nodes created for findings
[ ] 10. No BLOCKER findings unresolved (or overridden with human reason)
```

If ANY checkbox fails: BLOCK. Do not proceed. Fix the issue first.

---

*End of APT v17 Orchestrator SKILL.md*
*This is the authoritat

메타데이터

name apt
version 24
description >
# KG ATOM_Skill_apt_orchestrator
v22 Gate Check enforcement via Claude Code Hook.
Every gate requires adversarial critic + ground truth + human sigma_oracle + evidence-backed verdicts + post-gate reflection.
HR11 Every APPROVED verdict MUST cite specific evidence. Approvals without evidence = RUBBER_STAMP violation.
2-Tier Taliban Tier 1 (9-lens Constitutional) for artifacts, Tier 2 (88-lens Mathematical) for methodology only.
Essential ✗ Arrow of Time (order-dependent), Edge of Chaos (structured complexity), Gödel (never complete).
Optional Lean 4 integration `lake build` sorry=0 error=0 as ground truth.
Invoke when start work on", "implement", "develop", "what phase am I in",
Enforces phase detection, flow control, adversarial gates, validation V1-V29, feedback system, mandatory reflection.

같은 카테고리