Complete the full planned effort for the detailed ctx.bare code audit and the new ctx.pear surface, delivering the ability to create, stage, and integrate real Pear applications from within a booted Bare OS. ### Audit (ctx.bare) - Performed exhaustive code audit of bare-os-ctx-bare.js (host import path, drive bundle eval + require.addon wrappers, referrer workarounds). - Inventoried all manifest/bundle verifiers and related scripts. - Researched manifest format, implicit tiering model, and dual loading strategy (JSON + .data.mjs). - Deep analysis of the local Holepunch clone (bare-* and pear-* packages) to identify realistic guest vs host-delegate boundaries. - Full cross-reference of call sites, greps, and historical pain points (pear:// referrer resolution, nativeHint handling, addon stubs). ### Implementation (ctx.pear) - Added `pearEntries` tier to bare-module-manifest.json with initial high-value packages (pear-build, pear-bundle, pear-ref, etc.). - Implemented `loadPearModuleManifest()` and `buildPearCtxObjectFromHost()`. - Wired ctx.pear exposure through the booter into the guest context. - Updated TypeScript definitions (`bare-os-ctx.d.ts`). ### User-Facing Surface - Created full `/bin/pear` command with `help`, `info`, `list`, `init` (functional skeleton creation), and improved `stage` subcommands. - Registered as Tier-1 command (now 183 total commands). - Added man page and rebuilt coreutils (kernel + seeder). ### Agent Autonomy - Created production-quality `pear-dev` agent skill. - Added to skill seed list with cross-references to the appstore skill. ### P2P App Store Integration - Updated appstore skill with explicit Pear development synergy section. - Updated p2p-app-store design doc to document the new closed loop. - Added cross-references in both skills and design documents. ### Verification & Hygiene - Created `scripts/verify-pear-module-manifest-data.mjs`. - Enhanced `verify-pear-no-static-node-import.mjs` with explicit pear command coverage. - Integrated new verifier into release-checklist and agent hints. - Performed comprehensive zero-TODO/scaffolding sweep across all new Pear artifacts (clean). - Multiple full verification harness runs (all green). ### Documentation & Governance - Added complete "Pear Development Environment" thread to feature-roadmap.md. - Updated developer guide (Chapter 12). - Maintained living plan document and detailed audit notes with full Implementation Log throughout. - Updated command counts across READMEs and supporting docs. All changes follow project governance: - Bare-only guest constraints strictly observed - Verifier-first discipline maintained - Living plan + audit documents kept as single source of truth - Production quality bar matching the completed P2P App Store feature Plan items 04–21 completed. See: - docs/design/ctx-pear-surface-and-bare-audit-plan.md - docs/audit/ctx-bare-audit-notes.md (full audit + implementation log)
65 lines
2.1 KiB
JavaScript
65 lines
2.1 KiB
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* Verify pear tier entries in the manifest.
|
|
* For the initial shared-manifest approach, validates that pearEntries (if present)
|
|
* has the expected shape and no obvious structural problems.
|
|
*
|
|
* Run from repo root: node scripts/verify-pear-module-manifest-data.mjs
|
|
*/
|
|
|
|
import { readFile } from 'node:fs/promises'
|
|
import { dirname, join } from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
|
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
const root = join(__dirname, '..')
|
|
const manifestPath = join(root, 'packages/bare-os-booter/lib/bare-module-manifest.json')
|
|
|
|
async function main() {
|
|
const raw = await readFile(manifestPath, 'utf8')
|
|
const manifest = JSON.parse(raw)
|
|
|
|
if (!manifest || typeof manifest !== 'object') {
|
|
console.error('[verify-pear-module-manifest-data] invalid manifest root')
|
|
process.exit(1)
|
|
}
|
|
|
|
const pearEntries = manifest.pearEntries
|
|
|
|
if (!pearEntries) {
|
|
console.log('[verify-pear-module-manifest-data] no pearEntries yet (ok for early stages)')
|
|
return
|
|
}
|
|
|
|
if (!Array.isArray(pearEntries)) {
|
|
console.error('[verify-pear-module-manifest-data] pearEntries must be an array')
|
|
process.exit(1)
|
|
}
|
|
|
|
const required = ['ctxKey', 'package']
|
|
for (const [i, ent] of pearEntries.entries()) {
|
|
if (!ent || typeof ent !== 'object') {
|
|
console.error(`[verify-pear-module-manifest-data] entry ${i} is not an object`)
|
|
process.exit(1)
|
|
}
|
|
for (const field of required) {
|
|
if (!ent[field] || typeof ent[field] !== 'string') {
|
|
console.error(`[verify-pear-module-manifest-data] entry ${i} missing or invalid ${field}`)
|
|
process.exit(1)
|
|
}
|
|
}
|
|
// Basic sanity: ctxKey should be camelCase starting with pear or bare for re-exports
|
|
if (!/^[a-z][a-zA-Z0-9]*$/.test(ent.ctxKey)) {
|
|
console.error(`[verify-pear-module-manifest-data] entry ${i} has invalid ctxKey format: ${ent.ctxKey}`)
|
|
process.exit(1)
|
|
}
|
|
}
|
|
|
|
console.log(`[verify-pear-module-manifest-data] ok — ${pearEntries.length} pearEntries`)
|
|
}
|
|
|
|
main().catch((e) => {
|
|
console.error(e)
|
|
process.exit(1)
|
|
})
|