Skip to content

FE-875: App runtime probe — boot, probe, classify#219

Draft
kostandinang wants to merge 2 commits into
ka/fe-872-dep-install-classificationfrom
ka/fe-875-app-runtime-probe
Draft

FE-875: App runtime probe — boot, probe, classify#219
kostandinang wants to merge 2 commits into
ka/fe-872-dep-install-classificationfrom
ka/fe-875-app-runtime-probe

Conversation

@kostandinang

@kostandinang kostandinang commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Stacks on FE-872. Fifth Arc-1 frontier — the concrete reachability mechanism behind integration-oracle (without it, "reachable" collapses to "a test imports the module"). Slices 1 + 2 both land here.

What?

Boot the host app from the cook worktree and exercise it over the wire — the app-execution analogue of test-runner.ts.

  • Slice 1 — probe (runProbe, app-probe.ts): boot → poll readiness → hit one HTTP feature endpoint → classify, always tearing the process down. reachable (< 400), not-reachable (booted but endpoint absent/erroring — the FE-800 orphan), infra (never booted). A spawn error bails fast instead of polling to timeout.
  • Slice 2 — spec resolution (buildProbeSpec, app-probe.ts): resolve a ProbeTarget (boot argv + paths) into a runnable ProbeSpec by allocating a free port and assembling the ready/feature URLs. The boot test's hand-rolled port dance becomes the production primitive it now dogfoods.

Why?

Verification today only runs the test runner in the worktree, so "reachable" degrades to "a test imports the module" and the FE-800 orphan survives. The harness owns the deterministic, unshortcuttable check; the boot argv + paths are inputs (cook-time grounding supplies them later) — no per-stack boot engine. The port can't be hardcoded: under parallel cook each slice boots its own app and a fixed port collides, so port→URL binding is the one harness-owned piece (best-effort ephemeral, loopback-only, acknowledged TOCTOU window — no retry framework).

Tests

Real seeded node:http apps in tmp worktrees, no mocks: reachable; booted-but-404 → orphan; immediate-exit / missing-binary → infra; teardown leaves no process. Plus buildProbeSpec: port allocated + URLs assembled, caller env layered under PORT, distinct ports across 8 concurrent allocations. (Also hardens the FE-743 wall-clock timing test, which flaked under the CPU contention real-process tests add — tolerance now scales with serialMs.)

Deferred

Mode-awareness + where the ProbeTarget argv/paths come from (architect intent + cook grounding) = integration-oracle (#6).

Co-authored-by: Amp amp@ampcode.com

🤖 Generated with Claude Code

…cation (slice 1)

The app-execution analogue of test-runner.ts: runProbe(spec, sandboxDir)
boots an app from the worktree, polls readiness, exercises one HTTP feature
endpoint, and returns a structured ProbeResult classifying the outcome as
reachable (<400) / not-reachable (booted but endpoint absent — the FE-800
orphan) / infra (never booted), always tearing the boot process down.

- types.ts: ProbeOutcomeKind / ProbeSpec / ProbeResult
- app-probe.ts: runProbe + readiness poll + SIGTERM->SIGKILL teardown;
  spawn-error bails fast instead of polling to timeout
- the boot argv + URLs are ProbeSpec INPUTS (cook-time grounding supplies
  them later), not a per-stack boot engine — harness owns the deterministic,
  read-only check; boot mechanics may lean on agent bash (honors the boundary)
- tests boot real seeded node:http apps: reachable / orphan-404 /
  boot-fail / missing-binary / teardown

Also hardens the FE-743 'comparable wall-clock' timing test: its absolute
25ms slack flaked under CPU contention from real-process test files (this
slice's probe tests exposed it). Tolerance now scales with serialMs; a true
serialized-parallel regression is many x serialMs, still caught.

Remaining slices: mode-awareness, integration-oracle gating, ProbeSpec sourcing.

Amp-Thread-ID: https://ampcode.com/threads/T-019ecb9a-9a08-733b-833d-76885fc8243a
Co-authored-by: Amp <amp@ampcode.com>
@kostandinang kostandinang changed the title FE-875: app runtime probe — boot + HTTP probe + reachability classification (slice 1) FE-875: App runtime probe — boot, HTTP probe, reachability classification Jun 16, 2026
@kostandinang kostandinang force-pushed the ka/fe-875-app-runtime-probe branch from cb90e92 to f7a632b Compare June 16, 2026 10:40
@kostandinang kostandinang changed the title FE-875: App runtime probe — boot, HTTP probe, reachability classification FE-875: app runtime probe — boot/probe/classify + ProbeSpec resolution Jun 16, 2026
@kostandinang kostandinang changed the title FE-875: app runtime probe — boot/probe/classify + ProbeSpec resolution FE-875: App runtime probe — boot, probe, classify Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant