Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 137 additions & 0 deletions .agentplane/tasks/202605012143-NEK3E8/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
---
id: "202605012143-NEK3E8"
title: "Fix Homebrew formula npm install"
status: "DOING"
priority: "high"
owner: "CODER"
revision: 5
origin:
system: "manual"
depends_on: []
tags:
- "release"
- "workflow"
verify: []
plan_approval:
state: "approved"
updated_at: "2026-05-01T21:44:05.576Z"
updated_by: "ORCHESTRATOR"
note: null
verification:
state: "ok"
updated_at: "2026-05-01T21:47:52.326Z"
updated_by: "CODER"
note: "Homebrew formula install hotfix verified."
commit: null
comments:
-
author: "CODER"
body: "Start: fix Homebrew formula install path and update the tap hotfix for v0.4.1."
events:
-
type: "status"
at: "2026-05-01T21:44:12.281Z"
author: "CODER"
from: "TODO"
to: "DOING"
note: "Start: fix Homebrew formula install path and update the tap hotfix for v0.4.1."
-
type: "verify"
at: "2026-05-01T21:47:52.326Z"
author: "CODER"
state: "ok"
note: "Homebrew formula install hotfix verified."
doc_version: 3
doc_updated_at: "2026-05-01T21:47:52.333Z"
doc_updated_by: "CODER"
description: "Update the Homebrew formula renderer and tap formula so fresh AgentPlane releases install without Homebrew npm min-release-age blocking fresh package dependencies."
sections:
Summary: |-
Fix Homebrew formula npm install

Update the Homebrew formula renderer and tap formula so fresh AgentPlane releases install without Homebrew npm min-release-age blocking fresh package dependencies.
Scope: |-
- In scope: Update the Homebrew formula renderer and tap formula so fresh AgentPlane releases install without Homebrew npm min-release-age blocking fresh package dependencies.
- Out of scope: unrelated refactors not required for "Fix Homebrew formula npm install".
Plan: |-
1. Reproduce the Homebrew npm install failure mode from the current tap formula and inspect available release assets.
2. Change the Homebrew formula renderer to avoid Homebrew std_npm_args/min-release-age for freshly published npm dependencies while keeping explicit Node runtime dependency.
3. Add/adjust tests that lock the formula contract and evidence fields.
4. Update basilisk-labs/homebrew-tap Formula/agentplane.rb for v0.4.1 and verify local formula syntax/install command shape.
5. Run targeted checks, merge the repo change through branch_pr, and report the remaining standalone/no-Node artifact gap separately.
Verify Steps: |-
1. Review the requested outcome for "Fix Homebrew formula npm install". Expected: the visible result matches ## Summary and stays inside approved scope.
2. Run the most relevant validation step for this task. Expected: it succeeds without unexpected regressions in touched behavior.
3. Compare the final result against ## Scope and record any residual follow-up in ## Findings. Expected: open edges are explicit rather than implicit.
Verification: |-
<!-- BEGIN VERIFICATION RESULTS -->
### 2026-05-01T21:47:52.326Z — VERIFY — ok

By: CODER

Note: Homebrew formula install hotfix verified.

VerifyStepsRef: doc_version=3, doc_updated_at=2026-05-01T21:44:12.281Z, excerpt_hash=sha256:14d2a57b4904317fcf258a430766971c88977ad767cceca680b45264be2eb93b

<!-- END VERIFICATION RESULTS -->
Rollback Plan: |-
- Revert task-related commit(s).
- Re-run required checks to confirm rollback safety.
Findings: |-
- Observation: Updated render-homebrew-formula to install the cached npm tarball without std_npm_args/min-release-age, added contract coverage, and pushed basilisk-labs/homebrew-tap c6d3e94 for v0.4.1. Local Homebrew install reached Cellar successfully; final link was blocked only by an existing /opt/homebrew/bin/agentplane npm-global symlink.
Impact: Fresh AgentPlane releases no longer fail Homebrew install because npm filters same-day workspace dependency versions.
Resolution: Run brew link --overwrite agentplane when an old npm-global symlink is present; standalone no-Node install requires a future native/bundled CLI artifact.
Promotion: incident-candidate
Fixability: external
id_source: "generated"
---
## Summary

