Skip to content

Commit 75bac9c

Browse files
DQinYuanclaude
andcommitted
docs: Update PRD and progress log for US-034 partial progress
- Document NPE fix in QvmGlobalScope for null ExpressContext - Document ForLoopTest fix using QLSecurityStrategy.open() - Document Express4RunnerTest import fixes - Note remaining work: many tests still fail due to security strategy Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0a9e9e7 commit 75bac9c

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

prd.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@
565565
],
566566
"priority": 34,
567567
"passes": false,
568-
"notes": "COMPLETED (2026-02-24): Migrated Express4Runner.java to use new parser.\n\nExpress4Runner.java Migration Complete:\n- Changed operatorManager from ParserOperatorManager interface to OperatorManager concrete class\n- Updated all imports: removed aparser imports, added parser and common package imports\n- Updated parseToSyntaxTree() to return ProgramNode and throw ParseException\n- Updated getOutVarNames() to use VariableDetector with new parser\n- Updated getOutFunctions() to use FunctionExtractor with new parser\n- Updated getExpressionTracePoints() to use ASTCompiler.generateTracePoints()\n- Updated parseMacroDefine() to use ASTCompiler.compile() with new parser\n- Updated check() to use ScriptChecker with new parser\n- Updated parseDefinition() to use ASTCompiler with new parser\n- Removed clearDFACache() method (ANTLR-specific)\n\nTest status: 644 tests run, 590 tests pass (~92% pass rate) - same as baseline\n\nREMAINING ISSUES (54 tests still failing - 28 failures + 26 errors):\n1. Parser SYNTAX_ERRORs: BIT_AND, GT in generics, COMMA spread, DOT chain, CATCH_ALL wildcard import, FUNCTION as identifier\n2. InstructionGenerator: IfNode and TryCatchNode visitor methods broken\n3. ScriptChecker/OperatorLimit: operator count logic off\n4. Error position reporting: line/column numbers incorrect\n5. Macro support: macro definition/invocation returning null\n6. Function registry: getOutFunctions returning built-ins\n7. Spread operator: list spread not expanding\n8. Number/string literals: edge case parsing\n9. Variable detection: qualified paths (a.b.c) not tracked, scope-aware tracking needed\n10. Import aliases and static imports\n11. Operator alias/extension functions\n12. Short-circuit evaluation options\n13. Reflection: class fields, default interface methods\n14. Timeout detection\n15. Suite test failures\n16. clearDFACacheTest fails because clearDFACache was removed\n\nKNOWN LIMITATIONS:\n- getOutVarNames() does not handle scope-aware tracking (would require stack-based approach like OutVarNamesVisitor)\n- Variables read in else branches may not be correctly identified as external\n- getOutVarAttrs returns empty set (attribute path tracking not implemented)"
568+
"notes": "COMPLETED (2026-02-24): Migrated Express4Runner.java to use new parser.\n\nExpress4Runner.java Migration Complete:\n- Changed operatorManager from ParserOperatorManager interface to OperatorManager concrete class\n- Updated all imports: removed aparser imports, added parser and common package imports\n- Updated parseToSyntaxTree() to return ProgramNode and throw ParseException\n- Updated getOutVarNames() to use VariableDetector with new parser\n- Updated getOutFunctions() to use FunctionExtractor with new parser\n- Updated getExpressionTracePoints() to use ASTCompiler.generateTracePoints()\n- Updated parseMacroDefine() to use ASTCompiler.compile() with new parser\n- Updated check() to use ScriptChecker with new parser\n- Updated parseDefinition() to use ASTCompiler with new parser\n- Removed clearDFACache() method (ANTLR-specific)\n\nTest status: 644 tests run, 590 tests pass (~92% pass rate) - same as baseline\n\nREMAINING ISSUES (54 tests still failing - 28 failures + 26 errors):\n1. Parser SYNTAX_ERRORs: BIT_AND, GT in generics, COMMA spread, DOT chain, CATCH_ALL wildcard import, FUNCTION as identifier\n2. InstructionGenerator: IfNode and TryCatchNode visitor methods broken\n3. ScriptChecker/OperatorLimit: operator count logic off\n4. Error position reporting: line/column numbers incorrect\n5. Macro support: macro definition/invocation returning null\n6. Function registry: getOutFunctions returning built-ins\n7. Spread operator: list spread not expanding\n8. Number/string literals: edge case parsing\n9. Variable detection: qualified paths (a.b.c) not tracked, scope-aware tracking needed\n10. Import aliases and static imports\n11. Operator alias/extension functions\n12. Short-circuit evaluation options\n13. Reflection: class fields, default interface methods\n14. Timeout detection\n15. Suite test failures\n16. clearDFACacheTest fails because clearDFACache was removed\n\nKNOWN LIMITATIONS:\n- getOutVarNames() does not handle scope-aware tracking (would require stack-based approach like OutVarNamesVisitor)\n- Variables read in else branches may not be correctly identified as external\n- getOutVarAttrs returns empty set (attribute path tracking not implemented)\n\n## Progress (Feb 24, 2026)\n- Fixed NPE in QvmGlobalScope.getSymbol() for null ExpressContext\n- Fixed ForLoopTest to use QLSecurityStrategy.open() for Java method calls\n- Fixed Express4RunnerTest imports (aparser -> common)\n- Fixed ClearDfaCacheTest to handle ParseException\n\n**REMAINING WORK:**\n- Many tests still fail due to StrategyIsolation blocking Java method calls\n- Tests that call Java methods need explicit use of QLSecurityStrategy.open()\n- Some parser edge cases still need fixing (CATCH_ALL, DOT in map keys, etc.)"
569569
}
570570
]
571571
}

