Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/build-contract-shell.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Wraps the Dhall-generated package (from tests/Exhaustive.dhall) in a minimal
# Wraps the Dhall-generated package (from demos/Exhaustive.dhall) in a minimal
# consumer shell, mirroring the hand-written tests/golden/ shell (pyproject.toml
# + py.typed) so basedpyright strict runs against the same layout a real
# consumer would import, per the full_package pattern in tests/conftest.py.
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
with:
ref: ${{ inputs.ref || github.sha }}

# The `as Source` import mode on gen/Deps only changes how pgn loads the
# The `as Source` import mode on src/Deps only changes how pgn loads the
# remote packages (unnormalized, to save RAM), not what they evaluate to.
# The pinned action below bundles a dhall fork that predates the mode, so
# strip it here; the evaluation is semantically identical either way. The
Expand All @@ -132,16 +132,16 @@ jobs:
shell: bash
run: |
set -euo pipefail
sed -i -e 's/^[[:space:]]*as Source$//' -e 's/^[[:space:]]*sha256:[0-9a-f]\{64\}$//' gen/Deps/*.dhall
sed -i -e 's/^[[:space:]]*as Source$//' -e 's/^[[:space:]]*sha256:[0-9a-f]\{64\}$//' src/Deps/*.dhall

# A plain, standard-Dhall evaluator cannot run this: gen/Interpreters/Project.dhall's
# A plain, standard-Dhall evaluator cannot run this: src/Interpreters/Project.dhall's
# buildLookup and gen-sdk's own Fixtures.Exhaustive both use Text/equal, a builtin
# from pgn's forked Dhall, absent from the upstream dhall-lang Prelude. This action
# bundles that same fork.
- name: Generate output from Dhall
uses: nikita-volkov/dhall-directory-tree.github-action@60a18dc647d6daea805263ea0fed7bb8011f3bcd # v2
with:
dhall_file: tests/Exhaustive.dhall
dhall_file: demos/Exhaustive.dhall
output_dir: contract-output

- name: Assert the compile did not fail
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
id: resolve
uses: nikita-volkov/dhall-resolve.github-action@7caaf1fdb40ac864bc02e37575f577ee084713a8 # v3
with:
file: gen/Gen.dhall
file: src/package.dhall
minify: true

- name: Prepare changelog for release
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ already says.

## Dhall

`gen/` pins its remote imports by sha256 (`gen/Deps/*.dhall`). Bump those
`src/` pins its remote imports by sha256 (`src/Deps/*.dhall`). Bump those
deliberately, one at a time, and re-run the harness before committing a pin
change.
52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,57 @@
# Upcoming

- `buildLookup` (`Interpreters/Project.dhall`) and, with it, this generator's
last dependency on pgn's fork-only `Text/equal` builtin are removed from
`src/`: custom-type decode/encode now dispatches through named
`_decode`/`_encode` methods generated onto each custom type's own Python
class (`CompositeModule.dhall`/`EnumModule.dhall`), called by name from
every reference site, instead of resolving classification and fields via a
project-wide structural search (`grep -rn "Text/equal" src` now returns
only two explanatory comments, zero invocations). Array (dims > 0)
decode/encode is built at the call site (`Member.dhall`/
`ParamsMember.dhall`) instead of a third per-type method, delegating only
the per-element transform to `_decode`/`_encode`: an earlier draft this
session added a per-type `_decode_array` to `EnumModule.dhall`, but it
could not express `elementIsNullable` (a per-column fact, not a per-type
one) and silently broke nullable-element enum-array decode and
enum-array param encode — both working, corpus-exercised paths — caught
by the final whole-branch review and fixed before merge. Behavior change:
because the call site is now kind-uniform, a 1-D composite-array column
or param is no longer rejected at Dhall-generation time the way it used
to be, and — unlike the `_decode_array` design it replaces — no longer
depends on `basedpyright strict` catching a missing method either, since
`_decode`/`_encode` genuinely exist on a composite class too. **This path
has not been exercised against real Postgres, and `tests/golden/` has NOT
been regenerated for this change this session** — the composite-array
fixture addition, its golden regeneration, and confirming actual Postgres
round-trip behavior are a known, deliberate gap in this commit, deferred
to a follow-up pass on a properly provisioned machine (see
`docs/plans/2026-07-11-reusable-custom-type-codecs.md`).
Separately, a composite field nesting another custom type is *also* no
longer rejected at generation time: the `nestedLookup = Absent` stub that
used to force it down the same loud-fail path is gone (it only existed
to satisfy `Member.run`'s old signature). This is not the same kind of
change as the composite-array case above, though — `CompositeModule.dhall`'s
`_decode`/`_encode` still do a blind flat `cast(tuple[...], src)`/splat,
unchanged by this refactor, and never recurse into the nested type's own
codec, so the field silently decodes/encodes wrong rather than being
caught by a type checker. Because the failure mode is `cast()`, which
suppresses type-checking on its argument by design, this is **not**
expected to be caught by `basedpyright strict`. It is a real, silent
architecture gap, flagged here as an open follow-up design question, not
a shipped or backstopped behavior change.
- Migrated the generator's internal dependencies to `gen-contract` v4.0.1
and `gen-sdk` v2.0.0, adopting `Sdk.Sigs` in place of the local
`Algebras/` module, and restructured the repository layout to match the
pGenie generator architecture: implementation moved from `gen/` to
`src/`, the public entry point renamed from `gen/Gen.dhall` to
`src/package.dhall`, and the fixture driver moved from
`tests/Exhaustive.dhall` to `demos/Exhaustive.dhall`. No change to
generated output or the public Dhall interface (`artifacts.<name>.gen`
URLs pointing at a previously-released `resolved.dhall` are unaffected;
only the next release's URL path changes, from `.../gen/Gen.dhall` — the
unresolved source path some projects may reference directly instead of a
frozen release — to `.../src/package.dhall`).
- The test harness now runs every pgn subprocess in its own process group under
an RSS watchdog: a thread polls `ps -o rss=` every 2 s and, on breach of
`PGN_MAX_RSS_GB` (default 40 GB), kills the whole group and fails the test with
Expand Down
Loading
Loading