Fix Homebrew formula npm install

Update the Homebrew formula renderer and tap formula so fresh AgentPlane releases install without Homebrew npm min-release-age blocking fresh package dependencies.

## Scope

- In scope: Update the Homebrew formula renderer and tap formula so fresh AgentPlane releases install without Homebrew npm min-release-age blocking fresh package dependencies.
- Out of scope: unrelated refactors not required for "Fix Homebrew formula npm install".

## Plan

1. Reproduce the Homebrew npm install failure mode from the current tap formula and inspect available release assets.
2. Change the Homebrew formula renderer to avoid Homebrew std_npm_args/min-release-age for freshly published npm dependencies while keeping explicit Node runtime dependency.
3. Add/adjust tests that lock the formula contract and evidence fields.
4. Update basilisk-labs/homebrew-tap Formula/agentplane.rb for v0.4.1 and verify local formula syntax/install command shape.
5. Run targeted checks, merge the repo change through branch_pr, and report the remaining standalone/no-Node artifact gap separately.

## Verify Steps

1. Review the requested outcome for "Fix Homebrew formula npm install". Expected: the visible result matches ## Summary and stays inside approved scope.
2. Run the most relevant validation step for this task. Expected: it succeeds without unexpected regressions in touched behavior.
3. Compare the final result against ## Scope and record any residual follow-up in ## Findings. Expected: open edges are explicit rather than implicit.

## Verification

<!-- BEGIN VERIFICATION RESULTS -->
### 2026-05-01T21:47:52.326Z — VERIFY — ok

By: CODER

Note: Homebrew formula install hotfix verified.

VerifyStepsRef: doc_version=3, doc_updated_at=2026-05-01T21:44:12.281Z, excerpt_hash=sha256:14d2a57b4904317fcf258a430766971c88977ad767cceca680b45264be2eb93b

<!-- END VERIFICATION RESULTS -->

## Rollback Plan

- Revert task-related commit(s).
- Re-run required checks to confirm rollback safety.

## Findings

- Observation: Updated render-homebrew-formula to install the cached npm tarball without std_npm_args/min-release-age, added contract coverage, and pushed basilisk-labs/homebrew-tap c6d3e94 for v0.4.1. Local Homebrew install reached Cellar successfully; final link was blocked only by an existing /opt/homebrew/bin/agentplane npm-global symlink.
Impact: Fresh AgentPlane releases no longer fail Homebrew install because npm filters same-day workspace dependency versions.
Resolution: Run brew link --overwrite agentplane when an old npm-global symlink is present; standalone no-Node install requires a future native/bundled CLI artifact.
Promotion: incident-candidate
Fixability: external
3 changes: 3 additions & 0 deletions .agentplane/tasks/202605012143-NEK3E8/pr/diffstat.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.../release/render-homebrew-formula-script.test.ts | 74 ++++++++++++++++++++++
scripts/render-homebrew-formula.mjs | 15 +++--
2 files changed, 85 insertions(+), 4 deletions(-)
38 changes: 38 additions & 0 deletions .agentplane/tasks/202605012143-NEK3E8/pr/github-body.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Task: `202605012143-NEK3E8`
Title: Fix Homebrew formula npm install

## Summary

Fix Homebrew formula npm install

Update the Homebrew formula renderer and tap formula so fresh AgentPlane releases install without Homebrew npm min-release-age blocking fresh package dependencies.

## Scope

- In scope: Update the Homebrew formula renderer and tap formula so fresh AgentPlane releases install without Homebrew npm min-release-age blocking fresh package dependencies.
- Out of scope: unrelated refactors not required for "Fix Homebrew formula npm install".

