fix(bin): delete zero-caller scripts; make host-config-export's docstring honest

- bin/gstack-open-url (14 lines): announced in a CHANGELOG entry, wired into
  nothing, ever. bin/gstack-platform-detect (27 lines): zero callers, and its
  hand-rolled host list was already stale (SLATE_HOST.md cites it as a
  problem). Note: the deprecated gstack-brain-consumer/reader pair the audit
  flagged was already deleted upstream in v1.63 with a stay-deleted tripwire.
- scripts/task-emission-schema.ts (61 lines): a typed schema module nothing
  imported; the tasks-section comment now documents the JSONL fields inline.
- scripts/host-config-export.ts claimed to be the 'shell bridge for the bash
  setup script' — setup never calls it (its hand-rolled host lists drifting
  is a known follow-up). Docstring now states what it IS: a standalone,
  test-pinned query CLI not yet wired into setup. Its validateValue +
  CLI_REGEX/PATH_REGEX internals were dead (defined for a guarantee the
  header claimed but nothing enforced).
- KEPT deliberately: scripts/preflight-agent-sdk.ts — a documented manual
  diagnostic (CONTRIBUTING.md + USING_GBRAIN_WITH_GSTACK.md reference it).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Garry Tan 2026-08-14 19:27:53 -07:00
parent d38a7b54e3
commit 60134c4320
No known key found for this signature in database
GPG Key ID: C1F69E85C74EFE1D
5 changed files with 8 additions and 112 deletions

View File

@ -1,14 +0,0 @@
#!/usr/bin/env bash
# gstack-open-url — cross-platform URL opener
#
# Usage: gstack-open-url <url>
set -euo pipefail
URL="${1:?Usage: gstack-open-url <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

View File

@ -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

View File

@ -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 <command> [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) {

View File

@ -4,7 +4,9 @@
* {{TASKS_SECTION_EMIT:<phase>}} 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';

View File

@ -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: <id>` note.
*/
export function dedupKey(t: Pick<ImplementationTask, 'component' | 'files' | 'title'>): string {
return JSON.stringify({
component: t.component,
files: [...t.files].sort(),
title: t.title,
});
}