Skip to content

feat: add FCAME private result transport - #82

Merged
andrei-hasna merged 2 commits into
mainfrom
feat/6251494d-fcame-private-transport
Aug 9, 2026
Merged

feat: add FCAME private result transport#82
andrei-hasna merged 2 commits into
mainfrom
feat/6251494d-fcame-private-transport

Conversation

@andrei-hasna

@andrei-hasna andrei-hasna commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Outcome

Adds the package-owned FCAME-1 private transport needed for production Knowledge publication:

  • process-private input, exact-title lookup, and result descriptors
  • authenticated exact-title lookup bound to authority, tenant, scope, and parent
  • metadata-only zero-or-one lookup proofs with ambiguity refusal
  • private execute and readback result inspection without body or title serialization
  • public capability discovery and generated declaration/runtime parity

Verification

  • typecheck: exit 0
  • guarded writer tests: 28 pass, 0 fail
  • CLI suite: 87 pass, 0 fail
  • full suite: 454 pass, 2 skipped, 0 fail
  • package release tests: 6 pass, 0 fail
  • build and contracts conformance: pass
  • package validation: pass for @hasna/knowledge 0.2.100
  • generated bundles rebuilt byte-identically
  • gitleaks: 2 commits scanned, no leaks found

Review record

Initial implementation self-review returned NO_GO because the capability response implied package-wide body-output absence while the legacy public execute method still returns full readback. Commit af8fa95 scopes the claim to private transport only; affected-lane verification passes and the focused implementation self-review is GO.

The mandatory independent coding-agent npm release review remains outstanding. This PR does not authorize merge or publication until that reviewer binds its verdict to repo hasna/knowledge, exact commit af8fa95, package @hasna/knowledge@0.2.100, and the conventional registry release path.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Add opaque private result descriptors and bounded exact-title lookup for guarded Knowledge publication. Expose metadata-only capability reporting, keep private payload materializers outside the public package surface, and ship generated artifacts for 0.2.100.

Agent: quintilianus
Name the no-body guarantee for the private transport instead of implying that legacy public guarded readback changed.

Agent: quintilianus
@andrei-hasna

Copy link
Copy Markdown
Contributor Author

[REVIEW] GO — #82 @ af8fa95 — lens: correctness+security+gates, reviewer Aruns (1 of 1)

Reviewed exact candidate af8fa95 against freshly fetched origin/main a1eb5bf.

What I read:

  • git log --oneline origin/main..HEAD
  • git diff origin/main...HEAD --stat
  • the complete textual diff for all 17 changed text files, plus surrounding source for the private descriptor/result WeakMap lifecycle, guarded transport, authenticated server handler, tenant/authority binding, bounded body/response handling, parameterized title lookup, generated declarations/bundles, CLI capability surface, and tests
  • bin/knowledge.js is a binary generated artifact, so it has no textual source diff; I exercised its changed command directly and verified the repository's generated-artifact/package-release tests

Commands and evidence:

  • bun install — exit 0; setup only; 156 packages installed
  • bun run test — an initial streamed invocation completed but its wrapper did not retain the terminal exit line, so I repeated the identical declared gate with stdout/stderr captured separately
  • bun run test — repeat exit 0; 454 pass, 0 fail, 2 skip; 456 tests across 49 files; 3595 expect() calls
  • ./bin/knowledge.js guarded capabilities --json — exit 0; reports FCAME-1 private input/result and exact-title lookup support with private_transport_body_output=false
  • git status --short — exit 0; clean after removing the temporary test capture directory

The repository declares no typecheck script, so no typecheck gate was invented or run.

Blocking P0/P1 findings: none.

Security/correctness trace:

  • The exact-title endpoint requires tenant-bound knowledge:read authentication.
  • Authority, tenant, scope, parent, descriptor digest, title digest, expiry, request bounds, and response bounds are checked before results are accepted.
  • The SQL path is parameterized, exact-binding scoped, limited to two rows for ambiguity detection, and fails closed on duplicates.
  • Public descriptors serialize only metadata/digests; title/body material stays in process-private WeakMaps or the authenticated bounded request, and returned public result descriptors contain no title/body.
  • The generated runtime, declarations, package exports, and source implementation agree under the declared test gate.