## Verification

- State: ok
- Note: Homebrew formula install hotfix verified.
- Full verification checklist lives in local review.md.

## Handoff Notes

- No handoff notes recorded yet. Use `agentplane pr note ...` to append one.

<details>
<summary>Raw evidence</summary>

- Updated: 2026-05-01T21:47:58.392Z
- Branch: task/202605012143-NEK3E8/homebrew-formula-install
- Head: bb5048218199

```text
.../release/render-homebrew-formula-script.test.ts | 74 ++++++++++++++++++++++
scripts/render-homebrew-formula.mjs | 15 +++--
2 files changed, 85 insertions(+), 4 deletions(-)
```

</details>
1 change: 1 addition & 0 deletions .agentplane/tasks/202605012143-NEK3E8/pr/github-title.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
task: Fix Homebrew formula npm install [202605012143-NEK3E8]
14 changes: 14 additions & 0 deletions .agentplane/tasks/202605012143-NEK3E8/pr/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"base": "main",
"branch": "task/202605012143-NEK3E8/homebrew-formula-install",
"created_at": "2026-05-01T21:44:12.317Z",
"head_sha": "bb5048218199be09b484b4e92977347189955a80",
"last_verified_at": "2026-05-01T21:47:52.326Z",
"last_verified_sha": "f72a6c574a6f787e6c93dff4b3135594804c28ec",
"schema_version": 1,
"task_id": "202605012143-NEK3E8",
"updated_at": "2026-05-01T21:47:58.392Z",
"verify": {
"status": "pass"
}
}
Empty file.
59 changes: 59 additions & 0 deletions .agentplane/tasks/202605012143-NEK3E8/pr/review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# PR Review

Created: 2026-05-01T21:44:12.317Z
Branch: task/202605012143-NEK3E8/homebrew-formula-install

## Summary

Fix Homebrew formula npm install

Update the Homebrew formula renderer and tap formula so fresh AgentPlane releases install without Homebrew npm min-release-age blocking fresh package dependencies.

## Scope

- In scope: Update the Homebrew formula renderer and tap formula so fresh AgentPlane releases install without Homebrew npm min-release-age blocking fresh package dependencies.
- Out of scope: unrelated refactors not required for "Fix Homebrew formula npm install".

## Verification

### Plan

1. Review the requested outcome for "Fix Homebrew formula npm install". Expected: the visible result matches ## Summary and stays inside approved scope.
2. Run the most relevant validation step for this task. Expected: it succeeds without unexpected regressions in touched behavior.
3. Compare the final result against ## Scope and record any residual follow-up in ## Findings. Expected: open edges are explicit rather than implicit.

### Current Status

- State: ok
- Note: Homebrew formula install hotfix verified.

## Risks

- Risk level: not recorded
- Breaking change: no

### Rollback

- Revert task-related commit(s).
- Re-run required checks to confirm rollback safety.

## Handoff Notes

- No handoff notes recorded yet. Use `agentplane pr note ...` to append one.

<!-- BEGIN AUTO SUMMARY -->
<details>
<summary>Raw evidence</summary>

- Updated: 2026-05-01T21:47:58.392Z
- Branch: task/202605012143-NEK3E8/homebrew-formula-install
- Head: bb5048218199

```text
.../release/render-homebrew-formula-script.test.ts | 74 ++++++++++++++++++++++
scripts/render-homebrew-formula.mjs | 15 +++--
2 files changed, 85 insertions(+), 4 deletions(-)
```

</details>
<!-- END AUTO SUMMARY -->
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import { execFile } from "node:child_process";
import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
import { tmpdir } from "node:os";
import path from "node:path";
import { promisify } from "node:util";

import { afterEach, describe, expect, it } from "vitest";

const execFileAsync = promisify(execFile);
const SCRIPT_PATH = path.resolve(process.cwd(), "scripts/render-homebrew-formula.mjs");
const tempRoots: string[] = [];

