diff --git a/checkpoint.json b/checkpoint.json new file mode 100644 index 000000000..d88f8f534 --- /dev/null +++ b/checkpoint.json @@ -0,0 +1,52 @@ +{ + "timestamp": "2026-03-19T14:57:19.568112Z", + "current_node": "toolchain", + "completed_nodes": [ + "start", + "toolchain" + ], + "node_retries": { + "toolchain": 1, + "start": 1 + }, + "context_values": { + "internal.run_id": "01KM39KFRC393V6PJ39G9XMXJ2", + "graph.model_stylesheet": "\n * { backend: api; model: claude-opus-4-6;}\n ", + "current.preamble": "Goal: # Detect GitHub App visibility mismatch during `repo init`\n\n## Context\n\nWhen `fabro repo init` detects the GitHub App is not installed for a repo, it shows a generic \"install at\" URL. But if the repo owner differs from the app owner, the app must be **public** to be installable. Users currently get no guidance about this, leading to confusion when the install link doesn't work.\n\n## Changes\n\n### 1. Add `get_authenticated_app()` to fabro-github\n\n**File:** `lib/crates/fabro-github/src/lib.rs`\n\nAdd two public structs near the existing response types (around line 40):\n\n```rust\npub struct AppOwner {\n pub login: String,\n}\n\npub struct AppInfo {\n pub slug: String,\n pub owner: AppOwner,\n}\n```\n\nAdd function after `check_app_installed` (after line 525):\n\n- `pub async fn get_authenticated_app(client, jwt, base_url) -> Result`\n- Calls `GET {base_url}/app` with Bearer JWT auth\n- Returns `AppInfo` on 200, errors on 401/other\n\n### 2. Add `is_app_public()` to fabro-github\n\n**File:** `lib/crates/fabro-github/src/lib.rs`\n\nAdd function after `get_authenticated_app`:\n\n- `pub async fn is_app_public(client, slug, base_url) -> Result`\n- Calls `GET {base_url}/apps/{slug}` **without** auth (public apps are visible to unauthenticated requests)\n- Returns `Ok(true)` on 200, `Ok(false)` on 404, error on other status\n\n### 3. Update `check_github_app_installation` in init.rs\n\n**File:** `lib/crates/fabro-cli/src/init.rs`\n\nIn the `Ok(false)` branch (line 250), before showing the install URL:\n\n1. Call `get_authenticated_app()` to get the app's owner\n2. Compare `app_info.owner.login` with the repo `owner` (case-insensitive)\n3. If they differ, call `is_app_public()` to check visibility\n4. If the app is private and owners differ, show a targeted warning:\n\n```\n ! GitHub App \"{slug}\" is private but this repo belongs to a different owner ({repo_owner}).\n The app must be made public before it can be installed outside {app_owner}.\n Update visibility at: https://github.com/settings/apps/{slug}\n```\n\nAll new checks are best-effort — failures are silently ignored (the existing generic warning still shows).\n\n### 4. Tests\n\n**File:** `lib/crates/fabro-github/src/lib.rs` (test module)\n\nAdd tests using existing `mockito` patterns:\n\n- `get_authenticated_app_success` — 200 returns parsed `AppInfo`\n- `get_authenticated_app_auth_failure` — 401 returns error\n- `is_app_public_returns_true_on_200` — public app\n- `is_app_public_returns_false_on_404` — private app\n- `is_app_public_no_auth_header` — verify no Authorization header is sent\n\n## Verification\n\n1. `cargo test -p fabro-github` — new unit tests pass\n2. `cargo build --workspace` — compiles cleanly\n3. `cargo clippy --workspace -- -D warnings` — no warnings\n4. Manual: run `fabro repo init` in a repo owned by a different org than the app to verify the warning appears\n\n", + "internal.retry_count.toolchain": 1, + "internal.node_visit_count": 1, + "command.stderr": "", + "internal.retry_count.start": 1, + "graph.rankdir": "LR", + "graph.goal": "# Detect GitHub App visibility mismatch during `repo init`\n\n## Context\n\nWhen `fabro repo init` detects the GitHub App is not installed for a repo, it shows a generic \"install at\" URL. But if the repo owner differs from the app owner, the app must be **public** to be installable. Users currently get no guidance about this, leading to confusion when the install link doesn't work.\n\n## Changes\n\n### 1. Add `get_authenticated_app()` to fabro-github\n\n**File:** `lib/crates/fabro-github/src/lib.rs`\n\nAdd two public structs near the existing response types (around line 40):\n\n```rust\npub struct AppOwner {\n pub login: String,\n}\n\npub struct AppInfo {\n pub slug: String,\n pub owner: AppOwner,\n}\n```\n\nAdd function after `check_app_installed` (after line 525):\n\n- `pub async fn get_authenticated_app(client, jwt, base_url) -> Result`\n- Calls `GET {base_url}/app` with Bearer JWT auth\n- Returns `AppInfo` on 200, errors on 401/other\n\n### 2. Add `is_app_public()` to fabro-github\n\n**File:** `lib/crates/fabro-github/src/lib.rs`\n\nAdd function after `get_authenticated_app`:\n\n- `pub async fn is_app_public(client, slug, base_url) -> Result`\n- Calls `GET {base_url}/apps/{slug}` **without** auth (public apps are visible to unauthenticated requests)\n- Returns `Ok(true)` on 200, `Ok(false)` on 404, error on other status\n\n### 3. Update `check_github_app_installation` in init.rs\n\n**File:** `lib/crates/fabro-cli/src/init.rs`\n\nIn the `Ok(false)` branch (line 250), before showing the install URL:\n\n1. Call `get_authenticated_app()` to get the app's owner\n2. Compare `app_info.owner.login` with the repo `owner` (case-insensitive)\n3. If they differ, call `is_app_public()` to check visibility\n4. If the app is private and owners differ, show a targeted warning:\n\n```\n ! GitHub App \"{slug}\" is private but this repo belongs to a different owner ({repo_owner}).\n The app must be made public before it can be installed outside {app_owner}.\n Update visibility at: https://github.com/settings/apps/{slug}\n```\n\nAll new checks are best-effort — failures are silently ignored (the existing generic warning still shows).\n\n### 4. Tests\n\n**File:** `lib/crates/fabro-github/src/lib.rs` (test module)\n\nAdd tests using existing `mockito` patterns:\n\n- `get_authenticated_app_success` — 200 returns parsed `AppInfo`\n- `get_authenticated_app_auth_failure` — 401 returns error\n- `is_app_public_returns_true_on_200` — public app\n- `is_app_public_returns_false_on_404` — private app\n- `is_app_public_no_auth_header` — verify no Authorization header is sent\n\n## Verification\n\n1. `cargo test -p fabro-github` — new unit tests pass\n2. `cargo build --workspace` — compiles cleanly\n3. `cargo clippy --workspace -- -D warnings` — no warnings\n4. Manual: run `fabro repo init` in a repo owned by a different org than the app to verify the warning appears\n", + "internal.thread_id": "start", + "failure_signature": "", + "outcome": "success", + "failure_class": "", + "thread.start.current_node": "toolchain", + "command.output": "cargo 1.94.0 (85eff7c80 2026-01-15)\n", + "internal.fidelity": "compact", + "current_node": "toolchain" + }, + "logs": [], + "node_outcomes": { + "start": { + "status": "success", + "duration_ms": 0 + }, + "toolchain": { + "status": "success", + "context_updates": { + "command.output": "cargo 1.94.0 (85eff7c80 2026-01-15)\n", + "command.stderr": "" + }, + "notes": "Script completed: command -v cargo >/dev/null || { curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && sudo ln -sf $HOME/.cargo/bin/* /usr/local/bin/; }; cargo --version 2>&1", + "duration_ms": 144 + } + }, + "next_node_id": "preflight_compile", + "node_visits": { + "toolchain": 1, + "start": 1 + } +} \ No newline at end of file diff --git a/nodes/start/status.json b/nodes/start/status.json new file mode 100644 index 000000000..5632fdd0c --- /dev/null +++ b/nodes/start/status.json @@ -0,0 +1,6 @@ +{ + "status": "success", + "notes": null, + "failure_reason": null, + "timestamp": "2026-03-19T14:57:19.414182+00:00" +} \ No newline at end of file diff --git a/nodes/toolchain/script_invocation.json b/nodes/toolchain/script_invocation.json new file mode 100644 index 000000000..d68c414c4 --- /dev/null +++ b/nodes/toolchain/script_invocation.json @@ -0,0 +1,5 @@ +{ + "command": "command -v cargo >/dev/null || { curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && sudo ln -sf $HOME/.cargo/bin/* /usr/local/bin/; }; cargo --version 2>&1", + "language": "shell", + "timeout_ms": null +} \ No newline at end of file diff --git a/nodes/toolchain/script_timing.json b/nodes/toolchain/script_timing.json new file mode 100644 index 000000000..ca290c371 --- /dev/null +++ b/nodes/toolchain/script_timing.json @@ -0,0 +1,5 @@ +{ + "duration_ms": 143, + "exit_code": 0, + "timed_out": false +} \ No newline at end of file diff --git a/nodes/toolchain/status.json b/nodes/toolchain/status.json new file mode 100644 index 000000000..8d321f791 --- /dev/null +++ b/nodes/toolchain/status.json @@ -0,0 +1,6 @@ +{ + "status": "success", + "notes": "Script completed: command -v cargo >/dev/null || { curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && sudo ln -sf $HOME/.cargo/bin/* /usr/local/bin/; }; cargo --version 2>&1", + "failure_reason": null, + "timestamp": "2026-03-19T14:57:19.567750+00:00" +} \ No newline at end of file