diff --git a/bin/gstack-open-url b/bin/gstack-open-url deleted file mode 100755 index 725231376..000000000 --- a/bin/gstack-open-url +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash -# gstack-open-url — cross-platform URL opener -# -# Usage: gstack-open-url -set -euo pipefail - -URL="${1:?Usage: gstack-open-url }" - -case "$(uname -s)" in - Darwin) open "$URL" ;; - Linux) xdg-open "$URL" 2>/dev/null || echo "$URL" ;; - MINGW*|MSYS*|CYGWIN*) start "$URL" ;; - *) echo "$URL" ;; -esac diff --git a/bin/gstack-platform-detect b/bin/gstack-platform-detect deleted file mode 100755 index 766a585b3..000000000 --- a/bin/gstack-platform-detect +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# gstack-platform-detect: show which AI coding agents are installed and gstack status -# Config-driven: reads host definitions from hosts/*.ts via host-config-export.ts - -SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" -GSTACK_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" - -printf "%-16s %-10s %-40s %s\n" "Agent" "Version" "Skill Path" "gstack" -printf "%-16s %-10s %-40s %s\n" "-----" "-------" "----------" "------" - -for host in $(bun run "$GSTACK_DIR/scripts/host-config-export.ts" list 2>/dev/null); do - cmd=$(bun run "$GSTACK_DIR/scripts/host-config-export.ts" get "$host" cliCommand 2>/dev/null) - root=$(bun run "$GSTACK_DIR/scripts/host-config-export.ts" get "$host" globalRoot 2>/dev/null) - spath="$HOME/$root" - - if command -v "$cmd" >/dev/null 2>&1; then - ver=$("$cmd" --version 2>/dev/null | head -1 || echo "unknown") - if [ -d "$spath" ] || [ -L "$spath" ]; then - status="INSTALLED" - else - status="NOT INSTALLED" - fi - printf "%-16s %-10s %-40s %s\n" "$host" "$ver" "$spath" "$status" - fi -done diff --git a/scripts/host-config-export.ts b/scripts/host-config-export.ts index 5ef703624..35a0b9192 100644 --- a/scripts/host-config-export.ts +++ b/scripts/host-config-export.ts @@ -1,6 +1,10 @@ #!/usr/bin/env bun /** - * Export host configs as shell-safe values for consumption by the bash setup script. + * Standalone query CLI for host configs (list / get / detect / validate). + * + * NOT yet wired into ./setup — setup still hand-rolls its host lists (a + * known drift source; driving setup from this CLI is queued follow-up work). + * Behavior is pinned by test/host-config.test.ts. * * Usage: bun run scripts/host-config-export.ts [args] * @@ -18,19 +22,11 @@ import { validateAllConfigs } from './host-config'; import { RESOLVERS } from './resolvers'; import { execSync } from 'child_process'; -const CLI_REGEX = /^[a-z][a-z0-9_-]*$/; -const PATH_REGEX = /^[a-zA-Z0-9_.\/${}~-]+$/; function shellEscape(s: string): string { return "'" + s.replace(/'/g, "'\\''") + "'"; } -function validateValue(val: string, context: string): void { - if (!PATH_REGEX.test(val) && !CLI_REGEX.test(val)) { - throw new Error(`Unsafe value for ${context}: ${val}`); - } -} - const [command, ...args] = process.argv.slice(2); switch (command) { diff --git a/scripts/resolvers/tasks-section.ts b/scripts/resolvers/tasks-section.ts index 2f86f588b..a32f6dd1c 100644 --- a/scripts/resolvers/tasks-section.ts +++ b/scripts/resolvers/tasks-section.ts @@ -4,7 +4,9 @@ * {{TASKS_SECTION_EMIT:}} — per-skill task emission + JSONL write * {{TASKS_SECTION_AGGREGATE}} — autoplan aggregation across all phases * - * Schema for the JSONL artifact lives in scripts/task-emission-schema.ts. + * JSONL artifact fields: phase, run_id, branch, commit, id, priority, + * component, files, effort_human, effort_cc, title, source_finding + * (consumed by /autoplan's aggregator). */ import type { TemplateContext, ResolverFn } from './types'; diff --git a/scripts/task-emission-schema.ts b/scripts/task-emission-schema.ts deleted file mode 100644 index 131b39044..000000000 --- a/scripts/task-emission-schema.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Schema reference for the per-skill Implementation Tasks JSONL artifact (#1454). - * - * Each review skill (plan-ceo-review, plan-design-review, plan-eng-review, - * plan-devex-review) writes one JSONL line per task during its synthesis step - * to `~/.gstack/projects/$SLUG/tasks-{phase}-{datetime}.jsonl`. - * - * `/autoplan`'s Phase 4 aggregator reads ALL phase JSONL files, scopes them - * by branch + commit window, dedupes by exact (component, sorted(files), title), - * and renders an `## Implementation Tasks (aggregated across phases)` section - * inside the Final Approval Gate output. - * - * Wire format: one JSON object per line. Build via `jq -nc` from bash — never - * by hand-rolled echo/printf, because task titles and source findings may - * contain quotes, newlines, and backslashes. - */ - -export type TaskPhase = 'ceo-review' | 'design-review' | 'eng-review' | 'devex-review'; -export type TaskPriority = 'P1' | 'P2' | 'P3'; - -/** - * One row in tasks-{phase}-{datetime}.jsonl. All fields required unless noted. - */ -export interface ImplementationTask { - /** Which review phase produced this task. */ - phase: TaskPhase; - /** Unique run identifier for this phase invocation (timestamp + pid suffix). */ - run_id: string; - /** Branch the review ran on. Aggregator filters by this. */ - branch: string; - /** HEAD commit at review time. Aggregator filters by commit-window proximity. */ - commit: string; - /** Short task id, unique within a single run_id (T1, T2, ...). */ - id: string; - priority: TaskPriority; - /** Coarse component label (e.g., `browse/sanitizer`, `auth/login`). */ - component: string; - /** Files the task touches. Aggregator sorts this and uses it in the dedup key. */ - files: string[]; - /** Human-team effort estimate (e.g., "2h", "1 day"). */ - effort_human: string; - /** CC+gstack effort estimate (e.g., "15min"). */ - effort_cc: string; - /** Action-oriented title in imperative form ("Add commandResult-level sanitization"). */ - title: string; - /** Free-text reference to the finding that motivated this task. */ - source_finding: string; -} - -/** - * Dedup key for the aggregator. Two tasks collapse into one ONLY when this - * tuple is identical (per `D13 finding 9`). Near-duplicates surface as - * separate tasks with a `possible-duplicate-of: ` note. - */ -export function dedupKey(t: Pick): string { - return JSON.stringify({ - component: t.component, - files: [...t.files].sort(), - title: t.title, - }); -}