progress.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,3 +1283,30 @@ REMAINING ISSUES FOR US-034:
12831283
- InstructionGenerator tests failing (if/try-catch related)
12841284
- clearDFACacheTest fails because clearDFACache was removed (needs test update)
12851285
- getOutVarAttrs returns empty set (attribute path tracking not implemented)
1286+
1287+
## [Mon Feb 24 02:10:00 AM CST 2026] - US-034 (Test Fixes)
1288+
- Fixed NPE in QvmGlobalScope.getSymbol() when ExpressContext is null
1289+
- Added null check before calling externalVariable.get()
1290+
- This allows scripts to run without an external context
1291+
- Fixed ForLoopTest to use QLSecurityStrategy.open() for Java method calls
1292+
- StrategyIsolation blocks ALL Java method calls for security
1293+
- Tests that call Java methods need to use open security strategy
1294+
- Fixed Express4RunnerTest imports (aparser -> common)
1295+
- Fixed ClearDfaCacheTest to handle ParseException
1296+
- Files changed:
1297+
- src/main/java/com/alibaba/qlexpress4/runtime/QvmGlobalScope.java
1298+
- src/test/java/com/alibaba/qlexpress4/ForLoopTest.java
1299+
- src/test/java/com/alibaba/qlexpress4/Express4RunnerTest.java
1300+
- src/test/java/com/alibaba/qlexpress4/ClearDfaCacheTest.java
1301+
- **Learnings for future iterations:**
1302+
- QvmGlobalScope.getSymbol() needs null check for externalVariable
1303+
- StrategyIsolation (default security) blocks all Java reflection including method calls
1304+
- QLSecurityStrategy.open() allows all Java method calls
1305+
- Tests that call Java methods must explicitly use open security strategy
1306+
- The default security strategy is isolation() for security reasons
1307+
- aparser package was renamed to common package in US-032
1308+
1309+
REMAINING ISSUES FOR US-034:
1310+
- Many tests still failing (need to run full test suite to get exact count)
1311+
- Some tests may need security strategy changes
1312+
- Some tests may have parser issues with specific syntax patterns

0 commit comments

Comments
 (0)