From 3ed63454f85340cea83b4236c08d062f4296d030 Mon Sep 17 00:00:00 2001 From: dadachi Date: Sun, 3 May 2026 07:59:15 +0900 Subject: [PATCH] Rename stub flags NATEMPLATE_STUB_* -> NATIVEAPPTEMPLATE_STUB_* MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Final piece of the post-#30 canonical-stem cleanup. PR #30 normalized NATEMPLATE_API/IOS/ANDROID -> NATIVEAPPTEMPLATE_API/IOS/ANDROID. The stub flags were left on the abbreviated stem; this PR brings them in line. Renames: NATEMPLATE_STUB_ALL -> NATIVEAPPTEMPLATE_STUB_ALL NATEMPLATE_STUB_ -> NATIVEAPPTEMPLATE_STUB_ Touch points (4 files, lockstep change): - package.json — test script env var - src/stub.ts — env var lookups (both ALL and per-agent) - src/agents/planner.ts — trace message wording Tests: 16/16 npm run ci green (the test script now sets the renamed flag, so existing stub-mode tests continue to be stubbed as before — no behavior change). User-side follow-up: re-export NATIVEAPPTEMPLATE_STUB_* in any local shells / scripts that previously used the abbreviated form. The old name is now a no-op. Co-Authored-By: Claude Opus 4.7 (1M context) --- package.json | 2 +- src/agents/planner.ts | 2 +- src/stub.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index b4a6297..123e439 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "dev": "tsx src/index.ts", "start": "node dist/index.js", "typecheck:tests": "tsc --noEmit -p tsconfig.test.json", - "test": "NATEMPLATE_STUB_ALL=1 node --import tsx --test tests/smoke.test.ts", + "test": "NATIVEAPPTEMPLATE_STUB_ALL=1 node --import tsx --test tests/smoke.test.ts", "ci": "npm run build && npm run typecheck:tests && npm test", "cost": "bash scripts/cost.sh" }, diff --git a/src/agents/planner.ts b/src/agents/planner.ts index 354046d..deda03f 100644 --- a/src/agents/planner.ts +++ b/src/agents/planner.ts @@ -143,7 +143,7 @@ export async function runPlanner(spec: string): Promise { const delay = (ms: number): Promise => new Promise((r) => { setTimeout(r, ms); }); async function runStubPlanner(spec: string): Promise { - trace("planner", "(stub mode — NATEMPLATE_STUB_ALL or NATEMPLATE_STUB_PLANNER set)"); + trace("planner", "(stub mode — NATIVEAPPTEMPLATE_STUB_ALL or NATIVEAPPTEMPLATE_STUB_PLANNER set)"); await delay(200); trace("planner", "extracting entities and fields"); await delay(250); diff --git a/src/stub.ts b/src/stub.ts index 2c538eb..78e2d5a 100644 --- a/src/stub.ts +++ b/src/stub.ts @@ -1,6 +1,6 @@ import type { AgentName } from "./agents/types.js"; export function isStub(agent: AgentName): boolean { - if (process.env['NATEMPLATE_STUB_ALL'] === "1") return true; - return process.env[`NATEMPLATE_STUB_${agent.toUpperCase()}`] === "1"; + if (process.env['NATIVEAPPTEMPLATE_STUB_ALL'] === "1") return true; + return process.env[`NATIVEAPPTEMPLATE_STUB_${agent.toUpperCase()}`] === "1"; }