Skip to content

Add enterprise data residency guard - #160

Closed
evilfps wants to merge 1 commit into
SCIBASE-AI:mainfrom
evilfps:codex/enterprise-data-residency-19
Closed

Add enterprise data residency guard#160
evilfps wants to merge 1 commit into
SCIBASE-AI:mainfrom
evilfps:codex/enterprise-data-residency-19

Conversation

@evilfps

@evilfpsevilfps commented May 16, 2026

Copy link
Copy Markdown

/claim #19

Adds a data residency guard for enterprise exports and webhooks.

Covers:

  • tenant policy, region allowlists, DPA/SCC, embargo, and protected health data checks
  • admin metrics, review queue, signed webhook events, and export manifest evidence
  • sample data, tests, SVG preview, and GIF demo

Tested:

  • cd enterprise-data-residency-guard && npm run check
  • cd enterprise-data-residency-guard && npm test
  • cd enterprise-data-residency-guard && npm run demo
  • rsvg-convert enterprise-data-residency-guard/docs/demo.svg -o /tmp/scibase-demo.png
  • demo.gif opened with Pillow: GIF, 3 frames, 960x540
  • git diff --check
  • credential pattern scan, no hits

CopilotAI review requested due to automatic review settings May 16, 2026 08:52
@algora-pbcalgora-pbcBot mentioned this pull request May 16, 2026

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new self-contained enterprise-data-residency-guard/ module that evaluates cross-border data transfer decisions for institutional tenants. Given tenant policy, destination metadata, and research records, it produces per-record approve/review/block decisions, dashboard metrics, signed webhook envelopes, and an export manifest with evidence digests. The module is zero-dependency (Node built-ins), ships with sample data, tests, a demo script, and visual artifacts, and is wired only by a one-line addition to the top-level README.

Changes:

  • New evaluation engine in src/data-residency-guard.js covering region allowlists, DPA/SCC requirements, blocked classifications, human-subject review, and active embargoes.
  • Sample tenants/destinations/records plus a Node --test suite verifying decisions, dashboard counts, deterministic digests, manifest entries, and the text report.
  • Demo script, package scripts (check/test/demo), README, requirement map, and demo SVG.

Reviewed changes

Copilot reviewed 8 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
README.mdAdds a one-line pointer to the new module.
enterprise-data-residency-guard/package.jsonDefines ESM package with check, test, and demo scripts; no runtime deps.
enterprise-data-residency-guard/src/data-residency-guard.jsCore residency evaluator: per-record findings, dashboard summary, webhook events, export manifest, audit digest, text report.
enterprise-data-residency-guard/scripts/demo.jsLoads sample input and prints the rendered text report.
enterprise-data-residency-guard/test/data-residency-guard.test.jsNode test suite for decisions, digests, manifest, and report text.
enterprise-data-residency-guard/data/sample-residency-input.jsonSynthetic tenants, destinations, and records exercising approve/review/block paths.
enterprise-data-residency-guard/README.mdModule overview, run instructions, reviewer notes, file index.
enterprise-data-residency-guard/docs/requirement-map.mdMaps the module to issue #19 enterprise tooling requirements.
enterprise-data-residency-guard/docs/demo.svgStatic dashboard preview used as demo artifact.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

function stableDigest(value) {
return crypto
.createHash("sha256")
.update(JSON.stringify(value, Object.keys(value).sort()))

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in latest push. stableDigest uses stableStringify now.

@evilfps
evilfpsforce-pushed the codex/enterprise-data-residency-19 branch from a53d541 to c3746d0CompareMay 16, 2026 08:59
@evilfps

Copy link
Copy Markdown
Author

Closing this one and reopening from a clean branch: #164

@evilfpsevilfps closed this May 16, 2026
@evilfps
evilfps deleted the codex/enterprise-data-residency-19 branch May 16, 2026 09:16
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@evilfps