Skip to content
Open
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
22 changes: 22 additions & 0 deletions .claude/skills/testing-hashql/references/mir-builder-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ let body = body!(interner, env; [graph::read::filter]@0/2 -> Bool {
| `x = tuple <a>, <b>;` | Create tuple | `Assign(x, Aggregate(Tuple, [a, b]))` |
| `x = struct a: <v1>, b: <v2>;` | Create struct | `Assign(x, Aggregate(Struct, [v1, v2]))` |
| `x = closure <def> <env>;` | Create closure | `Assign(x, Aggregate(Closure, [def, env]))` |
| `x = opaque (<name>), <value>;` | Create opaque wrapper | `Assign(x, Aggregate(Opaque(name), [value]))` |
| `x = bin.<op> <lhs> <rhs>;` | Binary operation | `Assign(x, Binary(lhs, op, rhs))` |
| `x = un.<op> <operand>;` | Unary operation | `Assign(x, Unary(op, operand))` |
| `x = input.load! "name";` | Load required input | `Assign(x, Input(Load { required: true }, "name"))` |
Expand Down Expand Up @@ -276,6 +277,27 @@ let body = body!(interner, env; [graph::read::filter]@0/2 -> Bool {
});
```

### Opaque Construction and Projection

Construct opaque-wrapped values with `opaque (<name>), <value>`. The name must
be wrapped in parentheses because it is a multi-token path.

```rust
use hashql_core::symbol::sym;

let body = body!(interner, env; fn@0/0 -> Int {
decl inner: (x: Int, y: Int), wrapped: [Opaque sym::path::Entity; ?], result: Int;
@proj y_field = wrapped.y: Int;

bb0() {
inner = struct x: 100, y: 200;
wrapped = opaque (sym::path::Entity), inner;
result = load y_field;
return result;
}
});
```

### Direct Function Calls

Use a `DefId` variable directly:
Expand Down
19 changes: 19 additions & 0 deletions .direnv/bin/nix-direnv-reload
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -e
if [[ ! -d "/Users/bmahmoud/projects/hash/hash" ]]; then
echo "Cannot find source directory; Did you move it?"
echo "(Looking for "/Users/bmahmoud/projects/hash/hash")"
echo 'Cannot force reload with this script - use "direnv reload" manually and then try again'
exit 1
fi

# rebuild the cache forcefully
_nix_direnv_force_reload=1 direnv exec "/Users/bmahmoud/projects/hash/hash" true

# Update the mtime for .envrc.
# This will cause direnv to reload again - but without re-building.
touch "/Users/bmahmoud/projects/hash/hash/.envrc"

# Also update the timestamp of whatever profile_rc we have.
# This makes sure that we know we are up to date.
touch -r "/Users/bmahmoud/projects/hash/hash/.envrc" "/Users/bmahmoud/projects/hash/hash/.direnv"/*.rc
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Local development .direnv files accidentally committed

High Severity

The entire .direnv/ directory has been committed, containing machine-specific nix-direnv configuration files. These include hardcoded local paths (/Users/bmahmoud/projects/hash/hash), nix store references, and environment variable exports tied to a specific developer's machine. The .gitignore has no entry for .direnv, so this will persist and potentially cause conflicts for other developers. These files are auto-generated by direnv and should never be version-controlled.

Additional Locations (1)
Fix in CursorΒ Fix in Web

Reviewed by Cursor Bugbot for commit b4765d0. Configure here.

69 changes: 69 additions & 0 deletions .direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
unset shellHook
PATH=${PATH:-}
nix_saved_PATH="$PATH"
XDG_DATA_DIRS=${XDG_DATA_DIRS:-}
nix_saved_XDG_DATA_DIRS="$XDG_DATA_DIRS"
BASH='/sbin/nologin'
HOSTTYPE='aarch64'
IFS='
'
IN_NIX_SHELL='impure'
export IN_NIX_SHELL
LINENO='80'
MACHTYPE='aarch64-apple-darwin25.3.0'
NIX_BUILD_CORES='18'
export NIX_BUILD_CORES
NIX_STORE='/nix/store'
export NIX_STORE
OLDPWD=''
export OLDPWD
OPTERR='1'
OSTYPE='darwin25.3.0'
PATH='/path-not-set'
export PATH
PS4='+ '
SHELL='/sbin/nologin'
builder='/nix/store/in4yc03diyvs2n2wgf3nva4hbvml8v1j-bash-interactive-5.3p9/bin/bash'
export builder
dontAddDisableDepTrack='1'
export dontAddDisableDepTrack
name='hash-env'
export name
out='/Users/bmahmoud/projects/hash/hash/outputs/out'
export out
outputs='out'
shellHook='# Remove all the unnecessary noise that is set by the build env
unset NIX_BUILD_TOP NIX_BUILD_CORES NIX_STORE
unset TEMP TEMPDIR TMP TMPDIR
# $name variable is preserved to keep it compatible with pure shell https://github.com/sindresorhus/pure/blob/47c0c881f0e7cfdb5eaccd335f52ad17b897c060/pure.zsh#L235
unset builder out shellHook stdenv system
# Flakes stuff
unset dontAddDisableDepTrack outputs

# For `nix develop`. We get /noshell on Linux and /sbin/nologin on macOS.
if [[ "$SHELL" == "/noshell" || "$SHELL" == "/sbin/nologin" ]]; then
export SHELL=/nix/store/in4yc03diyvs2n2wgf3nva4hbvml8v1j-bash-interactive-5.3p9/bin/bash
fi

# Load the environment
source "/nix/store/z6v9sv2fk37bc7adkmfdgjjjfzhyyflz-hash-dir/env.bash"
'
export shellHook
stdenv='/nix/store/c0pzk2bfla7hyzwq4vq6rk92m5dpwa4j-naked-stdenv'
export stdenv
system='aarch64-darwin'
export system
runHook ()
{

eval "$shellHook";
unset runHook
}
PATH="$PATH${nix_saved_PATH:+:$nix_saved_PATH}"
XDG_DATA_DIRS="$XDG_DATA_DIRS${nix_saved_XDG_DATA_DIRS:+:$nix_saved_XDG_DATA_DIRS}"
export NIX_BUILD_TOP="$(mktemp -d -t nix-shell.XXXXXX)"
export TMP="$NIX_BUILD_TOP"
export TMPDIR="$NIX_BUILD_TOP"
export TEMP="$NIX_BUILD_TOP"
export TEMPDIR="$NIX_BUILD_TOP"
eval "${shellHook:-}"
Loading
Loading