async function makeTempRoot() {
const root = await mkdtemp(path.join(tmpdir(), "agentplane-homebrew-formula-"));
tempRoots.push(root);
return root;
}

afterEach(async () => {
while (tempRoots.length > 0) {
const root = tempRoots.pop();
if (!root) continue;
await rm(root, { recursive: true, force: true });
}
});

describe("render-homebrew-formula script", () => {
it("renders a cached tarball npm install without Homebrew min-release-age arguments", async () => {
const root = await makeTempRoot();
const manifestPath = path.join(root, "release-distribution.json");
const outDir = path.join(root, "homebrew");
await mkdir(root, { recursive: true });
await writeFile(
manifestPath,
`${JSON.stringify(
{
version: "0.4.1",
tag: "v0.4.1",
sha: "abc123",
packages: {
agentplane: {
npmTarballUrl: "https://registry.npmjs.org/agentplane/-/agentplane-0.4.1.tgz",
npmTarballSha256:
"76edd130dceddb1d15313a5feb3819c513c815b350b9abc822b3ea4712ccc74b",
},
},
channels: {
homebrewTap: {
status: "skipped_missing_credentials",
requiredSecret: "HOMEBREW_TAP_TOKEN",
},
},
},
null,
2,
)}\n`,
);

await execFileAsync("node", [SCRIPT_PATH, "--manifest", manifestPath, "--out", outDir], {
cwd: process.cwd(),
});

const formula = await readFile(path.join(outDir, "Formula", "agentplane.rb"), "utf8");
const evidence = JSON.parse(await readFile(path.join(outDir, "homebrew-result.json"), "utf8")) as {
installStrategy: string;
};
expect(formula).toContain('version "0.4.1"');
expect(formula).toContain("cached_download");
expect(formula).toContain('"--omit=dev", "--ignore-scripts", "--no-audit", "--no-fund"');
expect(formula).not.toContain("std_npm_args");
expect(formula).not.toContain("--min-release-age");
expect(evidence.installStrategy).toBe("npm_global_cached_tarball");
});
});
15 changes: 11 additions & 4 deletions scripts/render-homebrew-formula.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,16 @@ function renderFormula(manifest) {
homepage "https://agentplane.org"
url "${url}"
sha256 "${sha256}"
version "${version}"
license "MIT"

depends_on "node"

def install
system "npm", "install", *std_npm_args
bin.install_symlink libexec.glob("bin/*")
system "npm", "install", "--global", "--prefix", libexec,
"--omit=dev", "--ignore-scripts", "--no-audit", "--no-fund",
cached_download
bin.install_symlink Dir[libexec/"bin/*"]
end

test do
Expand Down Expand Up @@ -112,6 +115,7 @@ async function renderHomebrew(repoRoot, args) {
formulaName: FORMULA_NAME,
npmTarballUrl: manifest.packages?.agentplane?.npmTarballUrl ?? null,
npmTarballSha256: manifest.packages?.agentplane?.npmTarballSha256 ?? null,
installStrategy: "npm_global_cached_tarball",
nextAction:
channel.status === "skipped_missing_credentials"
? "Add HOMEBREW_TAP_TOKEN and rerun the Homebrew tap publication module for this manifest."
Expand All @@ -123,8 +127,11 @@ async function renderHomebrew(repoRoot, args) {
);

if (args.check) {
if (!formula.includes("std_npm_args")) {
throw new Error("Homebrew formula must use std_npm_args for npm package installation");
if (formula.includes("std_npm_args") || formula.includes("--min-release-age")) {
throw new Error("Homebrew formula must not use std_npm_args/min-release-age");
}
if (!formula.includes("cached_download")) {
throw new Error("Homebrew formula must install the cached release tarball");
}
rmSync(tempRoot, { recursive: true, force: true });
}
Expand Down