{"id":"@lssm-tech/bundle.workspace","slug":"bundle.workspace","name":"@lssm-tech/bundle.workspace","version":"9.1.3","path":"packages/bundles/workspace","manifestPath":"packages/bundles/workspace/package.json","manifestBlobSha":"317ad5069ca377ed6abc60d572700e16de66e513","layer":"bundles","physicalArea":null,"primaryArea":"tooling-and-agent-delivery","classification":{"privateDeclared":null,"catalogFamily":"solutions","catalogKind":"bundle","catalogStatus":"active","adoptionMode":"adoptable","stability":"stable"},"description":"Workspace utilities for monorepo development","descriptionOrigin":"package.json","catalog":{"family":"solutions","kind":"bundle","status":"active","adoptionMode":"adoptable","stability":"stable","platforms":["server"],"runtimes":["node"],"entrypoints":[".","./maintenance","./cli","./cli/run","./cli/version","./cli/optional-contributions/ai","./cli/optional-contributions/builder","./cli/optional-contributions/examples","./cli/snapshot-client"],"documentation":[{"title":"Bundle Workspace documentation","url":"https://www.npmjs.com/package/%40lssm-tech%2Fbundle.workspace","kind":"readme"}],"examples":[],"replacements":[],"capabilities":[{"id":"package.lssm.tech.bundle.workspace","title":"Bundle Workspace","description":"Workspace utilities for monorepo development","status":"active","useCases":["Adopt workspace utilities for monorepo development"],"aliases":["contractspec","workspace","monorepo","typescript","development","bundle"],"pythonEquivalents":[],"canonicalImports":[{"from":"@lssm-tech/bundle.workspace","symbols":[]},{"from":"@lssm-tech/bundle.workspace/maintenance","symbols":[]}],"constraints":{"platforms":["server"],"runtimes":["node"],"avoidWhen":["The @lssm-tech/bundle.workspace package constraints do not match the target runtime or platform."],"requires":["TypeScript"]},"alternatives":[],"relationships":[],"resolutionPriority":50}]},"canonicalImports":[{"capabilityId":"package.lssm.tech.bundle.workspace","from":"@lssm-tech/bundle.workspace","symbols":[]},{"capabilityId":"package.lssm.tech.bundle.workspace","from":"@lssm-tech/bundle.workspace/maintenance","symbols":[]}],"scripts":{"publish:pkg":"bun publish --tolerate-republish --ignore-scripts --verbose","publish:pkg:canary":"bun publish:pkg --tag canary","build":"contractspec-bun-build build","build:bundle":"contractspec-bun-build transpile","build:types":"contractspec-bun-build types","dev":"contractspec-bun-build dev","clean":"rimraf dist .turbo","lint":"bun lint:fix","lint:fix":"node ../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../scripts/biome.cjs check --write .","lint:check":"node ../../../scripts/biome.cjs check .","test":"bun test --isolate","prebuild":"contractspec-bun-build prebuild","typecheck":"tsgo --noEmit"},"scriptStatus":"complete pinned manifest","dependencies":{"@lssm-tech/lib.typescript-runtime":"workspace:^","@lssm-tech/biome-config":"workspace:^","@lssm-tech/integration.runtime":"workspace:^","@lssm-tech/integration.lssm-os-state-sqlite":"workspace:^","@lssm-tech/integration.provider-github":"workspace:^","@lssm-tech/lib.builder-spec":"workspace:^","@lssm-tech/lib.contracts-integrations":"workspace:^","@lssm-tech/lib.contracts-spec":"workspace:^","@lssm-tech/lib.contractspec-catalog":"workspace:^","@lssm-tech/lib.contractspec-connect":"workspace:^","@lssm-tech/lib.contracts-transformers":"workspace:^","@lssm-tech/lib.crypto-utils":"workspace:^","@lssm-tech/lib.observability":"workspace:^","@lssm-tech/lib.provider-spec":"workspace:^","@lssm-tech/lib.schema":"workspace:^","@lssm-tech/lib.source-extractors":"workspace:^","@lssm-tech/lib.surface-runtime":"workspace:^","@lssm-tech/lib.utils-typescript":"workspace:^","@lssm-tech/module.workspace":"workspace:^","chalk":"^6.0.0","chokidar":"^5.0.0","glob":"catalog:build","js-yaml":"^5.4.0","micromatch":"^4.0.8","ora":"^9.4.1","semver":"^7.8.5","ts-morph":"^28.0.0","zod":"catalog:","@ai-sdk/mistral":"4.0.47","@inquirer/prompts":"^8.7.2","@lssm-tech/agentpack.contractspec":"^2.0.1","@lssm-tech/agentpacks":"^3.0.1","@lssm-tech/integration.harness-runtime":"^2.0.2","@lssm-tech/integration.lssm-os-operation-client":"^2.0.1","@lssm-tech/integration.provider-codex":"^2.0.2","@lssm-tech/integration.provider-opencode-go":"^2.0.2","@lssm-tech/integration.workspace-ai":"^3.1.2","@lssm-tech/lib.builder-runtime":"^3.0.2","@lssm-tech/lib.cli-runtime":"workspace:^","@lssm-tech/lib.contracts-runtime-server-mcp":"^5.0.1","@lssm-tech/lib.design-catalog":"^3.0.1","@lssm-tech/lib.execution-lanes":"^3.1.1","@lssm-tech/lib.harness":"^3.0.1","@lssm-tech/lib.logger":"^5.0.1","@lssm-tech/lib.plugins":"^5.0.1","@lssm-tech/lib.provider-ranking":"^2.0.1","@lssm-tech/lib.testing":"^5.0.2","@lssm-tech/module.ai-chat":"^7.0.2","@modelcontextprotocol/sdk":"^1.30.0","commander":"^15.0.0","jsonc-parser":"^3.3.1","pg":"^8.23.0","@lssm-tech/integration.cli-contractspec-examples":"workspace:^","@lssm-tech/integration.cli-contractspec-ai":"workspace:^","@lssm-tech/integration.cli-contractspec-builder":"workspace:^"},"devDependencies":{"@ai-sdk/anthropic":"catalog:ai","@ai-sdk/openai":"catalog:ai","@electric-sql/pglite":"catalog:data","@lssm-tech/lib.ai-agent":"workspace:*","@lssm-tech/lib.ai-providers":"workspace:*","@lssm-tech/tool.typescript":"workspace:*","@types/bun":"catalog:types","@types/micromatch":"^4.0.10","@types/node":"catalog:types","@types/sarif":"^2.1.7","@types/semver":"^7.8.0","ai":"catalog:ai","ollama-ai-provider-v2":"catalog:ai","typescript":"catalog:","@lssm-tech/tool.bun":"workspace:*"},"peerDependencies":{"@ai-sdk/anthropic":"^4.0.57","@ai-sdk/openai":"^4.0.70","@lssm-tech/lib.ai-agent":"workspace:^","@lssm-tech/lib.ai-providers":"workspace:^","ai":"^7.0.65","ollama-ai-provider-v2":"catalog:ai"},"optionalDependencies":{},"peerDependenciesMeta":{"@ai-sdk/anthropic":{"optional":true},"@ai-sdk/openai":{"optional":true},"@lssm-tech/lib.ai-agent":{"optional":true},"@lssm-tech/lib.ai-providers":{"optional":true},"ai":{"optional":true},"ollama-ai-provider-v2":{"optional":true}},"bundledDependencies":null,"dependencyStatus":"complete pinned manifest","exports":{".":"./src/index.ts","./maintenance":"./src/maintenance.ts","./cli":"./src/cli/index.ts","./cli/run":"./src/cli/run.ts","./cli/version":"./src/cli/program/version.ts","./cli/optional-contributions/ai":"./src/cli/program/optional-contributions/ai.ts","./cli/optional-contributions/builder":"./src/cli/program/optional-contributions/builder.ts","./cli/optional-contributions/examples":"./src/cli/program/optional-contributions/examples.ts","./cli/snapshot-client":"./src/cli/snapshot-client.ts"},"publishExports":{".":{"types":"./dist/index.d.ts","bun":"./dist/index.js","node":"./dist/node/index.js","default":"./dist/index.js"},"./maintenance":{"types":"./dist/maintenance.d.ts","bun":"./dist/maintenance.js","node":"./dist/node/maintenance.js","default":"./dist/maintenance.js"},"./cli":{"types":"./dist/cli/index.d.ts","bun":"./dist/cli/index.js","node":"./dist/node/cli/index.js","default":"./dist/cli/index.js"},"./cli/run":{"types":"./dist/cli/run.d.ts","bun":"./dist/cli/run.js","node":"./dist/node/cli/run.js","default":"./dist/cli/run.js"},"./cli/version":{"types":"./dist/cli/program/version.d.ts","bun":"./dist/cli/program/version.js","node":"./dist/node/cli/program/version.js","default":"./dist/cli/program/version.js"},"./cli/optional-contributions/ai":{"types":"./dist/cli/program/optional-contributions/ai.d.ts","bun":"./dist/cli/program/optional-contributions/ai.js","node":"./dist/node/cli/program/optional-contributions/ai.js","default":"./dist/cli/program/optional-contributions/ai.js"},"./cli/optional-contributions/builder":{"types":"./dist/cli/program/optional-contributions/builder.d.ts","bun":"./dist/cli/program/optional-contributions/builder.js","node":"./dist/node/cli/program/optional-contributions/builder.js","default":"./dist/cli/program/optional-contributions/builder.js"},"./cli/optional-contributions/examples":{"types":"./dist/cli/program/optional-contributions/examples.d.ts","bun":"./dist/cli/program/optional-contributions/examples.js","node":"./dist/node/cli/program/optional-contributions/examples.js","default":"./dist/cli/program/optional-contributions/examples.js"},"./cli/snapshot-client":{"types":"./dist/cli/snapshot-client.d.ts","bun":"./dist/cli/snapshot-client.js","node":"./dist/node/cli/snapshot-client.js","default":"./dist/cli/snapshot-client.js"}},"types":"./dist/index.d.ts","files":["dist","README.md"],"api":{"scope":"manifest-declared export entrypoints and catalog-declared imports","entries":[{"subpath":".","importPath":"@lssm-tech/bundle.workspace","target":"./src/index.ts","targets":[{"conditions":[],"target":"./src/index.ts","sourcePath":"packages/bundles/workspace/src/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/bundles/workspace/src/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./maintenance","importPath":"@lssm-tech/bundle.workspace/maintenance","target":"./src/maintenance.ts","targets":[{"conditions":[],"target":"./src/maintenance.ts","sourcePath":"packages/bundles/workspace/src/maintenance.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/bundles/workspace/src/maintenance.ts","sourceStatus":"verified source file"}]},{"subpath":"./cli","importPath":"@lssm-tech/bundle.workspace/cli","target":"./src/cli/index.ts","targets":[{"conditions":[],"target":"./src/cli/index.ts","sourcePath":"packages/bundles/workspace/src/cli/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/bundles/workspace/src/cli/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./cli/run","importPath":"@lssm-tech/bundle.workspace/cli/run","target":"./src/cli/run.ts","targets":[{"conditions":[],"target":"./src/cli/run.ts","sourcePath":"packages/bundles/workspace/src/cli/run.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/bundles/workspace/src/cli/run.ts","sourceStatus":"verified source file"}]},{"subpath":"./cli/version","importPath":"@lssm-tech/bundle.workspace/cli/version","target":"./src/cli/program/version.ts","targets":[{"conditions":[],"target":"./src/cli/program/version.ts","sourcePath":"packages/bundles/workspace/src/cli/program/version.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/bundles/workspace/src/cli/program/version.ts","sourceStatus":"verified source file"}]},{"subpath":"./cli/optional-contributions/ai","importPath":"@lssm-tech/bundle.workspace/cli/optional-contributions/ai","target":"./src/cli/program/optional-contributions/ai.ts","targets":[{"conditions":[],"target":"./src/cli/program/optional-contributions/ai.ts","sourcePath":"packages/bundles/workspace/src/cli/program/optional-contributions/ai.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/bundles/workspace/src/cli/program/optional-contributions/ai.ts","sourceStatus":"verified source file"}]},{"subpath":"./cli/optional-contributions/builder","importPath":"@lssm-tech/bundle.workspace/cli/optional-contributions/builder","target":"./src/cli/program/optional-contributions/builder.ts","targets":[{"conditions":[],"target":"./src/cli/program/optional-contributions/builder.ts","sourcePath":"packages/bundles/workspace/src/cli/program/optional-contributions/builder.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/bundles/workspace/src/cli/program/optional-contributions/builder.ts","sourceStatus":"verified source file"}]},{"subpath":"./cli/optional-contributions/examples","importPath":"@lssm-tech/bundle.workspace/cli/optional-contributions/examples","target":"./src/cli/program/optional-contributions/examples.ts","targets":[{"conditions":[],"target":"./src/cli/program/optional-contributions/examples.ts","sourcePath":"packages/bundles/workspace/src/cli/program/optional-contributions/examples.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/bundles/workspace/src/cli/program/optional-contributions/examples.ts","sourceStatus":"verified source file"}]},{"subpath":"./cli/snapshot-client","importPath":"@lssm-tech/bundle.workspace/cli/snapshot-client","target":"./src/cli/snapshot-client.ts","targets":[{"conditions":[],"target":"./src/cli/snapshot-client.ts","sourcePath":"packages/bundles/workspace/src/cli/snapshot-client.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/bundles/workspace/src/cli/snapshot-client.ts","sourceStatus":"verified source file"}]}],"entryCount":9,"namedSymbolCoverage":"catalog declarations only; exhaustive TypeScript symbols not extracted","installationStatus":"not verified"},"docsLinks":[{"title":"Bundle Workspace documentation","url":"https://www.npmjs.com/package/%40lssm-tech%2Fbundle.workspace","kind":"readme","pinnedUrl":null,"sourceStatus":"declared link; destination not verified"}],"sourceUrls":{"package":"https://github.com/lssm-tech/contractspec/tree/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/bundles/workspace","manifest":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/bundles/workspace/package.json","readme":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/bundles/workspace/README.md","guide":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/bundle.workspace.txt"},"readme":{"status":"available","body":"# @lssm-tech/bundle.workspace\n\nWebsite: https://contractspec.io\n\n**Core workspace bundle for ContractSpec validation, code generation, and repository setup.**\n\n## What It Provides\n\n- Provides the service layer behind the CLI, editor integrations, drift detection, diagnostics, and setup flows.\n- Retains dependency-free AI ports used to inject optional capabilities.\n- Acts as the main orchestration bundle for repository lifecycle, graph inspection, drift reporting, regeneration planning, and codegen workflows.\n- `src/adapters/` contains runtime, provider, or environment-specific adapters.\n- `src/contracts/` contains contract specs, operations, entities, and registry exports.\n- `src/services/` contains business logic services and workflows.\n- Generative Core orchestration is exposed as `services.generativeCore` for graph artifact persistence, dry-run generation plans, drift reports, and Connect/path policy classification.\n\n## Local capability lookup\n\n`can-help` discovers local package manifests from the root `workspaces` authority\n(array or `workspaces.packages`), including nested foundation/platform/domain groups,\nexplicit bridges, root examples and exclusions. Overlapping patterns are deduplicated;\nundeclared folders and conflicting package identities are not promoted as reusable\nworkspace packages. Classic projects use their root manifest.\n\nCurrent manifest capability IDs, constraints and canonical imports/exports remain\n`workspace` / `workspace-scan` evidence. They do not establish registry publication\nor replace the shipped catalog. Mirrored catalog observations retain their source,\ndegraded warnings and staleness, bound to the exact document including observation\ndates. Legacy embedded mirrors stay explicitly degraded; verified registry or\ninstalled catalog evidence remains distinct from local workspace content. No live authorization\ndecisions are cached.\n\nFor a focused machine-readable result, use\n`contractspec can-help \"@lssm-tech/lib.contracts-spec-core/features\" --scope workspace --limit 1 --json`.\nThe separate published catalog may remain unavailable while the current workspace\nimplementation is discoverable.\n\n## Release file portability\n\nRelease discovery reads Changeset frontmatter with LF or CRLF line endings\nwithout rewriting files. Package bump metadata, summaries and capsule fallback\npackages retain their existing meaning. Lone CR and unrecognized headers remain\nopaque summaries with no parsed package releases; ignored `none` or invalid bump\nrows and filesystem errors preserve their existing behavior. This is local,\ndeterministic parsing and grants no provider or publication authority.\n\nDirect capsule validation and YAML-path repair preserve supplied POSIX absolute paths and\nWindows drive-absolute, UNC or rooted paths. Relative paths, including Windows\ndrive-relative paths, keep the adapter/workspace resolution behavior. Returned\ncapsule and quarantine paths use the adapter's native spelling. Validation remains\nread-only; repair writes still require the existing explicit write option. Selected\nChangeset/capsule paths retain paired owning-workspace slug selection and\ndeduplication; bare repair slugs still select canonical workspace capsules.\n\n## Installation\n\n`npm install @lssm-tech/bundle.workspace`\n\nor\n\n`bun add @lssm-tech/bundle.workspace`\n\nConcrete AI SDKs are optional peers with development mirrors; installing the\nworkspace bundle alone does not force provider SDKs into a consumer lockfile.\nHosts that enable AI behavior must supply compatible implementations through\nthe exported ports.\n\n```bash\nbun add @lssm-tech/integration.workspace-ai\n```\n\nUse `createNodeAiAdapter(config)` from the integration and pass it as the `ai`\noption to `createNodeAdapters`. Concrete agents and prompts are imported from\nthe integration package rather than the workspace bundle root.\n\n## Usage\n\nImport the root entrypoint from `@lssm-tech/bundle.workspace`, or choose a documented subpath when you only need one part of the package surface.\n\n### Self-maintaining API adapters\n\n`@lssm-tech/bundle.workspace/maintenance` composes the module lifecycle with\nproduction-oriented adapters:\n\n- digest-bound OpenAPI, GraphQL, protobuf, SDK-manifest, and changelog source\n  ingestion;\n- signed, declarative, language-scoped migration packs that cannot execute\n  arbitrary provider code; and\n- GitHub App installation authentication, bounded repository snapshots, atomic\n  branch commits, fail-closed check observation, draft pull requests, webhook\n  verification/deduplication, and exact-ref rollback.\n\n`GitHubGovernedChangeAutomationAdapter` supplies the optional V2 ready-for-review\nand native auto-merge port. It re-reads the PR and check runs, requires the exact\nhead SHA, and delegates merge completion to GitHub branch protection; it never\ninvokes the direct merge endpoint. The existing maintenance adapter continues\nto create draft-only PRs.\n\nThe host remains responsible for tenant-to-installation authorization, secret\nresolution, deployment scheduling, policy, and live qualification.\n\n## Architecture\n\n- `src/services/` contains the core use-cases for build, validate, doctor, diff, setup, examples, and CI flows.\n- `src/adapters/` and `src/ports/` isolate filesystem, git, AI, and workspace integration boundaries.\n- `src/maintenance.ts` exposes the self-maintaining API adapter composition.\n- AI-facing services depend on workspace ports; concrete provider selection is\n  an optional host concern.\n- `src/templates/`, `src/contracts/`, `src/formatters/`, `src.types/`, and `src.utils/` support generated outputs and reporting.\n- `src/index.ts` is the root public barrel and package entrypoint.\n- `src/types.ts` is shared public type definitions.\n\n## Generative Core Responsibilities\n\n- Compose discovery, graph-building, artifact persistence, drift classification, and regeneration-plan services behind ports/adapters.\n- Keep graph and drift operations deterministic and JSON-schema-versioned so CLI, CI, Builder, and coding agents can replay evidence.\n- Enforce preview-first generation: generated writes require provenance hashes and manual-edit guards; protected/apply paths require Connect verification before mutation.\n- Keep Connect impact and drift verification read-only: temporary generation must override every configured docs/runtime output root and must never materialize handlers into the consumer workspace.\n\n## Public Entry Points\n\n- Root bundle export with namespaced services, adapters, ports, formatters, templates, contracts, AI helpers, and utilities.\n- `services.generativeCore` exposes guarded JSON-artifact helpers for `generated/contractspec/graphs/**`, `generated/contractspec/generation/**`, and `generated/contractspec/drift/**`; dry-run planning remains the default for mutation workflows.\n- Export `.` resolves through `./src/index.ts`.\n- Export `./maintenance` resolves through `./src/maintenance.ts`.\n- Environment templates can generate root and app-target `.env.example` content from the shared logical environment contract while preserving per-framework aliases such as `NEXT_PUBLIC_*` and `EXPO_PUBLIC_*`.\n\n## Local Commands\n\n- `bun run dev` — contractspec-bun-build dev\n- `bun run build` — contractspec-bun-build build\n- `bun run test` — bun test --isolate\n- `bun run lint` — bun lint:fix\n- `bun run lint:check` — biome check .\n- `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .\n- `bun run typecheck` — tsgo --noEmit\n- `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose\n- `bun run publish:pkg:canary` — bun publish:pkg --tag canary\n- `bun run clean` — rimraf dist .turbo\n- `bun run build:bundle` — contractspec-bun-build transpile\n- `bun run build:types` — contractspec-bun-build types\n- `bun run prebuild` — contractspec-bun-build prebuild\n\n## Recent Updates\n\n- Share one semver-accurate compatibility plan across Update and Doctor, with Expo SDK evidence, registry provenance, sticky prerelease channels, peer widening, and deterministic rollback waves.\n- Replace eslint+prettier by biomejs to optimize speed.\n- Add table capabilities.\n- Stability.\n- Package exports.\n- Add latest models and align defaults.\n- Standardize tool naming to underscore notation.\n- Add signed source/codemod and GitHub App adapters for self-maintaining APIs.\n\n## Notes\n\n- Largest bundle in the monorepo (~280 source files); prefer editing existing services over adding new top-level directories.\n- Adapters must implement port interfaces; no direct infrastructure calls from services.\n- AI agent definitions must stay provider-agnostic via the `ai` SDK abstraction.\n- Template changes affect generated code across all consumers; test thoroughly.\n\n### Builder delivery draft storage\n\nLoop IDs are portable single components: 1–128 letters, digits, underscores or\nhyphens, beginning with a letter or digit. Reserved Windows device names and\npath-like IDs are rejected before I/O.\nExisting malformed or mismatched records now fail instead of being treated as\nmissing; restore a verified record before retrying. Missing ledgers cannot restart\nan existing loop at `release_ready`, and malformed idempotency records cannot\nsilently forget earlier effects.\n\nThis filesystem adapter remains workspace-local draft storage. It is not an\natomic multi-writer ledger or a tenant isolation boundary against local filesystem\nwriters. Production admission, durable approval/receipt persistence and provider\nreconciliation require the authoritative runtime composition.\n\nDraft evidence append persists primary and related references in the loop artifact\ncatalog without rewriting its transition ledger. Exact retries reuse stable IDs;\nrestarting the service retains the references. Entries are labeled unverified and\ndo not create acceptance verdicts, approvals or permission grants. Hosts with a\ncustom storage adapter may supply the optional `updateLoop` method; without it,\nevidence append fails explicitly. The adapter remains single-writer.\n\nProduction mode rejects the local simulated approval, receipt, transition and\nhandoff operations. Authoritative production operations must be composed through\nConnect and Runtime Nodes before enabling shipping in a host.\n\nSimulation receipt recording persists a loop/key-bound draft record before\nreturning success. Exact retries replay it; changed actor, outcome or payload\nunder the same key is rejected. Draft IDs are explicitly prefixed `draft_` and no\nledger transition is claimed. These records use single-writer local storage and\nare not provider execution evidence. Handoff preview remains blocked until a\nverified receipt/replay resolver is composed; it never invents those references.\n\nThe root build targets Node-compatible server execution (including Bun). It\nrequires filesystem, process, or native compiler facilities and does not advertise\na browser export condition. Browser applications should use the relevant\nbrowser-safe contracts or UI entry points instead of importing this server root.\n\nTests isolate each file so Connect service mocks cannot replace spec discovery\nin the contract-first policy checks run by other files.\n\nExact duplicate workspace identities are blocking conflicts: their package and\nimport-subpath lookup cannot fall back to an older catalog entry. Distinct\nprefix-suffix package identities remain independent; `./` workspace patterns\nand exclusions normalize to the same authority as unprefixed patterns.\n# CLI composition\n\n`./cli` owns the existing reusable ContractSpec command composition. Delivery\nhosts retain bootstrap, blueprint and version glue; registry distributions call\n`./cli` with their explicit snapshot bindings. `./cli/run` remains an executable\nentry for hosts that need no optional snapshot supplier. Optional AI, Builder and\nexamples registrations remain lazy and are bound to the exact Commander program\nthrough `@lssm-tech/lib.cli-runtime`. Their handlers are canonical here rather\nthan copied into integrations or imported from a delivery host.\n\n`contractspec.cliRuntime.version` retains the original CLI version fallback for\nregistry wrappers. Release updates must keep it aligned with the CLI distribution\nversion; the existing explicit `CONTRACTSPEC_CLI_VERSION` override still wins.\nThe app's original program construction signatures remain compatibility wrappers.\n\nGolden traffic generation accepts an explicit typed synchronous or asynchronous\nsnapshot-client factory. The app host retains its original optional database\nmodule lookup, deferred until the production-snapshot action is selected. Registry\nhosts bind their same original lookup through `./cli/snapshot-client`; the shared\nhelper accepts a host loader and never imports a database app itself.\nThe old database CLI lookup requested a factory absent from the current source.\nNo production snapshot adapter is supplied here; without a binding the existing\nwarning and no-output behavior remain. Injecting an adapter does not grant\ndatabase or production authority.\n\nThe bundle prebuild owns offline MCP knowledge regeneration. App prebuild keeps\nits contract-source schema generation; registry consumers build the same owning\nbundle rather than relying on a previously generated app artifact.\n\n## Connect host hook authority\n\n`connect hook ...` host hooks (`--host claudecode|codex|cursor`) run through the\ndedicated entry `src/cli/connect-hook-run.ts`. Durable authority for governed host\nedits comes from an explicit local operator grant:\n`contractspec connect hook authority grant --path <prefix/> [--command <cmd>]\n[--ttl <minutes>] [--host-session <id>] --confirm-workspace <root>` (interactive\nterminal only), with `revoke` and `status`. The grant signs a one-shot Hook\nAuthority V1 decision bound to the workspace root and current HEAD, starts its\nsession in the `@lssm-tech/integration.lssm-os-state-sqlite` adapter under the\ngitignored `.contractspec/connect/hook-authority/`, and keeps only the public key\nand the session capability there. When that store exists, before-file-edit,\nafter-file-edit and before-shell-execution commit a V1 transition before Connect\npolicy; revoked, expired, other-workspace or other-session grants deny. The grant\nfollows the agent's own commits on its branch while every commit since the grant\nstays inside its prefixes and leaves hook, autonomy and grant control files alone\n(`--pin-head` binds one commit); a HEAD that left the grant denies. Lifecycle\nauthority V1 (`@lssm-tech/lib.contractspec-connect/lifecycle-authority`) lets the\ngrant establish session-start, stop and handoff without ever ending it; merge is\nnever delegated. Hooks deny agent tool calls that run the grant command or touch\nthe store. Without an active grant the recorded exception\n`connect-hook-authority-port-unwired` keeps the ask / Codex warning path.\n\n## Connect host hooks and run modes\n\nThis bundle owns `contractspec connect hook` and `contractspec connect mode`.\n\n- While no operator hook authority grant exists, hooks evaluate Connect policy first;\n  policy deny and rewrite always block. The run mode then decides instead of a\n  blanket ask.\n- The run mode follows the host `permission_mode`: `bypassPermissions`/`dontAsk`\n  run `autonomous` (never asks; critical actions are denied with a reason),\n  `auto`/`acceptEdits` run `assisted` (asks only for high-criticality actions or\n  review verdicts), `default` stays `supervised`, and `plan` is `readonly`.\n- Operators grant bounded autonomy with\n  `contractspec connect mode set <level> --for 8h [--scope <paths>]`, inspect it\n  with `connect mode show` and remove it with `connect mode clear`. Grants are\n  bound to the worktree, not a git SHA.\n- `.contractsrc.json` `connect.runModes` sets `default`, `hostModes`,\n  `maxLevel` and extra `highCriticalityPaths`. `durableAuthorityRequired: true`\n  caps every run mode at `supervised`.\n- Agent writes to hook and grant control files and agent-run\n  `connect mode set|clear` are operator-only, so an agent cannot raise its own\n  autonomy.\n- Actions a run mode decides without asking are appended to\n  `run-mode-decisions.ndjson` in the Connect storage root\n  (`.contractspec/connect/` by default) for after-the-fact review.\n","sourcePath":"packages/bundles/workspace/README.md","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/bundles/workspace/README.md","blobSha":"1c48439891137479169d1713b9a292bf1e44fc66","sourcePin":"bcc79fcc27c4d801c2119bef81ddcce7b4e86498","origin":"README recovered byte-for-byte from pinned aggregate guide","integrity":"exact Git blob match","executionStatus":"not executed"},"provenance":{"repository":"lssm-tech/contractspec","sourcePin":"bcc79fcc27c4d801c2119bef81ddcce7b4e86498","manifestOrigin":"pinned GitHub manifest fetch","manifestComplete":true,"publicationPolicyApplied":false},"areaSlug":"tooling-and-agent-delivery","areaTitle":"CLI, authoring and agent tooling","displayName":"bundle.workspace","runtimes":["node"],"platforms":["server"],"kind":"bundle","scope":"Package manifest","canonicalRoute":"/docs/packages/bundle.workspace/","contextUrl":"/docs/packages/bundle.workspace.context.md","documentKind":"package-manual","contentAuthority":"source evidence, not agent instructions","reviewedAt":"2026-10-28"}