Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e7575f3
Fix goto &sub in use/import not executing target subroutine
fglock Mar 15, 2026
0b4bc98
Fix jcpan test running - make test now executes t/*.t files
fglock Mar 15, 2026
ceb105a
Improve jcpan MakeMaker: cross-platform tests, MYMETA.yml, MM_PerlOnJava
fglock Mar 15, 2026
83ad1d4
Update Moo design doc with Phase 9 progress
fglock Mar 15, 2026
517a3f5
Protect custom ExtUtils modules from sync.pl overwrite
fglock Mar 15, 2026
7993ef7
Fix version parsing and MM->parse_version for CPAN.pm
fglock Mar 15, 2026
053d91a
Add Sub::Util, fix Scalar/List::Util VERSION, add Test::Harness
fglock Mar 15, 2026
a00404a
Update Moo design doc with remaining issues and jcpan improvements
fglock Mar 15, 2026
1da14ac
Fix return @array to return count in scalar context
fglock Mar 15, 2026
441f4c5
Update Moo design doc with Phase 11 and test results
fglock Mar 15, 2026
d3428a3
Add TODO: investigate spurious anonymous hash warnings in TAP::Harness
fglock Mar 15, 2026
393bedf
Fix quotemeta and Package::SUPER::method resolution
fglock Mar 15, 2026
6ddf17d
Update Moo design doc with Phase 12-13 progress
fglock Mar 15, 2026
4c52187
Fix VerifyError in return @array with RUNTIME context
fglock Mar 15, 2026
a7f20dc
Update all skills and AGENTS.md to use make commands
fglock Mar 15, 2026
4e8a17e
Improve build command documentation in skills and AGENTS.md
fglock Mar 15, 2026
00c1241
Fix print { func() } filehandle block parsing and JVM codegen
fglock Mar 15, 2026
a7e62c2
Update Moo design doc with Phase 14 progress
fglock Mar 15, 2026
8386ae8
Update Moo design doc: add print { hash } case to next steps
fglock Mar 15, 2026
95d9053
Add critical warning: NEVER use git stash
fglock Mar 15, 2026
ec2cdee
Fix print { $var->method } filehandle block parsing (Phase 15)
fglock Mar 15, 2026
ef028b8
Fix local @_ in string eval context (Phase 16)
fglock Mar 15, 2026
ce60776
Update Moo design doc with Phase 16 (local @_) progress
fglock Mar 15, 2026
eef8b69
Document 'around' missing method bug in Moo design doc
fglock Mar 15, 2026
721a242
Add detailed analysis of 'around' missing method bug
fglock Mar 15, 2026
dc22b05
Extend print { hash } detection to handle string keys and whitespace
fglock Mar 15, 2026
7bff89c
Update Moo design doc: Phase 17 - print { hash } detection
fglock Mar 15, 2026
5622cf6
Extend caller() to return full 11 elements for Carp compatibility
fglock Mar 15, 2026
103cc9e
Fix can() returning undefined code refs that incorrectly stringify
fglock Mar 15, 2026
63b19dd
Fix subroutine redefinition to preserve old code references
fglock Mar 15, 2026
e78cba6
Update Moo design doc: Phase 18 - subroutine redefinition fix
fglock Mar 15, 2026
0cb65d9
Fix unshift/push to accept our/local array declarations
fglock Mar 15, 2026
a2873c8
Fix glob assignment to properly alias arrays and hashes
fglock Mar 15, 2026
379b7f7
Update Moo design doc: Phase 19 - glob aliasing fix
fglock Mar 15, 2026
a32fcd5
Fix List::Util exports - add @EXPORT_OK and Exporter setup
fglock Mar 15, 2026
5b9397d
Fix undef %hash not clearing hashes in scalar call context
fglock Mar 15, 2026
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
33 changes: 21 additions & 12 deletions .cognition/skills/debug-exiftool/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ triggers:
- model
---

## ⚠️⚠️⚠️ CRITICAL: NEVER USE `git stash` ⚠️⚠️⚠️

**DANGER: Changes are SILENTLY LOST when using git stash/stash pop!**

- NEVER use `git stash` to temporarily revert changes
- INSTEAD: Commit to a WIP branch or use `git diff > backup.patch`
- This warning exists because completed work was lost during debugging

# Debugging Image::ExifTool Tests in PerlOnJava

You are debugging failures in the Image::ExifTool test suite running under PerlOnJava (a Perl-to-JVM compiler/interpreter). Failures typically stem from missing Perl features or subtle behavior differences in PerlOnJava, not bugs in ExifTool itself.
Expand All @@ -15,6 +23,8 @@ You are debugging failures in the Image::ExifTool test suite running under PerlO

**IMPORTANT: Never push directly to master. Always use feature branches and PRs.**

**IMPORTANT: Always commit or stash changes BEFORE switching branches.** If `git stash pop` has conflicts, uncommitted changes may be lost.

```bash
git checkout -b fix/exiftool-issue-name
# ... make changes ...
Expand All @@ -30,24 +40,23 @@ gh pr create --title "Fix: description" --body "Details"
- **ExifTool test lib**: `Image-ExifTool-13.44/t/TestLib.pm` (exports `check`, `writeCheck`, `writeInfo`, `testCompare`, `binaryCompare`, `testVerbose`, `notOK`, `done`)
- **ExifTool test data**: `Image-ExifTool-13.44/t/images/` (reference images)
- **ExifTool reference output**: `Image-ExifTool-13.44/t/<TestName>_N.out` (expected tag output per sub-test)
- **PerlOnJava unit tests**: `src/test/resources/unit/*.t` (mvn test suite, 154 tests)
- **PerlOnJava unit tests**: `src/test/resources/unit/*.t` (make suite, 154 tests)
- **Perl5 core tests**: `perl5_t/t/` (Perl 5 compatibility suite, run via `make test-gradle`)
- **Fat JAR**: `target/perlonjava-3.0.0.jar`
- **Launcher script**: `./jperl` (resolves JAR path, sets `$^X`)

## Building PerlOnJava

```bash
# Build JAR (required after any Java source change)
mvn package -q -DskipTests
**ALWAYS use `make` commands. NEVER use raw mvn/gradlew commands.**

# Run PerlOnJava's own unit test suite (154 tests, must all pass)
mvn test
| Command | What it does |
|---------|--------------|
| `make` | Build + run all unit tests (use before committing) |
| `make dev` | Build only, skip tests (for quick iteration during debugging) |

# Run Perl5 core compatibility tests (perl5_t/t/*.t)
make test-gradle
# Or manually:
perl dev/tools/perl_test_runner.pl --jobs 8 --timeout 60 --output test_results.json perl5_t/t
```bash
make # Standard build - compiles and runs tests
make dev # Quick build - compiles only, NO tests
```

## Running ExifTool Tests
Expand Down Expand Up @@ -232,9 +241,9 @@ The `check()` function compares extracted tags against reference files `t/<TestN

6. **Trace into PerlOnJava source** to find the bug. Use `JPERL_SHOW_FALLBACK=1` to check if large subs are hitting the interpreter path.

7. **Fix in PerlOnJava**, rebuild (`mvn package -q -DskipTests`), re-run the ExifTool test.
7. **Fix in PerlOnJava**, rebuild (`make dev`), re-run the ExifTool test.

8. **Verify no regressions**: Run `mvn test` (154 unit tests) and check `perl5_t/t/op/lexsub.t` (sensitive to block/sub emission changes).
8. **Verify no regressions**: Run `make` (154 unit tests) and check `perl5_t/t/op/lexsub.t` (sensitive to block/sub emission changes).

## Interpreter Fallback Architecture

Expand Down
41 changes: 29 additions & 12 deletions .cognition/skills/debug-perlonjava/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ triggers:

You are debugging failures in PerlOnJava, a Perl-to-JVM compiler with a bytecode interpreter fallback. This skill covers debugging workflows for test failures, regressions, and parity issues between backends.

## ⚠️⚠️⚠️ CRITICAL: NEVER USE `git stash` ⚠️⚠️⚠️

**DANGER: Changes are SILENTLY LOST when using git stash/stash pop!**

- NEVER use `git stash` to temporarily revert changes
- INSTEAD: Commit to a WIP branch or use `git diff > backup.patch`
- This warning exists because completed work was lost during debugging

## Git Workflow

**IMPORTANT: Never push directly to master. Always use feature branches and PRs.**
Expand All @@ -25,16 +33,23 @@ gh pr create --title "Fix: description" --body "Details"
## Project Layout

- **PerlOnJava source**: `src/main/java/org/perlonjava/` (compiler, bytecode interpreter, runtime)
- **Unit tests**: `src/test/resources/unit/*.t` (156 tests, run via `mvn test`)
- **Unit tests**: `src/test/resources/unit/*.t` (run via `make`)
- **Perl5 core tests**: `perl5_t/t/` (Perl 5 compatibility suite)
- **Fat JAR**: `target/perlonjava-3.0.0.jar`
- **Launcher script**: `./jperl`

## Building

**ALWAYS use `make` commands. NEVER use raw mvn/gradlew commands.**

| Command | What it does |
|---------|--------------|
| `make` | Build + run all unit tests (use before committing) |
| `make dev` | Build only, skip tests (for quick iteration during debugging) |

```bash
mvn package -q -DskipTests # Build JAR (required after any Java change)
mvn test # Run unit tests (156 tests, must all pass)
make # Standard build - compiles and runs tests
make dev # Quick build - compiles only, NO tests
```

## Running Tests
Expand Down Expand Up @@ -142,10 +157,10 @@ JPERL_INTERPRETER=1 ./jperl -e 'code' # Interpreter backend
### 1. Identify the regression
```bash
# Compare branch vs master
git checkout master && mvn package -q -DskipTests
git checkout master && make dev
./jperl -e 'failing code'

git checkout branch && mvn package -q -DskipTests
git checkout branch && make dev
./jperl -e 'failing code'
```

Expand Down Expand Up @@ -190,14 +205,14 @@ In Java source, add:
```java
System.err.println("DEBUG: var=" + var);
```
Then rebuild with `mvn package -q -DskipTests`.
Then rebuild with `make dev`.

### 8. Fix and verify
```bash
# After fixing
mvn package -q -DskipTests
make dev
./jperl -e 'test code' # Verify fix
mvn test # No regressions in unit tests
make # Build + run unit tests (no regressions)
```

## Git Workflow
Expand Down Expand Up @@ -380,11 +395,13 @@ The JVM's `setFromList()` → `addToArray()` chain already handles `PerlRange` c
## Quick Reference Commands

```bash
# Build
mvn package -q -DskipTests
# Build + test
make

# Build only (no tests)
make dev

# Test
mvn test
# Run specific Perl5 test
perl dev/tools/perl_test_runner.pl perl5_t/t/op/bop.t

# Debug parsing
Expand Down
8 changes: 8 additions & 0 deletions .cognition/skills/debug-windows-ci/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Debug PerlOnJava Windows CI Failures

## ⚠️⚠️⚠️ CRITICAL: NEVER USE `git stash` ⚠️⚠️⚠️

**DANGER: Changes are SILENTLY LOST when using git stash/stash pop!**

- NEVER use `git stash` to temporarily revert changes
- INSTEAD: Commit to a WIP branch or use `git diff > backup.patch`
- This warning exists because completed work was lost during debugging

## Overview

This skill helps debug test failures that occur specifically in the Windows CI/CD environment but pass locally on macOS/Linux.
Expand Down
20 changes: 18 additions & 2 deletions .cognition/skills/debugger/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Perl Debugger Implementation Skill

## ⚠️⚠️⚠️ CRITICAL: NEVER USE `git stash` ⚠️⚠️⚠️

**DANGER: Changes are SILENTLY LOST when using git stash/stash pop!**

- NEVER use `git stash` to temporarily revert changes
- INSTEAD: Commit to a WIP branch or use `git diff > backup.patch`
- This warning exists because completed work was lost during debugging

## Overview

Continue implementing the Perl debugger (`-d` flag) for PerlOnJava. The debugger uses DEBUG opcodes injected at statement boundaries in the bytecode interpreter.
Expand All @@ -8,6 +16,8 @@ Continue implementing the Perl debugger (`-d` flag) for PerlOnJava. The debugger

**IMPORTANT: Never push directly to master. Always use feature branches and PRs.**

**IMPORTANT: Always commit or stash changes BEFORE switching branches.** If `git stash pop` has conflicts, uncommitted changes may be lost.

```bash
git checkout -b feature/debugger-improvement
# ... make changes ...
Expand Down Expand Up @@ -128,10 +138,16 @@ Tested side-by-side with `perl -d`:

## Tips for Development

**ALWAYS use `make` commands. NEVER use raw mvn/gradlew commands.**

| Command | What it does |
|---------|--------------|
| `make` | Build + run all unit tests (use before committing) |
| `make dev` | Build only, skip tests (for quick iteration during debugging) |

### Testing the debugger
```bash
# Build after changes
mvn package -q -DskipTests
make dev # Quick build after changes (no tests)

# Test basic stepping
echo 'n
Expand Down
23 changes: 20 additions & 3 deletions .cognition/skills/fix-pat-sprintf/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ triggers:
- model
---

## ⚠️⚠️⚠️ CRITICAL: NEVER USE `git stash` ⚠️⚠️⚠️

**DANGER: Changes are SILENTLY LOST when using git stash/stash pop!**

- NEVER use `git stash` to temporarily revert changes
- INSTEAD: Commit to a WIP branch or use `git diff > backup.patch`
- This warning exists because completed work was lost during debugging

# Fix pat.t and sprintf2.t Regressions

You are fixing test regressions in `re/pat.t` (-17 tests) and `op/sprintf2.t` (-3 tests) on the `fix-exiftool-cli` branch of PerlOnJava.
Expand Down Expand Up @@ -50,11 +58,20 @@ For each failing test:

## Running the Tests

**ALWAYS use `make` commands. NEVER use raw mvn/gradlew commands.**

| Command | What it does |
|---------|--------------|
| `make` | Build + run all unit tests (use before committing) |
| `make dev` | Build only, skip tests (for quick iteration during debugging) |

```bash
# Build
make build
make # Standard build - compiles and runs tests
make dev # Quick build - compiles only, NO tests
```

# Run individual tests via test runner (sets correct ENV vars)
Run individual tests via test runner (sets correct ENV vars):
```bash
perl dev/tools/perl_test_runner.pl perl5_t/t/re/pat.t
perl dev/tools/perl_test_runner.pl perl5_t/t/op/sprintf2.t

Expand Down
44 changes: 34 additions & 10 deletions .cognition/skills/interpreter-parity/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ triggers:
- model
---

## ⚠️⚠️⚠️ CRITICAL: NEVER USE `git stash` ⚠️⚠️⚠️

**DANGER: Changes are SILENTLY LOST when using git stash/stash pop!**

- NEVER use `git stash` to temporarily revert changes
- INSTEAD: Commit to a WIP branch or use `git diff > backup.patch`
- This warning exists because completed work was lost during debugging

# Interpreter/JVM Backend Parity Debugging

You are fixing cases where PerlOnJava's bytecode interpreter produces different results than the JVM compiler backend. The interpreter should be a drop-in replacement — same parsing, same runtime APIs, different execution engine.
Expand All @@ -15,6 +23,8 @@ You are fixing cases where PerlOnJava's bytecode interpreter produces different

**IMPORTANT: Never push directly to master. Always use feature branches and PRs.**

**IMPORTANT: Always commit changes BEFORE switching branches.** Use `git diff > backup.patch` to save uncommitted work, or commit to a WIP branch. Never use `git stash` — changes can be silently lost.

```bash
git checkout -b fix/interpreter-issue-name
# ... make changes ...
Expand All @@ -25,16 +35,24 @@ gh pr create --title "Fix interpreter: description" --body "Details"
## Project Layout

- **PerlOnJava source**: `src/main/java/org/perlonjava/` (compiler, bytecode interpreter, runtime)
- **Unit tests**: `src/test/resources/unit/*.t` (155 tests, run via `mvn test`)
- **Unit tests**: `src/test/resources/unit/*.t` (155 tests, run via `make`)
- **Fat JAR**: `target/perlonjava-3.0.0.jar`
- **Launcher script**: `./jperl`

## Building

**ALWAYS use `make` commands. NEVER use raw mvn/gradlew commands.**

| Command | What it does |
|---------|--------------|
| `make` | Build + run all unit tests (use before committing) |
| `make dev` | Build only, skip tests (for quick iteration during debugging) |
| `make test-interpreter` | Run unit tests with interpreter backend |

```bash
mvn package -q -DskipTests # Build JAR (after any Java change)
mvn test # Run unit tests (JVM backend, must all pass)
make test-interpreter # Run unit tests with interpreter backend
make # Standard build - compiles and runs tests
make dev # Quick build - compiles only, NO tests
make test-interpreter # Test interpreter backend specifically
```

## Running in Interpreter Mode
Expand Down Expand Up @@ -170,9 +188,13 @@ All paths relative to `src/main/java/org/perlonjava/`.

**Save master baseline to files FIRST** (do this once per debugging session):
```bash
# Save your current work first (NEVER use git stash!)
git diff > /tmp/my-changes.patch # Save uncommitted changes
git add -A && git commit -m "WIP: save work before baseline check" # Or commit to WIP

# Switch to master and build
git stash && git checkout master
mvn package -q -DskipTests
git checkout master
make dev

# Save master test output for JVM backend
cd perl5_t/t && ../../jperl re/subst.t 2>&1 > /tmp/master_subst.log
Expand All @@ -182,12 +204,14 @@ grep "^not ok" /tmp/master_subst.log > /tmp/master_subst_fails.txt
cd perl5_t/t && ../../jperl --interpreter re/subst.t 2>&1 > /tmp/master_subst_interp.log

# Switch back to feature branch
git checkout feature-branch && git stash pop
git checkout feature-branch
# Restore uncommitted changes if you used patch:
# git apply /tmp/my-changes.patch
```

**After making changes**, compare against saved baselines:
```bash
mvn package -q -DskipTests
make dev

# Test JVM backend
cd perl5_t/t && ../../jperl re/subst.t 2>&1 > /tmp/feature_subst.log
Expand Down Expand Up @@ -224,13 +248,13 @@ JPERL_INTERPRETER=1 ./jperl -e 'failing code'
**CRITICAL: Save baselines to files!** When comparing test suites across branches:
```bash
# On master - save results so you don't have to rebuild later
git checkout master && mvn package -q -DskipTests
git checkout master && make dev
cd perl5_t/t && JPERL_INTERPRETER=1 ../../jperl test.t 2>&1 | tee /tmp/test_master.log
JPERL_INTERPRETER=1 ../../jperl test.t 2>&1 | grep "^ok\|^not ok" > /tmp/test_master_results.txt
grep "^ok" /tmp/test_master_results.txt | wc -l # Save this number!

# Return to feature branch - now you can compare without rebuilding master
git checkout feature-branch && mvn package -q -DskipTests
git checkout feature-branch && make dev
```

### 2. Use --disassemble to see interpreter bytecode
Expand Down
12 changes: 10 additions & 2 deletions .cognition/skills/migrate-jna/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,18 @@ Migrate in this order (least to most complex):

## Testing

**ALWAYS use `make` commands. NEVER use raw mvn/gradlew commands.**

| Command | What it does |
|---------|--------------|
| `make` | Build + run all unit tests (use before committing) |
| `make dev` | Build only, skip tests (for quick iteration) |
| `make test-all` | Run extended test suite |

After each file migration:
```bash
make # Must pass
make test-all # Check for regressions
make # Build + unit tests (must pass)
make test-all # Check for regressions in extended tests
```

Key tests that exercise native operations:
Expand Down
Loading
Loading