eve-hub 0.16.22 → 0.16.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,8 +22,12 @@ const claims = (jwt) => JSON.parse(Buffer.from(jwt.split(".")[1], "base64url").t
22
22
 
23
23
  export function deploymentFacts(env = process.env) {
24
24
  const oidc = env.VERCEL_OIDC_TOKEN ? claims(env.VERCEL_OIDC_TOKEN) : {};
25
- const repoOwner = env.VERCEL_GIT_REPO_OWNER && env.VERCEL_GIT_REPO_SLUG ? env.VERCEL_GIT_REPO_OWNER : undefined;
26
- const repo = repoOwner ? `${repoOwner}/${env.VERCEL_GIT_REPO_SLUG}` : undefined;
25
+ // An uploaded build has no git metadata. Onboarding's first one is the workspace repo's, which the hub names in
26
+ // HUB_GITHUB_REPO (`owner/name`) before the repo exists, so its bots get the git extension too.
27
+ const [hubOwner, hubSlug] = (env.HUB_GITHUB_REPO ?? "").split("/");
28
+ const git = env.VERCEL_GIT_REPO_OWNER && env.VERCEL_GIT_REPO_SLUG ? [env.VERCEL_GIT_REPO_OWNER, env.VERCEL_GIT_REPO_SLUG] : hubOwner && hubSlug ? [hubOwner, hubSlug] : undefined;
29
+ const repoOwner = git?.[0];
30
+ const repo = git ? `${git[0]}/${git[1]}` : undefined;
27
31
  return {
28
32
  team: oidc.owner,
29
33
  project: oidc.project,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eve-hub",
3
- "version": "0.16.22",
3
+ "version": "0.16.24",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Bot-side code shared by every hub agent: registry tools, the roster hook, the eve channel, the host sandbox and browser, and model helpers.",
6
6
  "type": "module",
package/prepare.mjs CHANGED
@@ -13,8 +13,9 @@
13
13
  // Vercel Kit connection is wired in, every bot of a build from a repo gets eve's git extension, and the
14
14
  // workspace's memory and each bot's team architecture are embedded in the bots' memory providers, (a function has no workspace cwd);
15
15
  // - /hub/manifest: the roster and the commit sha the deployment was built
16
- // from, for the hub to sync from: a custom channel on main, routed in
17
- // vercel.mjs. From the hub, as on each bot's eve channel (hub-oidc.mjs).
16
+ // from (its deployment id when it was uploaded, not built from git), for the
17
+ // hub to sync from: a custom channel on main, routed in vercel.mjs. From the
18
+ // hub, as on each bot's eve channel (hub-oidc.mjs).
18
19
  import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, rmdirSync, unlinkSync, writeFileSync } from "node:fs";
19
20
  import { createRequire } from "node:module";
20
21
  import { basename, dirname, join } from "node:path";
@@ -123,9 +124,10 @@ import workspace from "../../../../hub.manifest.json" with { type: "json" };
123
124
  // The roster, humans and subagent cap as deployed, Mac bots included, and the eve-hub and eve versions that built it, for the hub to sync from:
124
125
  // hub.manifest.json is bundled at build, so a push whose deploy fails never
125
126
  // changes it. \`sha\` is the commit the deployment was built from, which the hub
126
- // syncs by; a deployment with none (\`vercel deploy\` uploads no git metadata)
127
- // has no manifest to give.
128
- const sha = process.env.VERCEL_GIT_COMMIT_SHA;
127
+ // syncs by. An uploaded deployment (onboarding's first, built while the repo is
128
+ // made) has no commit, so it answers its own deployment id, which the hub reads
129
+ // from the project's production deployment.
130
+ const sha = process.env.VERCEL_GIT_COMMIT_SHA || process.env.VERCEL_DEPLOYMENT_ID;
129
131
  const { agents, humans, subagentCap, hopLimit } = parseWorkspace(workspace);
130
132
  const manifest = { sha, kit: ${JSON.stringify(KIT_VERSION)}, eve: ${JSON.stringify(EVE_VERSION)}, agents, humans, subagentCap, ...(hopLimit === undefined ? {} : { hopLimit }) };
131
133
 
@@ -133,7 +135,7 @@ export default defineChannel({
133
135
  routes: [
134
136
  GET("/hub/manifest", async (request) => {
135
137
  if (!(await isHubRequest(request, getVercelOidcToken))) return new Response("unauthorized", { status: 401 });
136
- if (!sha) return new Response("no commit sha: this deployment wasn't built from git", { status: 500 });
138
+ if (!sha) return new Response("no commit sha or deployment id: this isn't a Vercel deployment", { status: 500 });
137
139
  return Response.json(manifest);
138
140
  }),
139
141
  ],
@@ -3,12 +3,13 @@
3
3
  - Question it again whenever two fixes on one idea fail.
4
4
  - Why: a correct fix for the wrong problem costs a full build and review, then a second one.
5
5
  - **Brief before building**
6
- - The owner posts a brief, scaled to the change (three lines for a copy fix): the required behavior in the human's words, how it works today (file:line), every PR, repo or moving part it adds, and the real-path test.
6
+ - The owner posts a brief, scaled to the change (three lines for a copy fix). It leads with its impact for the human: the measured change (latency, CPU, cost, steps), or the named work it unblocks with that work's number. Then the required behavior in the human's words, how it works today (file:line), every PR, repo or moving part it adds, and the real-path test.
7
+ - A step or PR with no measured impact, schema cleanup that only tidies included, is offered to the human as optional, never built by default.
7
8
  - Building waits for the human's yes, even while they're offline; meanwhile do the research, the repro and the draft. Picking an option that names what gets built counts as a yes.
8
9
  - Build only what the brief names; within it, make the sensible call on details and say which you made.
9
10
  - A new PR, repo or subsystem, or a dropped requirement, is a question to the human, never a build step or a review blocker.
10
11
  - Small reversible setup (a webhook, a secret, a project setting) isn't building: do it, then say what you set.
11
- - Why: the human's yes on scope is cheaper than their no on a finished PR.
12
+ - Why: the human's yes on scope is cheaper than their no on a finished PR, and a step that changes nothing they can measure still costs a build, a review and the code it leaves behind.
12
13
  - **Build it right**
13
14
  - Fix the cause at the module that owns the broken invariant, then grep for the same bug elsewhere. No guard, retry, catch or default that hides a failure.
14
15
  - Subtract before you add: every new flag, layer, cache, retry or file names the requirement that forces it today. A replacement deletes the old mechanism.