@assembly-js/app-foundation 0.0.48 → 0.0.49
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.
- package/CHANGELOG.md +3 -0
- package/bin/check-crons.mjs +7 -2
- package/bin/check-proxy-csrf.mjs +9 -5
- package/bin/check-token-usage.mjs +7 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,9 @@ A foundation update reads the sections between an app's version and the target:
|
|
|
14
14
|
from every bullet except `[guidance]`, agent work from the check scripts those `[action]`
|
|
15
15
|
bullets ship. Write `[fix]`, `[behavior]` and `[action]` bullets for the app's owner.
|
|
16
16
|
|
|
17
|
+
## 0.0.49
|
|
18
|
+
- [fix] Scheduled-work wiring, proxy, and session-token problems are now caught when the platform updates the app, not only when the app's own change touches them.
|
|
19
|
+
|
|
17
20
|
## 0.0.48
|
|
18
21
|
- [guidance] Builds now warn when an app lacks the retry screen for platform outages, calls the child-row batch detached from the database, or imports a PDF library on the server that breaks after publishing, with the exact steps to fix each; nothing in an existing app changes until its code is updated.
|
|
19
22
|
|
package/bin/check-crons.mjs
CHANGED
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
// Node are guaranteed.
|
|
11
11
|
//
|
|
12
12
|
// The build fails only for cron wiring the current turn is changing (see
|
|
13
|
-
// cronWiringChangedThisTurn)
|
|
13
|
+
// cronWiringChangedThisTurn), or for any finding with --strict (a platform
|
|
14
|
+
// update turn). Everything else — a template clone, a Vercel
|
|
14
15
|
// build, an update turn that never touched the cron — gets the same findings
|
|
15
16
|
// as warnings: those paths have no agent who can act on a failure, so failing
|
|
16
17
|
// them would only strand an app that already worked. A below-floor schedule
|
|
@@ -38,6 +39,10 @@ const ROUTE_FILE = /^route\.(tsx|ts|jsx|js)$/;
|
|
|
38
39
|
// The turn program exports the SHA the sandbox started this turn at; the files
|
|
39
40
|
// below are the ones whose change since then makes the findings the agent's own.
|
|
40
41
|
const TURN_BASELINE_ENV = 'ASSEMBLY_TURN_BASELINE_SHA';
|
|
42
|
+
// Set by the turn program on a platform update turn, where the update itself is
|
|
43
|
+
// the mandate to fix whatever is wrong, so findings fail the build whether or
|
|
44
|
+
// not the turn touched the cron wiring.
|
|
45
|
+
const STRICT = process.argv.includes('--strict') || process.env.ASSEMBLY_UPDATE_TURN === '1';
|
|
41
46
|
const CRON_WIRING_PATHS = ['vercel.json', 'app/api/cron/'];
|
|
42
47
|
|
|
43
48
|
function report(lines, { fatal }) {
|
|
@@ -312,4 +317,4 @@ if (entries.length > 0) {
|
|
|
312
317
|
}
|
|
313
318
|
|
|
314
319
|
if (preexistingIntervals.length > 0) report(preexistingIntervals, { fatal: false });
|
|
315
|
-
if (problems.length > 0) report(problems, { fatal: cronWiringChangedThisTurn() });
|
|
320
|
+
if (problems.length > 0) report(problems, { fatal: STRICT || cronWiringChangedThisTurn() });
|
package/bin/check-proxy-csrf.mjs
CHANGED
|
@@ -13,10 +13,11 @@
|
|
|
13
13
|
// carries a session token, so nothing here needs the network.
|
|
14
14
|
//
|
|
15
15
|
// Like check-crons, a broken proxy fails the build only when the current turn
|
|
16
|
-
// changed it (or with --strict, which the update acceptance passes
|
|
17
|
-
// the findings are warnings, since there is
|
|
18
|
-
// still on the pre-bearer foundation only ever
|
|
19
|
-
// platform security update is what fixes it, not an
|
|
16
|
+
// changed it (or with --strict, which the update acceptance passes, or on a
|
|
17
|
+
// platform update turn); otherwise the findings are warnings, since there is
|
|
18
|
+
// no agent to act on them. An app still on the pre-bearer foundation only ever
|
|
19
|
+
// warns outside those: the platform security update is what fixes it, not an
|
|
20
|
+
// ordinary turn.
|
|
20
21
|
import { existsSync, readFileSync } from 'node:fs';
|
|
21
22
|
import { spawnSync } from 'node:child_process';
|
|
22
23
|
import { createRequire } from 'node:module';
|
|
@@ -25,7 +26,10 @@ import { join } from 'node:path';
|
|
|
25
26
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
26
27
|
|
|
27
28
|
const ROOT = process.cwd();
|
|
28
|
-
|
|
29
|
+
// Set by the turn program on a platform update turn, where the update itself is
|
|
30
|
+
// the mandate to fix whatever is wrong. Routine updates only reach apps that
|
|
31
|
+
// took the security update, so no pre-bearer app sees this outside it.
|
|
32
|
+
const STRICT = process.argv.includes('--strict') || process.env.ASSEMBLY_UPDATE_TURN === '1';
|
|
29
33
|
const PROXY_FILES = ['proxy.ts', 'middleware.ts'];
|
|
30
34
|
const REEXCHANGE_ROUTE = 'app/api/assembly-reexchange/route.ts';
|
|
31
35
|
const REEXCHANGE_PATH = '/api/assembly-reexchange';
|
|
@@ -19,11 +19,16 @@
|
|
|
19
19
|
// logic_build.go (mintBearerProbePath / packageWorldProbePath): mint-bearer.ts
|
|
20
20
|
// present -> bearer-capable, fatal; absent + assembly.ts present -> legacy, warn
|
|
21
21
|
// and exit 0; neither present -> package-world app (bearer-capable via
|
|
22
|
-
// @assembly-js/app-foundation in node_modules), fatal as today.
|
|
22
|
+
// @assembly-js/app-foundation in node_modules), fatal as today. With --strict
|
|
23
|
+
// or on a platform update turn it is fatal even in a legacy app.
|
|
23
24
|
import { readFileSync, readdirSync, existsSync } from 'node:fs';
|
|
24
25
|
import { join, relative, sep } from 'node:path';
|
|
25
26
|
|
|
26
27
|
const ROOT = process.cwd();
|
|
28
|
+
// Set by the turn program on a platform update turn, where the update itself is
|
|
29
|
+
// the mandate to fix whatever is wrong. Routine updates only reach apps that
|
|
30
|
+
// took the security update, so no pre-bearer app sees this outside it.
|
|
31
|
+
const STRICT = process.argv.includes('--strict') || process.env.ASSEMBLY_UPDATE_TURN === '1';
|
|
27
32
|
const APP_DIR = join(ROOT, 'app');
|
|
28
33
|
|
|
29
34
|
// Mirrors mintBearerProbePath / packageWorldProbePath in logic_build.go.
|
|
@@ -129,7 +134,7 @@ for (const file of pageFiles(APP_DIR)) {
|
|
|
129
134
|
|
|
130
135
|
if (violations.length > 0) {
|
|
131
136
|
const isLegacy =
|
|
132
|
-
!existsSync(join(ROOT, MINT_BEARER_PROBE_PATH)) && existsSync(join(ROOT, PACKAGE_WORLD_PROBE_PATH));
|
|
137
|
+
!STRICT && !existsSync(join(ROOT, MINT_BEARER_PROBE_PATH)) && existsSync(join(ROOT, PACKAGE_WORLD_PROBE_PATH));
|
|
133
138
|
|
|
134
139
|
console.error('');
|
|
135
140
|
console.error('A page reads the session token from searchParams:');
|