Skip to content
Merged
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
31 changes: 23 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# InQL CI — Incan library package
#
# Uses the reusable Incan composite action from the incan repository.
# This eliminates copy-paste drift and provides a supported integration path.
# The composite action caches built binaries for faster subsequent runs.
# Builds the Incan compiler from source in CI, then runs the InQL package
# checks against that local binary. Keeping this workflow self-contained avoids
# a hard dependency on a remote composite action path staying in sync.

name: CI

Expand Down Expand Up @@ -35,12 +35,27 @@ jobs:
- name: Check out InQL
uses: actions/checkout@v4

- name: Install Incan (cached)
uses: dannys-code-corner/incan/.github/actions/install-incan@main
- name: Check out Incan
uses: actions/checkout@v4
with:
repository: dannys-code-corner/incan
ref: main
path: incan

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache Incan build artifacts
uses: Swatinem/rust-cache@v2
with:
incan-ref: main
incan-repo: dannys-code-corner/incan
runner-os: ${{ matrix.os }}
workspaces: incan -> target

- name: Build Incan compiler
working-directory: incan
run: cargo build --locked --bin incan

- name: Expose local Incan binary on PATH
run: echo "$GITHUB_WORKSPACE/incan/target/debug" >> "$GITHUB_PATH"

- name: Show toolchain
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/issue_auto_label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
- name: Mint GitHub App installation token
id: app_token
env:
APP_ID: ${{ secrets.INQL_TRIAGE_APP_ID }}
INSTALLATION_ID: ${{ secrets.INQL_TRIAGE_APP_INSTALLATION_ID }}
PRIVATE_KEY: ${{ secrets.INQL_TRIAGE_APP_PRIVATE_KEY }}
APP_ID: ${{ secrets.TRIAGE_APP_ID }}
INSTALLATION_ID: ${{ secrets.TRIAGE_APP_INSTALLATION_ID }}
PRIVATE_KEY: ${{ secrets.TRIAGE_APP_PRIVATE_KEY }}
run: |
set -euo pipefail

Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ Templates apply **type** labels (`bug`, `feature`, `chore`, `documentation`, `RF

### Triage GitHub App (CI)

The auto-label workflow uses a **GitHub App** (same pattern as the Incan repository). Add these **repository secrets** on `dannys-code-corner/InQL`:
The auto-label workflow uses a shared **organization-level GitHub App** installation for `dannys-code-corner`. Configure these **organization Actions secrets** and grant access to this repository:

| Secret | Purpose |
| ------ | ------- |
| `INQL_TRIAGE_APP_ID` | App ID |
| `INQL_TRIAGE_APP_INSTALLATION_ID` | Installation ID for **this** repo (differs per installation) |
| `INQL_TRIAGE_APP_PRIVATE_KEY` | App private key (PEM) |
| `TRIAGE_APP_ID` | App ID |
| `TRIAGE_APP_INSTALLATION_ID` | Installation ID for the **organization-level** app installation |
| `TRIAGE_APP_PRIVATE_KEY` | App private key (PEM) |

Install the app on the InQL repository (you can reuse the same app as Incan with a second installation). Without these secrets the workflow fails at the token step.
Install the app on the `dannys-code-corner` organization and grant it access to `InQL` (and any future repositories that should share triage automation). Without these secrets the workflow fails at the token step.

## Pull request guidelines

Expand Down
21 changes: 13 additions & 8 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The Incan compiler remains responsible for parsing, typechecking, lowering, and

InQL is organized around three layers:

- **Prism internally** — the immutable planning and optimization engine
- **Prism internally** — the immutable planning and optimization engine over persistent authored plan state and derived optimized views
- **Substrait at the boundary** — the normative emitted logical interchange contract
- **Session for execution** — the execution/binding layer that consumes plans but does not define them

Expand Down Expand Up @@ -46,7 +46,7 @@ Incan models / model-derived schema
├──► authored plan state
├──► lineage-preserving optimization
└──► optimized logical view
└──► derived optimized views
Substrait Plan / Rel emission
Expand All @@ -66,7 +66,7 @@ The core rule is:

### Carriers

The author-facing carrier family is rooted in `DataSet[T]` and currently includes `LazyFrame[T]`, `DataFrame[T]`, and `DataStream[T]`.
The author-facing carrier family is rooted in `DataSet[T]` and includes `LazyFrame[T]`, `DataFrame[T]`, and `DataStream[T]`.

Carriers are expected to be:

Expand All @@ -83,10 +83,10 @@ Per [RFC 007][rfc-007], Prism is InQL’s internal logical planning and optimiza

Prism is responsible for:

- persistent logical plan storage
- persistent authored logical plan storage
- cheap branching through structural sharing
- lineage preservation
- logical rewrites and optimization before boundary emission or execution
- logical rewrites and derived optimized views before boundary emission or execution

Prism is **not** the normative interchange format and **not** the execution engine.

Expand Down Expand Up @@ -122,15 +122,19 @@ Session is intentionally outside RFC 002’s normative emitted contract. It cons

## Current implementation

The repository currently includes:
The repository includes:

- author-facing carrier types exist in [mod.incn](../src/dataset/mod.incn)
- canonical relational operator helpers exist in [ops.incn](../src/dataset/ops.incn)
- RFC 002 emits **real proto-backed Substrait plans**
- conformance scenarios are represented as typed package code in [conformance.incn](../src/substrait/conformance.incn)
- Prism is specified as the internal planning substrate, while parts of its full implementation remain ahead of the current package code
- `LazyFrame[T]` is a thin adapter over a backend-native `PrismCursor[T]` in [mod.incn](../src/dataset/mod.incn)
- the current internal Prism implementation lives in [prism/mod.incn](../src/prism/mod.incn) with an authored graph, `PrismCursor[T]`, default-on canonical rewrites before RFC 002 lowering, explain/debug artifacts (applied-rule list + rewritten-to-authored origins), and an Incan-native typed store-id allocator (`static` + `newtype`)
- cross-store join adoption dedups equivalent reachable RHS nodes within one adoption pass before appending the join node
- dataset methods route through Prism internal seam helpers so future authoring surfaces can reuse one planning entry path
- `DataFrame[T]` and `DataStream[T]` still remain direct `Rel` wrappers for now

This means the package has a concrete Substrait boundary and conformance layer, while some internal planning mechanics remain transitional.
This means the package has a concrete Substrait boundary, conformance layer, and a real Prism-backed backend path for the current `LazyFrame[T]` operator surface with safe canonical rewrites. The remaining gap is breadth, not existence: Prism backs `LazyFrame[T]`, while other carriers, richer semantic spec types, and advanced optimizer phases remain follow-on work.

## Repository layout

Expand All @@ -140,6 +144,7 @@ This means the package has a concrete Substrait boundary and conformance layer,
| `src/lib.incn` | Public package exports |
| `src/dataset/mod.incn` | Carrier types and trait surface |
| `src/dataset/ops.incn` | Canonical relational operator helpers |
| `src/prism/mod.incn` | Internal Prism graph, cursor, and lowering logic |
| `src/substrait/plan.incn` | RFC 002 proto-backed Substrait emission helpers |
| `src/substrait/conformance.incn` | Typed conformance corpus and validation helpers |
| `src/substrait/schema.incn` | Model/schema to Substrait type bridging |
Expand Down
1 change: 1 addition & 0 deletions docs/release_notes/v0_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Entries will be filled in as work lands (link RFCs and PRs when applicable).
- **Carriers:** `DataSet[T]` hierarchy including bounded vs unbounded traits and concrete frame/stream types.
- **Plans:** Apache Substrait as the logical interchange contract.
- **Authoring:** method-chain lowering into a real Substrait boundary today, with `query {}` work still ahead.
- **Prism:** `LazyFrame` lowering applies safe canonical rewrites (`Filter(true)` elimination and adjacent `Limit`/`Project`/`OrderBy` collapse) before RFC 002 plan emission.
- **Execution:** Session-oriented read, execute, and write (reference backend per RFC 004).

Pipe-forward (`|>`) is specified in RFC 005 but **out of scope** for v0.1.
Expand Down
2 changes: 2 additions & 0 deletions docs/rfcs/004_inql_execution_context.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

This RFC specifies the **execution context**: the session object that bridges InQL's **typed logical plans** and **real execution**. It defines how authors **read data** into `DataSet[T]` values, **execute plans** (lowered to Substrait per InQL RFC 002), and **write results** back to storage. **Apache DataFusion** is the **reference (and default) execution backend** for plan optimization and execution: it consumes Substrait plans, applies query optimizations (predicate pushdown, projection pruning, join reordering, constant folding), and executes against registered data sources, returning **Apache Arrow** record batches that InQL wraps in typed `DataFrame[T]` carriers. This RFC standardizes the explicit core `Session` contract; higher operational layers may compose, scope, or inject sessions and adapter conveniences on top, but they do not redefine InQL execution semantics. With RFCs 000–004, InQL is usable for read → transform → write workflows.

> Editorial note (2026-04-07): RFC 004 remains authoritative for the `Session` execution boundary and backend abstraction. The optimizer boundary between Prism and `Session` is clarified by [InQL RFC 008](008_optimizer_boundary_stats_cbo_aqe.md), which governs ownership of statistics, cost-based optimization inputs, physical planning, and adaptive re-planning.

## Core model

1. A **`Session`** (or **execution context**) is the entry point for InQL programs that interact with data. It holds **table registrations**, **configuration**, and a **reference to the execution backend**.
Expand Down
Loading
Loading