{"id":50144991,"url":"https://github.com/vim89/proof-gate","last_synced_at":"2026-05-24T03:33:58.700Z","repository":{"id":357549724,"uuid":"1237049478","full_name":"vim89/proof-gate","owner":"vim89","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-13T14:29:20.000Z","size":109,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-24T03:33:56.922Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vim89.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-12T20:34:12.000Z","updated_at":"2026-05-13T14:57:37.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/vim89/proof-gate","commit_stats":null,"previous_names":["vim89/proof-gate"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vim89/proof-gate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vim89%2Fproof-gate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vim89%2Fproof-gate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vim89%2Fproof-gate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vim89%2Fproof-gate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vim89","download_url":"https://codeload.github.com/vim89/proof-gate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vim89%2Fproof-gate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33420660,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T22:14:44.296Z","status":"online","status_checked_at":"2026-05-24T02:00:06.296Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-24T03:33:58.483Z","updated_at":"2026-05-24T03:33:58.690Z","avatar_url":"https://github.com/vim89.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ProofGate\n\nNice try, LLM. Now prove it.\n\nProofGate is a Scala-native review conveyor for LLM-written data-pipeline code.\nThe core idea is simple:\n\n1. proposal\n2. proof\n3. policy\n4. pin\n5. people\n\nThe first reviewer should be machine-enforced structure, not a human and not another LLM.\nAfter those gates pass, review is AI and human, not AI or human.\n\n## Review flow\n\n```mermaid\nflowchart LR\n  A[LLM draft] --\u003e B[proposal]\n  B --\u003e C[proof\u003cbr/\u003emacros inline typestate]\n  C --\u003e D[policy\u003cbr/\u003eScalafix rules]\n  D --\u003e E[pin\u003cbr/\u003eruntime sink checks]\n  E --\u003e F[people\u003cbr/\u003eAI and human review]\n\n  C -. fail .-\u003e X[reject early]\n  D -. fail .-\u003e X\n  E -. fail .-\u003e X\n```\n\n## Current stack\n\nThis repository currently targets the stable stack:\n\n- JDK `21`\n- Scala `3.8.3`\n- sbt `1.12.11`\n- Scalafmt `3.11.1`\n- Scalafix / sbt-scalafix `0.14.6`\n- MUnit `1.3.0`\n\n## Design notes\n\n- [ADR 0001: review conveyor](docs/adr/0001-review-conveyor.md)\n\n## Module layout\n\n- `modules/model`: core ADTs, typed errors, report model\n- `modules/proof`: proposal DSL, typestate builder, `SchemaConforms` proof policies\n- `modules/runtime-spark`: runtime shape derivation, sink-boundary pin checks, Spark schema adapter\n- `modules/cli`: CLI entry point\n- `modules/examples`: tiny usage examples\n- `modules/fixtures-compile-fail`: reference snippets for compile-fail demos\n- `modules/fixtures-policy-fail`: deliberate violations that Scalafix must reject;\n  not aggregated by the root project, run on demand via `scripts/check-policy-fixtures.sh`\n\n## Commands\n\n```bash\nsbt test\nsbt reviewGates\nsbt reviewPolicy\nsbt reviewConveyor\nscripts/check-policy-fixtures.sh\nsbt \"cli / runMain proofgate.cli.Main review --revision abc123 --out target/proof-gate-review.md\"\nsbt \"cli / runMain proofgate.cli.Main review --revision abc123 --out target/proof-gate-review.json\"\n```\n\nThe GitHub Actions workflow runs the same conveyor and publishes the generated Markdown report to the job summary.\n\nExample rejecting review packet:\n\n```bash\nsbt \"cli / runMain proofgate.cli.Main review --revision abc123 --finding proof|blocker|proof.schema-exact|Missing_customer_id|pipelines/orders.scala|Add_the_field\"\n```\n\n## Policy fixtures\n\n`reviewPolicy` uses Scalafix `DisableSyntax` rules to reject selected forbidden patterns in core code.\nThe expected-failure fixtures prove that these patterns are blocked:\n\n- direct `sys.env`\n- direct `System.getenv`\n- direct `ConfigFactory`\n- raw `try` / `catch`\n- raw `throw`\n- raw `require`\n\n## Schema policies\n\n`SchemaConforms[Out, Contract, Policy]` is the compile-time evidence the proof layer requires.\n\n- `SchemaPolicy.Exact`: unordered by name, case-insensitive, same field set, types, and nesting.\n  Field-level nullability is ignored; nested optionality inside arrays and maps is still checked.\n- `SchemaPolicy.ExactUnorderedCI`: explicit alias for unordered case-insensitive exact matching.\n- `SchemaPolicy.ExactOrdered`: ordered by field name, case-sensitive.\n- `SchemaPolicy.ExactOrderedCI`: ordered by field name, case-insensitive.\n- `SchemaPolicy.ExactByPosition`: ordered by position only; field names are ignored.\n- `SchemaPolicy.Backward`: `Out` may add fields beyond `Contract`. Required `Contract`\n  fields must still exist in `Out` with the declared type. Missing optional `Contract`\n  fields and missing fields with defaults are accepted. Old consumers reading `Contract`\n  keep working when the producer adds fields.\n- `SchemaPolicy.Forward`: `Out` may drop fields that `Contract` declares. Extra fields\n  in `Out` and type drift still fail. Old producers stay compatible with new consumers\n  that have widened the contract.\n- `SchemaPolicy.Full`: escape hatch for demo and migration paths; compile-time and runtime\n  structural checks accept the shape.\n\nThese names intentionally mirror `compile-time-data-contracts`. ProofGate keeps the same policy\nvocabulary so the talk can show a clean migration from the earlier proof asset into the review\nconveyor.\n\n## Spark bridge\n\n`SparkSchemaAdapter` converts real Spark `StructType` values into a `RuntimeShape`.\nThe adapter preserves nested struct nullability, array `containsNull`, map `valueContainsNull`,\nand `ctdc.hasDefault` metadata:\n\n```scala\nval shape = SparkSchemaAdapter.fromStructType(dataset.schema)\n```\n\nFor thin integration boundaries, callers can still pass a small DTO:\n\n```scala\nval info = structType.fields.map(f =\u003e\n  SparkFieldInfo(f.name, f.dataType.simpleString, f.nullable)\n).toVector\n\nval shape = SparkSchemaAdapter.fromSparkFields(info)\n```\n\nThe DTO path understands Spark primitive types, `array\u003cT\u003e`, `map\u003cK,V\u003e`, and nested `struct\u003c...\u003e`\nexpressions, but Spark `simpleString` does not carry nested struct nullability. Use\n`fromStructType` when runtime parity matters.\n\nSee [docs/spark-bridge.md](docs/spark-bridge.md) for an end-to-end recipe, including the\n`Dataset[A] =\u003e RuntimeShape` helper and a sink-time validate call.\n\n## Status\n\nThis is an early POC scaffold.\nThe current code proves the build, module wiring, typed-error model, typestate assembly,\nthe full compile-time policy vocabulary from `compile-time-data-contracts`, an in-memory\nruntime shape pin with matching policy entry points, a Spark schema bridge, and a CI-friendly\nMarkdown and JSON review report path.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvim89%2Fproof-gate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvim89%2Fproof-gate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvim89%2Fproof-gate/lists"}