fix: Code review round 2 — race conditions, dead code, hardcoded paths

CRITICAL fixes:
- #1 vm.go: Mutex on libModules/dynamicFuncs global slices
  RegisterLibModule/RegisterDynamicFunc now thread-safe
  RegisterLibModules copies under lock, clears, releases
- #4 shutdown.go: Signal handler goroutine leak fixed
  Uses done channel + select for clean exit on normal shutdown

HIGH fixes:
- #7-8 gobridge.go: Remove dead if/else branches (both identical)
- #13-14 main.go: Remove hardcoded /mnt/d/harbour-core paths
  Use HB_INC env var + standard /usr/local/include/harbour only
- #15 main.go: Remove unused frbModSeq variable

MEDIUM fixes:
- #22 expr.go: Remove unused parts variable in parseInterpolatedString
- #51 macro.go: Remove var _ = fmt.Sprintf import guard
- macroeval.go: Remove unused lexer import and guard

Total fixed this session: 12/53 issues resolved
Remaining: 41 (CRITICAL: 1, HIGH: 9, MEDIUM: 16, LOW: 16)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-01 10:32:09 +09:00
parent 7c61db70c3
commit d7513eeb24
7 changed files with 144 additions and 41 deletions

View File

@@ -1,6 +1,6 @@
{
"version": "2.0",
"lastUpdated": "2026-04-01T01:16:33.700Z",
"lastUpdated": "2026-04-01T01:30:25.114Z",
"activeFeatures": [
"hbrt",
"hbrtl",
@@ -33,9 +33,9 @@
"documents": {},
"timestamps": {
"started": "2026-03-27T09:33:04.512Z",
"lastUpdated": "2026-04-01T01:14:37.127Z"
"lastUpdated": "2026-04-01T01:30:25.114Z"
},
"lastFile": "/mnt/d/charles/five/hbrt/goroutine.go"
"lastFile": "/mnt/d/charles/five/hbrt/macroeval.go"
},
"hbrtl": {
"phase": "do",
@@ -111,7 +111,7 @@
"documents": {},
"timestamps": {
"started": "2026-03-27T11:38:35.393Z",
"lastUpdated": "2026-03-30T23:12:37.002Z"
"lastUpdated": "2026-04-01T01:28:45.794Z"
},
"lastFile": "/mnt/d/charles/five/compiler/parser/expr.go"
},
@@ -137,7 +137,7 @@
"documents": {},
"timestamps": {
"started": "2026-03-27T11:50:31.420Z",
"lastUpdated": "2026-03-30T23:06:13.211Z"
"lastUpdated": "2026-04-01T01:27:55.511Z"
},
"lastFile": "/mnt/d/charles/five/cmd/five/main.go"
},
@@ -280,7 +280,7 @@
"session": {
"startedAt": "2026-03-27T06:06:49.620Z",
"onboardingCompleted": false,
"lastActivity": "2026-04-01T01:16:33.700Z"
"lastActivity": "2026-04-01T01:30:25.114Z"
},
"history": [
{
@@ -5484,6 +5484,90 @@
"feature": "hbrtl",
"phase": "do",
"action": "updated"
},
{
"timestamp": "2026-04-01T01:19:54.973Z",
"feature": "hbrt",
"phase": "do",
"action": "updated"
},
{
"timestamp": "2026-04-01T01:20:21.533Z",
"feature": "hbrt",
"phase": "do",
"action": "updated"
},
{
"timestamp": "2026-04-01T01:22:48.056Z",
"feature": "hbrt",
"phase": "do",
"action": "updated"
},
{
"timestamp": "2026-04-01T01:23:21.680Z",
"feature": "hbrt",
"phase": "do",
"action": "updated"
},
{
"timestamp": "2026-04-01T01:25:43.817Z",
"feature": "hbrt",
"phase": "do",
"action": "updated"
},
{
"timestamp": "2026-04-01T01:26:05.575Z",
"feature": "hbrt",
"phase": "do",
"action": "updated"
},
{
"timestamp": "2026-04-01T01:26:39.256Z",
"feature": "five",
"phase": "do",
"action": "updated"
},
{
"timestamp": "2026-04-01T01:27:25.814Z",
"feature": "five",
"phase": "do",
"action": "updated"
},
{
"timestamp": "2026-04-01T01:27:55.511Z",
"feature": "five",
"phase": "do",
"action": "updated"
},
{
"timestamp": "2026-04-01T01:28:33.123Z",
"feature": "parser",
"phase": "do",
"action": "updated"
},
{
"timestamp": "2026-04-01T01:28:45.794Z",
"feature": "parser",
"phase": "do",
"action": "updated"
},
{
"timestamp": "2026-04-01T01:29:34.802Z",
"feature": "hbrt",
"phase": "do",
"action": "updated"
},
{
"timestamp": "2026-04-01T01:30:04.100Z",
"feature": "hbrt",
"phase": "do",
"action": "updated"
},
{
"timestamp": "2026-04-01T01:30:25.114Z",
"feature": "hbrt",
"phase": "do",
"action": "updated"
}
]
}