CURRENT_STATE — V0.5.0

Updated: 2026-09-06

Canonical runtime

normal ChatGPT mobile/web -> authenticated Val Town plugin -> val-scoped SQLite -> runner.ts -> provider router -> cloud browser -> receipt

No Codex and no user computer are required.

Val Town

  • Val: cleitoncosta/chat-native-maestro
  • Personal workspace tier: Free
  • Code visibility: public (Free-tier constraint)
  • Public HTTP: minimal liveness only
  • Detailed diagnostics: authenticated status.ts
  • Task execution: authenticated Val Town plugin only
  • Persistent state: val-scoped SQLite
  • Schema/app version: 0.5.0
  • Automatic runner/cron: disabled

Implemented files

Entrypoints

  • main.ts — minimal public GET-only liveness endpoint.
  • status.ts — authenticated provider/task/cost/security diagnostics.
  • runner.ts — queue lease, validation, network preflight, routed execution, retry decision, receipt persistence.
  • selftest.ts — stateless DSL/config regression tests.
  • stateful_selftest.ts — circuit breaker, timeout and retry-state regression tests with state restoration.
  • url_selftest.ts — URL/DNS/SSRF regression tests.

Libraries

  • lib/types.ts — typed task/receipt/evidence schema.
  • lib/dsl.ts — DSL validation, browser program generation, in-memory secret resolution.
  • lib/policy.ts — retry/lease/timeout/circuit constants and pure disposition logic.
  • lib/provider_health.ts — circuit breaker state machine.
  • lib/cost.ts — provider cost-estimation rules.
  • lib/url_security.ts — fail-closed URL/DNS-over-HTTPS preflight.

Providers

  • providers/router.ts — provider routing/fallback with health tracking.
  • providers/kernel.ts — primary browser adapter.
  • providers/browserless.ts — secondary browser adapter.

Documentation

  • README.md
  • docs/CURRENT_STATE.md
  • docs/PROVIDER_CENSUS.md
  • docs/ACTIVATION_RUNBOOK.md
  • docs/TASK_SCHEMA.md
  • docs/SMOKE_TASK.json

Database schema V0.5

browser_tasks

Durable queue and terminal receipt state. New V0.5 fields:

  • attempt_count
  • claimed_at
  • next_attempt_at

browser_attempts

One row per provider attempt/fallback with:

  • attempt number
  • provider
  • timestamps
  • status/error
  • duration
  • sanitized receipt
  • estimated Browserless units

provider_health

Circuit state per provider:

  • CLOSED / HALF_OPEN / OPEN
  • consecutive failures
  • cooldown timestamp
  • last success/failure/error

provider_census

Provider ranking and current free-tier facts.

schema_meta

schema_version=0.5.0, app_version=0.5.0.

Operational policy V0.5

  • max attempts per task: 2
  • read-only FAIL retry delay: 10 s
  • RUNNING lease: 90 s
  • browser execution timeout: 25 s
  • provider circuit opens at 3 consecutive FAILs
  • circuit cooldown: 15 min
  • automatic cross-provider fallback: read-only only
  • automatic scheduled execution: disabled

A retry can become PENDING, but it cannot consume browser credits until ChatGPT explicitly invokes the runner again.

Network security

Before any provider execution:

  • only HTTP/HTTPS
  • URL credentials/userinfo blocked
  • nonstandard ports blocked
  • private/link-local/loopback/reserved/documentation IPv4/IPv6 blocked
  • localhost/internal/metadata hostnames blocked
  • allowed hosts validated
  • A/AAAA resolved through Cloudflare DNS-over-HTTPS
  • any resolved non-public IP blocks the task
  • DNS/preflight failure fails closed

Runner-level negative-control proof: ssrf-runner-v05 -> BLOCKED / NETWORK_PREFLIGHT_BLOCKED: blocked hostname: 169.254.169.254

The fixture was deleted after verification.

Secret policy

Task JSON never stores secret values. fill_secret stores only an env-var name and requires explicit approval. The value is resolved in memory immediately before provider execution.

extract_attribute of value is blocked to reduce accidental credential leakage.

Current user-created Val Town env-var count: 0.

Evidence retention

Default: minimal. Persisted by default:

  • run/provider/status
  • final URL
  • checks
  • errors
  • duration
  • fallback evidence
  • network preflight evidence

Not persisted by default:

  • extracted outputs
  • provider session ID

full must be intentionally requested.

Cost policy

Kernel

Official current Free plan verified 2026-09-06:

  • $0/month plus usage
  • $5 monthly free credits
  • 5 concurrent browsers
  • no card required to start
  • billed by GB-second

Local Kernel cost estimate remains unsupported; actual account usage must be observed.

Browserless

Official current Free plan verified 2026-09-06:

  • 1,000 units/month
  • 2 concurrent browsers
  • max session 2 min
  • no card
  • browser time 1 unit/30 s
  • CAPTCHA/proxy additional
  • overage cap should be set to $0 if Browserless is activated

The runtime estimates base browser-time units only; actual provider accounting remains authoritative.

Evidence states

PASS

  • ChatGPT Val Town plugin authentication.
  • Free workspace enumerated.
  • create/edit/run/deploy.
  • public liveness HTTP 200.
  • authenticated diagnostics.
  • SQLite schema/migrations/versioning.
  • atomic queue claim.
  • empty queue behavior.
  • stale RUNNING lease recovery.
  • task attempt persistence.
  • retry policy pure test.
  • timeout test.
  • provider circuit OPEN after three synthetic FAILs and restoration to CLOSED.
  • consequential action approval gate.
  • secret approval gate.
  • invalid provider rejection.
  • value attribute extraction block.
  • Kernel SDK adapter module load.
  • Browserless adapter module load.
  • missing provider credential -> BLOCKED.
  • DoH availability through normal Val Town HTTPS egress.
  • public-domain DNS preflight.
  • local/private/metadata/userinfo/nonstandard-port URL blocks.
  • runner-level SSRF block before provider invocation.
  • automatic schedule disabled.

UNVERIFIED

  • Kernel API authentication for this account.
  • live Kernel browser creation.
  • live Kernel server-side Playwright execution.
  • Kernel real credit consumption.
  • Browserless API authentication for this account.
  • live Browserless /function execution.
  • Browserless real unit consumption.

Persistent historical negative controls

These three V0.4 records intentionally remain in browser_tasks as historical evidence:

  1. neg-control-no-kernel-key -> BLOCKED / KERNEL_API_KEY missing.
  2. neg-control-no-browserless-token -> BLOCKED / BROWSERLESS_TOKEN missing.
  3. neg-control-secret-not-approved -> BLOCKED / NEEDS_SECRET_APPROVAL.

V0.5 synthetic lease/circuit/SSRF fixtures were removed after tests so production metrics are not polluted.

Next incomplete milestone

Exactly one external action remains necessary: configure a recurring-free browser credential, preferably KERNEL_API_KEY, directly in Val Town env vars. Do not paste it into chat.

After the key exists:

  1. confirm only the env-var name exists;
  2. enqueue docs/SMOKE_TASK.json explicitly;
  3. execute runner.ts once;
  4. inspect task + attempt receipt;
  5. verify heading = Example Domain and all checks PASS;
  6. inspect provider usage;
  7. only then promote Kernel from ACCOUNT_KEY_REQUIRED/UNVERIFIED to OPERATIONAL.