Skip to content

Commit 8fd6656

Browse files
build(npm): committish-free allowScripts key (npm-12-proof); correct EALLOWSCRIPTS root-cause record (#2349)
* docs(deploy): webhook-secret repair — verified end-to-end; STATUS de-spliced; stale Coolify uuid fixed Rebuilt from monet/deploy-webhook-repair onto current main (the lane worktree acquired a concurrent session mid-land, so this lands from a throwaway worktree per the lane-busy protocol; the original branch is superseded by this one). Content, now with the outcome recorded: - docs/rollouts/2026-08-02-deploy-webhook-secret-repair.md: full receipts of the repair (every main push answered 'Invalid signature' by Coolify -> zero deployments created; hook secret synced from the app's manual_webhook_secret_github; duplicate hook deleted; redelivery created a real deployment) and the verification: scripts/verify-deploy-sha.sh 19dfd51 = PASS ~04:47Z. Prod runs main HEAD; the 30-finding remediation (#2341) is live, and unauthenticated /api/health confirmed minimized in prod (USD balances + raw storage bytes gone; schedulerLease.owner residual filed as follow-up). - AGENTS.md: Coolify stanza corrected — app uuid is `socratic-app` (dockerfile build, SSH deploy-key source, manual webhook endpoint with HMAC validation); the old m1os7ijf31bg3fanil152e4b/nixpacks/GitHub-App description was stale and the failure mode (green 200s on the hook page while the delivery response body says Invalid signature) is now documented where the next diagnostician will look. - STATUS.md: de-spliced again (union-merge had re-duplicated table rows and resurrected the stale owner-action deploy blocker); deploy blocker -> RESOLVED with receipts; npm EALLOWSCRIPTS blocker -> RESOLVED by #2345 with the stale-allowScripts-tag recurrence warning; next actions updated. - docs/EFFORT-LOG.md: repair row moved to COMPLETED+VERIFIED. Docs only — no code. Co-Authored-By: Claude <[email protected]> * build(npm): committish-free allowScripts key (npm-12-proof); correct the EALLOWSCRIPTS root-cause record The reproduction agent's 10-case isolated investigation refuted the explanation this seat recorded earlier: a stale allowScripts tag was NOT the trigger (a project with no allowScripts field at all installs the git dep fine, and a clean-shell npm ci with the repo's exact pre-#2345 files passes). The real triggers are an `allow-scripts` line in any .npmrc layer or an inherited npm_config_allow_scripts env var, which npm forwards into its own git-dep preparation subprocess and then rejects as a flag — upstream npm/cli#9783, open, unfixed through npm 12.0.2. This Mac had live npx-launched processes exporting [email protected]/wasp-cli; any descendant shell fails every install instantly. npm@10 "worked" because it ignores the unknown config. The one-line code change is forward-looking: npm's allowScripts matcher compares a git key's committish against the lockfile's resolved 40-char SHA, so a tag-form key (#v2.4.1) can never match — dead weight today (warning), but npm 12 escalates uncovered scripts to a HARD BLOCK, which would silently block congress-trading-shared's `prepare` (tsup build) and ship the package without dist/. The committish-free form is the only one that matches, and it survives future tag bumps. Verified: npm install exit 0 with zero coverage warnings mentioning the dep (was 1). Also recorded: #2345's lockfile regen fixed a second silent bug (lockfile pinned the v2.3.0 commit while package.json said v2.4.x — npm ci was shipping the OLD shared package), and retracted STATUS.md's nonexistent schedulerLease.owner follow-up (the landed health route already strips the pid for unauthenticated callers; the earlier observation was against the pre-deploy payload). Docs updated: STATUS.md, docs/EFFORT-LOG.md, docs/rollouts/2026-08-02-npm-allowscripts-findings.md (new). Verified: npx tsc --noEmit clean; plain npm ci exit 0 (575 pkgs); post-change npm install exit 0, dep coverage warning gone. Co-Authored-By: Claude <[email protected]> * docs(handoff): MONET session stop — clean closeout map; board dedupe after merge Owner-directed stop. Adds the session handoff note (final verified state of all three arcs: remediation live, deploy pipeline repaired and organically flowing, npm root-caused with the npm-12-proof key change riding this same PR), updates STATUS.md (prod row: c117afb is the SECOND organic cutover since the repair; handoff stanza), and the effort boards. Also merges origin/main into this branch to clear the DIRTY state #2348's squash left it in, with the union-duplicated effort-log block deduped by hand. Docs updated: STATUS.md, docs/EFFORT-LOG.md, docs/rollouts/2026-08-02-monet-session-handoff.md (new). Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
1 parent b7d88e4 commit 8fd6656

5 files changed

Lines changed: 210 additions & 3 deletions

File tree

‎STATUS.md‎

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,19 @@ of work), effort state lives in `docs/EFFORT-LOG.md`, and entries written here b
77

88
Last updated: 2026-08-02.
99

10+
> [!NOTE]
11+
> **MONET session stopped 2026-08-02 ~05:40Z (owner instruction) — clean handoff.** All
12+
> claimed work is either merged or riding an armed auto-merge (PR #2349: npm-12-proof
13+
> `allowScripts` key + record corrections — lands and deploys unattended once `verify` is
14+
> green). Nothing uncommitted anywhere. Session handoff with the full state map:
15+
> `docs/rollouts/2026-08-02-monet-session-handoff.md`.
16+
1017
## Where things stand
1118

1219
| | |
1320
|---|---|
1421
| `main` | `c117afb9` — includes the full 30-finding Codex remediation (#2341, AG-reviewed) and the npm `allowScripts` fix (#2345) |
15-
| Production (`socratictrade.com`) | `19dfd51b` verified live 2026-08-02 ~04:47Z (`scripts/verify-deploy-sha.sh` PASS); `c117afb9` should follow via the repaired webhook |
22+
| Production (`socratictrade.com`) | `c117afb9` verified live ~05:35Z — SECOND organic cutover since the repair; `b7d88e42` builds next (serialized) |
1623
| Deploy mechanism | auto-deploy on push to `main` — **repaired 2026-08-02** (webhook HMAC secret was mismatched; see blocker 1) |
1724
| Core trading health | DB ok, scheduler ticking, 3 active accounts / 0 degraded, litestream replicating |
1825
| Data providers | `dataProvidersDegraded=true` — FMP plan probe 403, Massive capped to ~2y history |
@@ -32,6 +39,24 @@ Last updated: 2026-08-02.
3239
now). Full receipts + recurrence warning:
3340
`docs/rollouts/2026-08-02-deploy-webhook-secret-repair.md`.
3441

42+
2. **RESOLVED — npm `EALLOWSCRIPTS` on the shared git dep (and the earlier explanation
43+
here was wrong).** A clean-shell reproduction with the repo's exact files PASSES: the
44+
repo as committed installs fine, and a stale `allowScripts` tag was NOT the trigger.
45+
The real triggers (npm 11.16.0+, upstream bug npm/cli#9783, open, unfixed through npm
46+
12.0.2): an `allow-scripts=...` line in ANY `.npmrc` layer, or an inherited
47+
`npm_config_allow_scripts` env var — npm forwards it into its git-dep preparation
48+
subprocess, which rejects it as a flag. This Mac had live `npx`-launched processes
49+
exporting `[email protected]/wasp-cli`; any shell descending from that
50+
lineage fails every `npm ci` instantly. If EALLOWSCRIPTS appears: check
51+
`env | grep npm_config_allow_scripts` and relaunch the contaminated parent — and NEVER
52+
add `allow-scripts` to `.npmrc`, even though npm's own error message suggests it.
53+
Also fixed forward: `allowScripts` git-dep keys in tag form (`#vX.Y.Z`) can never match
54+
(npm compares against the resolved 40-char SHA), which npm 12 escalates from a warning
55+
to a hard block on the dep's `prepare` — the key is now committish-free
56+
(`"github:jaywedgeworth22/congress-trading-shared": true`, verified: coverage warning
57+
gone). #2345's lockfile regen also fixed a real silent bug: the old lockfile pinned the
58+
v2.3.0 commit while package.json said v2.4.x, so `npm ci` was silently shipping the old
59+
shared package. Verified 2026-08-02: plain `npm ci` = exit 0, 575 packages, clean shell.
3560
2. **RESOLVED 2026-08-02 (PR #2345) — npm 11.16 `EALLOWSCRIPTS` on the shared git dep.**
3661
`npm install`/`npm ci` failed preparing `congress-trading-shared` and left `node_modules`
3762
EMPTY (easily misread as janitor reaping); the interim workaround was `npx -y npm@10 ci`.
@@ -50,6 +75,9 @@ Last updated: 2026-08-02.
5075

5176
- Watch that `c117afb9` (and subsequent merges) deploy organically via the repaired
5277
webhook — `bash scripts/verify-deploy-sha.sh` after merging.
78+
- (Retracted: the `schedulerLease.owner` "residual" flagged earlier does not exist — the
79+
landed code already strips the pid for unauthenticated callers; prod serves the bare
80+
instance uuid. Observation was made against the pre-deploy payload.)
5381
- Small follow-up in flight: fold `schedulerLease.owner` behind the ops token on
5482
`/api/health` (the one residual of finding 27's minimization).
5583
- Owner decisions pending: FMP subscription, Massive plan tier; and whether hook-secret

‎docs/EFFORT-LOG.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
- **[Socratic.Trade][MONET] Session closeout 2026-08-02 ~05:40Z (owner stop-order) - CLEAN.** All arcs verified: 30-finding Codex remediation LIVE in prod (#2341); deploy pipeline repaired + proven 3x (redelivery PASS 19dfd51b ~04:47Z, then organic cutovers - c117afb9 live ~05:35Z, b7d88e42 building); plain npm ci restored (575 pkgs) + npm-12-proof allowScripts key riding armed auto-merge PR #2349 (reconciled after #2348-squash DIRTY; lands+deploys unattended). No uncommitted work; watchers stopped; lane ~/apps/trading-monet vacated (Connections skeleton parked separately in draft #2350 by its own session). Handoff map: docs/rollouts/2026-08-02-monet-session-handoff.md.
2+
- **[Socratic.Trade][MONET] npm EALLOWSCRIPTS root cause + allowScripts npm-12-proofing - COMPLETED 2026-08-02 (branch `monet/deploy-webhook-docs`).** Reproduction agent (10 isolated cases) REFUTED the earlier stale-tag theory: the repo as committed installs clean; real triggers are `allow-scripts` in any .npmrc layer or an inherited `npm_config_allow_scripts` env var (upstream npm/cli#9783, open, unfixed through npm 12.0.2; this Mac had npx-launched processes exporting [email protected]/wasp-cli). Forward fix landed: allowScripts git-dep key switched to committish-free form (tag-form keys can NEVER match - npm compares vs the resolved 40-char SHA - and npm 12 escalates uncovered prepare scripts to a hard block that would ship congress-trading-shared without dist/). Verified: plain npm ci exit 0 / 575 pkgs; post-change install has zero coverage warnings for the dep. Also confirmed #2345's lockfile regen fixed a silent v2.3.0-pin (npm ci had been shipping the OLD shared package). Corrections recorded in STATUS.md incl. retracting the nonexistent schedulerLease.owner follow-up. Rollout: docs/rollouts/2026-08-02-npm-allowscripts-findings.md.
13
- **[Socratic.Trade][MONET] Deploy pipeline repair: webhook HMAC secret mismatch - COMPLETED + VERIFIED 2026-08-02.** Root cause of the 2026-08-01 prod freeze: Coolify answered every refs/heads/main push with 'Invalid signature' (HMAC mismatch vs the app's manual_webhook_secret_github) on both repo hooks -> zero deployments created all day (GitHub hook page showed green 200s; the truth was in the delivery response body). Fix: synced hook 658815433's secret from the Coolify app, deleted exact-duplicate hook 658869484, redelivered newest main push -> real deployment created immediately; scripts/verify-deploy-sha.sh 19dfd51b = PASS ~04:47Z (prod cut over to main HEAD; finding-27 health minimization confirmed live, payload 4KB->2.2KB). Also fixed AGENTS.md's stale Coolify uuid (app is `socratic-app`, dockerfile, deploy-key source -> manual webhook endpoint). Residual follow-up: fold schedulerLease.owner behind the ops token. Rollout: docs/rollouts/2026-08-02-deploy-webhook-secret-repair.md.
24
- **[Socratic.Trade][AG] Codex external-review remediation (30 findings) — COMPLETED 2026-08-01 (branch `ag/codex-review-remediation`).** Resumed and completed Monet's paused remediation of all 30 Codex findings (15 REAL fixes implemented across Wave 1 & Wave 2, 9 refuted with code receipts, 6 not-real/intended). Gates verified: tsc clean (0 errors), eslint clean (0 errors), vitest clean (5,606/5,606 passed across 486 test files), Next.js production build clean. Rollout: `docs/rollouts/2026-08-01-codex-review-remediation-handoff.md`.
35
- **[Socratic.Trade][KIMI] Brokerage-model order-state hardening §7 slice 1: per-broker order-status conformance tables — IMPLEMENTED 2026-08-01 (branch `kimi/broker-status-conformance`, PR #2335, auto-merge armed).** freqtrade discipline locked into CI: `src/lib/broker-status-conformance.ts` maps every documented raw status of alpaca/robinhood/tradier to its canonical class across the four production lenses (live/active/working/decline/filled), executed against the REAL shared classifiers by 7 new conformance tests — vocabulary or classifier edits in either direction fail CI. Audit finding fixed: `broker-held-orders.ts`'s drifted local decline set (missing `failed`/`error`, zero importers) replaced by re-export of canonical `broker-side.isRejectedOrCanceledState`. Tables pin `done_for_day` terminal-inert (2026-07-27 inflation), `pending_cancel`/`pending_replace` deliberately live, `replaced` ≠ decline, unknowns fail CLOSED. Gates: tsc/lint clean, targeted 46/46, full suite 5553/5553 (3 shards), build green — dedicated clean worktree `~/apps/trading-kimi-s7`. Rollout: `docs/rollouts/2026-08-01-broker-status-conformance.md`.
@@ -104,7 +106,6 @@ As of 2026-07-08 (assignment-rule update).
104106
- **[Socratic.Trade][KIMI] Generalized preview renderers for mutating operations — COMPLETED 2026-07-29 (zero-code finding).** Full-surface inventory shows the Hivekeep preview pattern is ALREADY landed in bespoke, proportionate form on every mutating surface: policy/Guardrails edits (review Sheet w/ per-field diff + Locks Down/Unlocks + typed CONFIRM for loosening on live), account deletion (server-side preview w/ counts+blockers+5 acks+typed email/phrase), live proposal approve (typed batch Sheet), learned-context approve (confirm w/ exact effect preview), broker disconnect + learned-fact delete + API-key delete (inline confirms w/ consequence text). Autonomy re-arm (halted→start) is one-tap by deliberate owner-directed design (chrome.tsx ControlSheet). A shared MutationPreview abstraction would refactor 8+ tuned surfaces for marginal consistency — not advisable. Finding will be folded into docs/oss-lessons.md §5.
105107
- **[Socratic.Trade][KIMI] nofx-style consecutive-miss safety mode — In Progress 2026-07-29 (claimed KIMI).** Rolling matured-outcome hit-rate → degraded close-only posture + risk_advisory notification + auto-recovery, per docs/oss-lessons.md §8 design sketch; mirrors the 2026-07-28 guard-enablement pattern (policy.tuning fields + Guardrails surface).
106108
- **[Socratic.Trade] Backtest-integrity suite for the learning loop — PLANNED / UNASSIGNED.** Jesse rule-significance testing + TraderHarness point-in-time masking/entity anonymization + qlib walk-forward before any LLM proposal is evaluated against history. Design in docs/oss-lessons.md §6.
107-
- **[Socratic.Trade] Brokerage-model order-state hardening — PARTIALLY IMPLEMENTED (slice 1 of 4 landed 2026-08-01, PR #2335).** Slice 1 per-broker order-status conformance tables + decline-set unification IMPLEMENTED (see KIMI rows); slices 2–4 (declarative order-type constraint validation, per-account broker-mutation mutex, uniform protection receipts) remain PLANNED / UNASSIGNED. Design in docs/oss-lessons.md §7.
108109
- **[Socratic.Trade][CURSOR] Free-first enrichment cascade + coverage report — Completed 2026-07-27.** Merged #2230 (`c93f1988`) to main; auto-deployed (prod health sha matches). FilingAPI/SEC XBRL default ON/free-first/coverage admin. Superseded closed #2224.
109110

110111
- **[Socratic.Trade][OWNER REMINDER][GROK 2026-07-22] Enable default-off RAG / retrieval features after #1892 lands — PLANNED / UNASSIGNED.** **#1892 MERGED 2026-07-23** — enablement still gated on re-embed proof. Order: telemetry → eval → `RAG_CORPUS_WIDE_LEXICAL` → adaptive rerank → parent expansion → multi-query/HyDE. Checklist: `docs/FEATURE-ENABLEMENT-BACKLOG.md`.
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# 2026-08-02 — HANDOFF: MONET session stop (Codex remediation closeout + deploy-pipeline repair)
2+
3+
Session stopped ~05:40Z at owner instruction. **Clean stop: everything is merged or riding
4+
an armed auto-merge; nothing is uncommitted; no watcher or background task of this session
5+
is still running.** This note is the state map for whoever picks anything up.
6+
7+
## 1. Context & Objective
8+
9+
One session arc, three phases: (a) remediate the 2026-08-01 Codex external review
10+
(30 findings) — completed jointly with ANTIGRAVITY, who landed the paused branch as
11+
PR #2341 with genuine review; (b) root-cause and repair the production deploy freeze that
12+
was masking everything (webhook HMAC mismatch); (c) root-cause the fleet-wide npm
13+
`EALLOWSCRIPTS` install failure and forward-proof the fix for npm 12.
14+
15+
## 2. Final state (all verified, with receipts)
16+
17+
| Thread | State |
18+
|---|---|
19+
| 30-finding Codex remediation | **Merged (#2341) and VERIFIED LIVE in prod.** Triage record: 15 confirmed / 9 refuted / 6 not-real; refutation evidence preserved (see §6) |
20+
| Deploy pipeline | **Repaired + proven 3x**: redelivered push → deployment → `verify-deploy-sha.sh 19dfd51b` PASS ~04:47Z; then TWO organic cutovers (`c117afb9` live ~05:35Z, uptime 716s at probe). `b7d88e42` (docs, #2348) builds next — builds serialize (~40 min each) |
21+
| PR #2349 (npm-12-proof `allowScripts` key + record corrections) | **OPEN, auto-merge armed, branch reconciled with main** (it had gone DIRTY after #2348's squash; fixed with a plain merge, board files hand-deduped after). Lands + auto-deploys unattended when `verify` goes green |
22+
| Plain `npm ci` | **Working** (exit 0, 575 pkgs, validated on the previously-failing Mac) |
23+
| `/api/health` minimization (finding 27) | **Confirmed live**: unauthenticated payload 4KB → 2.2KB; USD balances + raw storage bytes gone; lease owner pid-stripped (`leaseOwnerWithoutPid`) — the earlier "residual" claim was WRONG (pre-deploy observation) and is retracted |
24+
25+
## 3. Decisions & Trade-offs (this session's judgment calls)
26+
27+
- **Webhook repair direction:** synced GitHub hook secret FROM Coolify's
28+
`manual_webhook_secret_github` (GitHub secrets are write-only, so Coolify's value is the
29+
only recoverable truth). Deleted duplicate hook 658869484 (GitHub itself proved it an
30+
exact duplicate by rejecting the same config twice). Redelivery used as verification —
31+
re-enacts the standing auto-deploy path; NOT a manual deploy trigger.
32+
- **#2349 DIRTY fix:** plain `git merge origin/main` rather than rebase+force-push (the
33+
repo bans unconfirmed force-pushes). Union-merge duplicated 1 effort-log block; deduped
34+
by hand before pushing. 4 remaining same-title rows with differing bodies are
35+
pre-existing historical near-dupes on main — left alone deliberately.
36+
- **npm root cause supersedes my own earlier record:** the stale-tag theory (recorded in
37+
STATUS.md by this seat, now corrected in #2349) was refuted by a 10-case isolated
38+
reproduction. Real triggers: `allow-scripts` in any `.npmrc`, or inherited
39+
`npm_config_allow_scripts` (upstream npm/cli#9783, open, unfixed through npm 12.0.2).
40+
41+
## 4. Verification State
42+
43+
```bash
44+
# deploy chain
45+
bash scripts/verify-deploy-sha.sh 19dfd51b # PASS ~04:47Z (redelivered push)
46+
# c117afb9 confirmed live ~05:35Z by direct /api/health probe (uptime 716s)
47+
# npm (on the previously-failing Mac, node 24 PATH prefix)
48+
npm ci --no-audit --no-fund # exit 0, 575 packages
49+
npm install --no-audit --no-fund # exit 0; git-dep coverage warning GONE post-key-change
50+
npx tsc --noEmit # exit 0 on the #2349 branch
51+
```
52+
53+
PR #2349 carries the full `verify` gate in CI (code-bearing change); it had not completed
54+
at stop time — auto-merge handles it, no babysitting needed.
55+
56+
## 5. Next Steps & Blockers
57+
58+
**Nothing requires immediate agent action.** In descending priority:
59+
60+
1. **Owner questions (unchanged):** FMP subscription (plan probe 403); Massive plan tier;
61+
and the recurrence question from the webhook repair — if recreating the Coolify app
62+
regenerated `manual_webhook_secret_github`, the freeze recurs on the next recreate
63+
unless hook-secret re-sync joins the app-recreate recipe
64+
(`docs/rollouts/2026-08-02-deploy-webhook-secret-repair.md` §6).
65+
2. **If #2349's verify fails** (unlikely — tsc clean, one-line package.json change +
66+
docs): fix on branch `monet/deploy-webhook-docs`, worktree
67+
`/private/tmp/monet-webhook-docs-wt` (still exists, deps installed; /private/tmp does
68+
not survive reboot — recreate from the remote branch if gone).
69+
3. **Optional deploy sanity:** `bash scripts/verify-deploy-sha.sh` (defaults to
70+
origin/main) any time; it PASSes when live CONTAINS the expected commit. `b7d88e42`
71+
and later merges should flow unattended now.
72+
4. **Before any npm 12 adoption:** cover the transitive `[email protected]/0.25` install
73+
scripts in `allowScripts` (npm 12 hard-blocks uncovered scripts —
74+
`docs/rollouts/2026-08-02-npm-allowscripts-findings.md` §5).
75+
5. **If EALLOWSCRIPTS ever returns:** `env | grep npm_config_allow_scripts` FIRST (this
76+
Mac had `npx`-launched processes exporting `[email protected]/wasp-cli`
77+
— any descendant shell fails every install); never add `allow-scripts` to `.npmrc`.
78+
79+
## 6. Pointers / cleanup notes
80+
81+
- **Peer lanes at stop:** the Connections-skeleton session ALSO closed out on the owner's
82+
stop-order — its work is parked in **draft PR #2350** (branch
83+
`monet/connections-route-skeleton`; impl + adversarial-review fixes done, `land.sh`
84+
full test+build NOT run; its own closeout gives the pickup command). `~/apps/trading-monet`
85+
is free again. The other MONET seat is on Congress.Trade applying the webhook-repair
86+
recipe there (relayed via #agent-sync).
87+
- **Branches safe to delete** (both fully landed; deletion left to the owner per repo
88+
rule): `monet/codex-review-remediation` (landed as #2341),
89+
`monet/deploy-webhook-repair` (superseded by #2348/#2349).
90+
`monet/deploy-webhook-docs` deletes itself on #2349's merge.
91+
- **Evidence preserved:** the 15 per-finding triage briefs (evidence + adversarial
92+
critiques) at `/Users/jay/apps/monet-triage-briefs-2026-08-01/`; npm reproduction cases
93+
in the session scratchpad (`npmrepro/case*`) — scratchpad is session-scoped, the
94+
findings are fully written up in the npm rollout note.
95+
- **Session rollout notes, in order:** `2026-08-01-codex-review-remediation.md` →
96+
`2026-08-01-codex-review-remediation-handoff.md` (mid-session pause) →
97+
`2026-08-02-deploy-webhook-secret-repair.md` →
98+
`2026-08-02-npm-allowscripts-findings.md` → this note.

0 commit comments

Comments
 (0)