Skip to content

feat: add pi-package keyword so pi.dev gallery indexes billion-context (clean, un-bundled) - #509

Merged
ranxianglei merged 1 commit into
masterfrom
2026-09-04_pi-package-keyword-clean
Sep 4, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-09-04_pi-package-keyword-clean

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Sep 4, 2026 •

Copy link
Copy Markdown
Owner

Closing as redundant: #508 already merged (3e2252e) with exactly the clean one-line change — "pi-package" keyword added to package.json keywords (verified via git show 3e2252e). No further action needed; the keyword reaches the published artifact in v0.1.82 (PR #510).

@github-actions

github-actions Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-09-04_pi-package-keyword-clean (27391ad)

Option A — Install from npm PR tag (recommended)

npm install -g billion-context@pr-509

Each push to this PR publishes a new version under the pr-509 npm tag.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr509.tgz
npm install -g package

This comment is automatically updated on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 ework agent · qwen3.8-27b

[bot] 🏷 Reviewed #509 against the repo. Verdict: approve — clean, correctly-scoped, ready to merge. I verified the claims independently rather than taking them on trust.

What I checked (with evidence)

Scope is exactly as stated. Branch 2026-09-04_pi-package-keyword-clean (27391ad) has merge-base 091d4da (= current master HEAD, v0.1.80). Its diff vs master is precisely:

package.json | 3 ++-
     "anthropic",
-    "openai"
+    "openai",
+    "pi-package"

No other file touched. One keyword, no code, no version bump.

Manifest stays intact. Parsed the branch's package.json: valid JSON, version still 0.1.80, final keywords end …,"openai","pi-package". A malformed manifest is the only real failure mode for a package.json edit, so this was the load-bearing check.

Legitimacy holds. package.json:65-67 declares "pi": { "extensions": ["./dist/agent/pi.js"] }, and src/agent/pi.ts has the standalone no-op guard (if (proxyBase === undefined) return;). Tagging pi-package is honest, not noise.

Why the clean branch is the right call over #508

Confirmed your framing. 2026-09-04_pi-gallery-keyword (3e2252e, behind #508) shares the same base but sits 6 commits ahead of master: the identical keyword commit plus five others — forward-once-then-learn (#496), the BILI_IMAGE_TOKEN_CAP docs/changelog, the anonymous-pfa legacy-id migration exclusion (#499 prerequisite), and two merge commits for #500/#502. Its diffstat is 9 files, +251/−11 across src/server.ts, src/persist.ts, docs, and three test files.

I confirmed #496 and #499-prereq are not already reachable from master, so merging #508 as-is would ship all of that under a "metadata-only" label. Your recommendation stands: land #496/#499 via their own reviewed PRs if wanted (they're preserved on the #508 branch), and use #509 for the keyword alone.

On the pre-flight

I did not re-run the full suite — a keyword-only change cannot affect TS compilation or test logic, and the one reported failure (resolveClientCommand: codex/claude resolve to themselves, tests/launcher.test.ts:715) is environmental (ambient /usr/bin/codex in the sandbox), unrelated to package.json. What I did verify directly is the gate that actually matters for this change: JSON validity + manifest integrity + scope + version. npm run build being skipped is fine for metadata-only.

Relation to other items

Not a duplicate of #508 — it's the deliberate isolated re-cut you described, and it supersedes #508 for the keyword step. Follow-up is coherent: npm reads keywords from the latest published version, so this takes effect when #507 (release v0.1.81) publishes. Nothing else needed from me.

I won't merge — that's human-only. Approving from my side.

@ranxianglei

Copy link
Copy Markdown
Owner Author

Closing as redundant: #508 was merged as 3e2252e and its landed content is exactly the clean form this PR was re-cutting — a single pi-package keyword line in package.json, nothing else (verified: git show 3e2252e = 1 line). The keyword ships in v0.1.82 (PR #510).

@ranxianglei ranxianglei closed this Sep 4, 2026
@ranxianglei ranxianglei reopened this Sep 4, 2026
@ranxianglei
ranxianglei merged commit 085bab6 into master Sep 4, 2026
12 checks passed
@ranxianglei
ranxianglei deleted the 2026-09-04_pi-package-keyword-clean branch October 15, 2026 05:32
ranxianglei pushed a commit that referenced this pull request Nov 5, 2026
…5698)

When a host model only partially complies with T1 compression nudges
(folds a few K of the offered mass each time), decideNudge's growth
cascade starves T2/T3 distillation forever: the T2 mass leg demands
t2Pen > t1Eff behind a T1-first short-circuit, so a persistently high
t1Eff makes the distillation slot structurally unreachable even after
its own threshold passes — summary blocks accumulate monotonically
until the session ceiling (#5671 production incident; #5698 root cause).

T1 harvest-stall detection:

- A T1 nudge fire records the offered raw mass (breakdown.pendingT1)
  in state.nudge.lastT1FirePending (consume-once).
- On successful applyCompression, realized tokensCompressed is compared
  against it: a distillation fold (new tier >= 2 block) clears the stall
  unconditionally; otherwise a T1-shaped fold harvesting less than
  STALL_HARVEST_RATIO (0.5) of the offered mass latches
  state.nudge.t1HarvestStall, at/above ratio clears it. No-op calls are
  not evidence and leave the armed measurement in place.
- decideNudge consumes the flag only when tiers.enabled: in the growth
  band a stalled T1 yields its slot to a cadence-met T2/T3 whose own
  mass threshold is met (the legacy "> t1Eff" demand drops for this
  path); in the pressure band the stall removes T1 from candidates when
  max(t2,t3) clears minPressureBenefit, so arbitration picks the tier
  that actually delivers. Reasons carry "[T1 harvest stall]".

Composes with the #509 count-trigger slot rotation already on this
branch: the stall override sits above the count-ready pool, explicit
count triggers keep working independently of the flag, and per-tier
cadence applies to the redirected slot as usual.

Untouched by design: flat 50K growth cadence (KDD #8), the #379
mass-as-demand philosophy (the stall is consulted only once a higher
tier's mass leg crossed its own threshold), #194 first-sight re-arm,
and the minPressureBenefit gate. Compatibility: both new state fields
are optional — pre-fix snapshots lack them, detection stays off, and
arbitration is byte-identical (pinned). Eager lanes never latch.

Tests: kernel/tests/nudge.test.ts +9 rows (core latch to slot handoff,
full-compliance never latches, distillation clears, legacy absent-flag
byte-identity, pressure drop/keep, cadence respect, no-op-not-evidence,
count-trigger independence). Red-check: 7/9 fail without the fix.
ranxianglei pushed a commit that referenced this pull request Nov 5, 2026
…tay stable (#5698)

The #509 rotation memory was initialized to null in createInitialState.
Newer master hydration fills missing nudge keys from the fresh defaults,
so every re-hydrated legacy session picked up nudge.lastInjectedTier=null
and all nine storage-corpus digest pins drifted (folded/twinfile/zstd red
in CI). The sole reader already normalizes via (lastInjectedTier ?? null),
so dropping the initializer is behavior-neutral: absent = never injected =
legacy T1-first, and undefined keys drop out of persisted snapshots.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant