Skip to content

Hasna Service Contract v1#2

Merged
andrei-hasna merged 4 commits into
mainfrom
contract-v1
Jul 6, 2026
Merged

Hasna Service Contract v1#2
andrei-hasna merged 4 commits into
mainfrom
contract-v1

Conversation

@andrei-hasna

Copy link
Copy Markdown
Contributor

Implements the Hasna Service Contract v1 in @hasna/contracts (bump 0.2.2 -> 0.3.0).

Deliverables

  • CONTRACT.md — normative spec: docs tiers (local/self_hosted/cloud); runtime storage enum local|cloud ONLY per Amendment A1 (PURE REMOTE — no sync engine, no cache mode, no hybrid/merge; only sanctioned exception is the todos dual-write SHADOW); remote/hybrid/self_hosted accepted as deprecated cloud aliases; env spec HASNA_<NAME>_STORAGE_MODE + HASNA_<NAME>_DATABASE_URL (+ <NAME>_ aliases); GET /health -> {status,version,mode}, /ready, /version; bins allowlist <name>/<name>-mcp/<name>-serve + extras; sqlite ~/.hasna/<name>/<name>.db; secret ref hasna/oss/<name>/database-url; root docker-compose.yml self-host artifact; repo classes library/cli-with-store/service/saas with per-class ship rules.
  • hasna.service_contract.v1 — Zod schema (ServiceContractManifestSchema) + src/hasna.contract.schema.json JSON Schema (name, class, contractVersion, kitVersion, bins, storage) with class-rule validation. Registered in the schema registry.
  • Conformance kitrunRepoConformance() + contracts repo-conformance CLI: manifest valid, bins allowlist + package.json match, mode-enum compliance, health shape (when serve exists), and no forbidden shared cloud runtimes (reuses scanNoCloudTarget). Dev-dep friendly.
  • src/mode.ts — reference storage-mode normalizer extracted from open-mailery's normalizeMaileryMode, generalized with env resolution.
  • Fixtures + tests/mode.test.ts, tests/service-contract.test.ts, tests/conformance.test.ts.

Verification

bun run verify:release green (typecheck, 83 tests, conformance, build, smoke:dist, pack dry-run). Staged secrets scan clean.

New open-* repos ship FSL-1.1-Apache-2.0 (competing-use restricted,
converts to Apache-2.0 after 2 years); existing repos keep current
license; SaaS/platform stays proprietary. Includes canonical FSL text.
…, conformance kit)

Adds hasna.service_contract.v1 (name/class/contractVersion/kitVersion/bins/storage) with class rules, the reference storage-mode normalizer extracted from open-mailery (local|cloud only per Amendment A1 PURE REMOTE; remote/hybrid/self_hosted as deprecated cloud aliases), env spec (HASNA_<NAME>_STORAGE_MODE/_DATABASE_URL + aliases), health/ready/version shapes, and a repo self-conformance runner reusing the no-cloud guard. Bumps to 0.3.0.
… conformance tests

CONTRACT.md normative spec (docs tiers, PURE REMOTE storage, env spec, health endpoints, bins allowlist, sqlite/secret conventions, repo classes). Root docker-compose.yml self-host artifact and this repo's hasna.contract.json (library). Fixtures + mode/service-contract/conformance test suites; narrows an existing union assertion.
@andrei-hasna
andrei-hasna merged commit 085e4b7 into main Jul 6, 2026
1 check passed
@andrei-hasna

Copy link
Copy Markdown
Contributor Author

Worker review for todos task eef976e6 (2026-07-06): PR #2 is already merged into origin/main via 085e4b7, and PR CI verify passed. Independent/adversarial post-merge review found two residual follow-ups rather than an active merge blocker: (1) CONTRACT.md uses self_hosted for operator Docker/Postgres, which conflicts with current canonical deployment terms where self-hosted means Hasna-owned AWS; tracked as todos task 9a1404df. (2) verify/repo-conformance is not idempotent after ignored dist/ exists; bundled dist scanner declarations trigger no_cloud_guard failures; already tracked as tasks 7e45cbad and 4dc16a85, with fresh repro evidence added to 4dc16a85. Local evidence: bun run verify:release passed once on origin/main 42a1287; then bun test and repo-conformance failed with dist present. No code changes made by this worker.

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