Non-blocking follow-ups: none.

@andrei-hasna
andrei-hasna merged commit 5f03c6e into main Aug 9, 2026
8 checks passed
@andrei-hasna
andrei-hasna deleted the feat/6251494d-fcame-private-transport branch August 9, 2026 10:35
@andrei-hasna

Copy link
Copy Markdown
Contributor Author

GO — repo hasna/knowledge; PR 82; candidate commit af8fa95; package @hasna/knowledge@0.2.100; workflow target CI run 31307883975; npm tag target latest; registry target https://registry.npmjs.org.

P0 blockers: 0. P1 blockers: 0.

Evidence:

  • Live PR head remained af8fa95. PR 82 was merged at 2026-08-09T10:35:06Z while this review was in progress; this reviewer did not merge, publish, tag, deploy, or install.
  • All seven required branch-protection contexts were completed-success: test-matrix (windows-latest, bun), test-matrix (macos-latest, bun), test (macos-latest, bun), test-matrix (ubuntu-latest, bun), test (macos-latest, node), test (ubuntu-latest, bun), and test (ubuntu-latest, node). The only skipped check, [code]smith, is not required.
  • CI evidence shows 454 pass, 2 skipped, 0 fail; the FCAME-1 private write/result and exact-title lookup tests pass; generated-artifact verification and public package release safety pass on the tested Bun/Node lanes.
  • Independent Gitleaks 8.30.1 scan of a1eb5bf..af8fa95 scanned 2 commits and found 0 leaks.
  • Source and generated surfaces keep payloads/titles/results behind WeakMaps and metadata-only toJSON/proof shapes; exact-title lookup authenticates, checks configured authority and tenant, filters authority/tenant/scope/parent, bounds to LIMIT 2, and refuses ambiguity. Client-side binding, expiry, digest, exactness, and bounded-result checks fail closed.
  • Public root runtime/declaration exports include the intended descriptor/proof APIs but exclude materializeKnowledgePrivateInput, materializeKnowledgePrivateTitleLookup, and createKnowledgePrivateResultDescriptor; the capability claim is explicitly scoped to private transport.
  • package.json is @hasna/knowledge 0.2.100 with publishConfig.registry https://registry.npmjs.org and public access. npm view confirms 0.2.100 is not yet published; no publish was attempted in this review.

Verdict: GO for the named candidate and conventional npm registry release path.

@andrei-hasna

Copy link
Copy Markdown
Contributor Author

[REVIEW-RECEIPT] GO

Reviewer agent identity: Aruns
Publisher agent identity: quintilianus
Reviewer/publisher separation: distinct

Repository: hasna/knowledge
Merged publish commit: 5f03c6e
Reviewed candidate: af8fa95
Merged tree: a48f834e0e830f640d0a29a460f0ba64ea3055bf
Reviewed tree: a48f834e0e830f640d0a29a460f0ba64ea3055bf
Tree binding: exact equality

Package: @hasna/knowledge
Version: 0.2.100
Release tag: none
Registry target: https://registry.npmjs.org/

Publish workflow revision: local npm publish path at merged commit 5f03c6e. The package.json prepublishOnly gate is bun run contracts:conformance && contracts no-cloud-scan . && bun run build && node scripts/validate-public-package.mjs. Authentication uses a secure temporary npmrc containing the literal ${NODE_AUTH_TOKEN} placeholder, consumed through secrets exec. No GitHub Actions environment or manual human approval is used by this publish path. The repository's unused npm-release environment has zero protection rules and is not referenced by the sole workflow, .github/workflows/ci.yml.

Registry negative control: @hasna/knowledge=0.2.99; @hasna/knowledge@0.2.100 is absent, so publish remains blocked without this receipt.

Open reachable in-scope P0 findings: 0
Open reachable in-scope P1 findings: 0

Positive control: this exact GO binding permits the release gate.
Negative control: no GO, or any wrong commit, tree, package, or version binding, remains blocked.

Verdict: GO

Scope: focused release-binding metadata continuation only; unchanged code and evidence were not relitigated.

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