Skip to content

feature(op): E2E tests, full-signature callables, struct serialization (Phase 6) - #202

Merged
David-Noble-at-work merged 3 commits into
developfrom
feature/mem-resource-phase-6
Mar 8, 2026
Merged

David-Noble-at-work merged 3 commits into
developfrom
feature/mem-resource-phase-6

Conversation

@David-Noble-at-work

Copy link
Copy Markdown
Contributor

Summary

  • Immediate bridge callable support — callNonVariadic in receiver_reflect.go detects starlark.Callable values targeting func-typed Go params and adapts via buildCallableFunc. Thread passed through from the builtinFunc closure.
  • Full-signature callable matching — removed Actor function, +devlore:callable swallow=stack annotation, and arity truncation. The Starlark callable must match the full Go func signature. Updated starcode/provider.go and all test callables from 3-param to 4-param.
  • Full-fidelity struct serialization — FormatLiteral now handles *starlarkstruct.Struct as dict literals with sorted keys, enabling Resources captured in closures to serialize with full fidelity.
  • 4 E2E test scripts exercising the full WalkTree callable flow through immediate and planned modes.
  • Phase documents — created docs/plans/mem-resource/phase-0.md through phase-7.md. Updated master plan to remove stale swallow/truncation references.

Test plan

  • TestWalkTree — immediate mode: walk temp dir with named def, collect+sort paths, verify 4 entries
  • TestWalkTreePlanned — planned mode: plan.file.walk_tree with callable reducer, verify 1 graph node
  • TestWalkTreeGitignore — .gitignore filtering: *.log excluded, .gitignore itself included, 3 entries
  • TestWalkTreeClosure — def capturing closure variable (ext = ".py"), filters to 2 .py files
  • TestFormatLiteral_Struct / NestedStruct / EmptyStruct — struct→dict literal serialization
  • TestWalkTreeAction_Integration / DryRun — 4-param callables through reflected actions
  • make test passes (full suite, 70+ packages)

David Noble added 3 commits March 7, 2026 17:58
…n (Phase 6)

Phase 6 — E2E tests + two correctness fixes + phase documents:

Immediate bridge callable support:
- callNonVariadic detects starlark.Callable values targeting func-typed
  Go params and adapts them via buildCallableFunc (full-signature
  Go↔Starlark marshaling). Thread passed through from builtinFunc closure.
- Blank import of mem package in test runner for callable extractor
  registration (needed by planned mode ExtractCallable).

Full-signature callable matching (Issue #1):
- Removed Actor convenience function and +devlore:callable swallow=stack
  annotation. The callable must match the full Go Reducer signature
  (initial, resource, relativePath, stack).
- Removed arity truncation from buildCallableFunc — all Go args passed
  to Starlark.
- Updated starcode/provider.go Actor usage to full Reducer signature.
- All test callables updated from 3-param to 4-param.

Full-fidelity struct serialization (Issue #2):
- FormatLiteral now handles *starlarkstruct.Struct values by serializing
  as dict literals with sorted keys. Enables Resources captured in
  closures to be serialized with full fidelity.
- 3 new tests: Struct, NestedStruct, EmptyStruct.

E2E test scripts:
- test_walk_tree.star: immediate mode — walk temp dir, collect+sort paths
- test_walk_tree_planned.star: planned mode — plan.file.walk_tree
- test_walk_tree_gitignore.star: .gitignore filtering
- test_walk_tree_closure.star: def capturing closure variable (ext=".py")

Phase documents:
- Created docs/plans/mem-resource/phase-0.md through phase-7.md
- Updated master plan: removed stale arity truncation/swallow references,
  updated current state, Phase 6 marked done
…n (Phase 6)

Phase 6 — E2E tests + two correctness fixes + phase documents:

Immediate bridge callable support:
- callNonVariadic detects starlark.Callable values targeting func-typed
  Go params and adapts them via buildCallableFunc (full-signature
  Go↔Starlark marshaling). Thread passed through from builtinFunc closure.
- Blank import of mem package in test runner for callable extractor
  registration (needed by planned mode ExtractCallable).

Full-signature callable matching (Issue #1):
- Removed Actor convenience function and +devlore:callable swallow=stack
  annotation. The callable must match the full Go Reducer signature
  (initial, resource, relativePath, stack).
- Removed arity truncation from buildCallableFunc — all Go args passed
  to Starlark.
- Updated starcode/provider.go Actor usage to full Reducer signature.
- All test callables updated from 3-param to 4-param.

Full-fidelity struct serialization (Issue #2):
- FormatLiteral now handles *starlarkstruct.Struct values by serializing
  as dict literals with sorted keys. Enables Resources captured in
  closures to be serialized with full fidelity.
- 3 new tests: Struct, NestedStruct, EmptyStruct.

E2E test scripts:
- test_walk_tree.star: immediate mode — walk temp dir, collect+sort paths
- test_walk_tree_planned.star: planned mode — plan.file.walk_tree
- test_walk_tree_gitignore.star: .gitignore filtering
- test_walk_tree_closure.star: def capturing closure variable (ext=".py")

Phase documents:
- Created docs/plans/mem-resource/phase-0.md through phase-7.md
- Updated master plan: removed stale arity truncation/swallow references,
  updated current state, Phase 6 marked done
…/devlore-cli into feature/mem-resource-phase-6
@David-Noble-at-work
David-Noble-at-work merged commit 2123c2b into develop Mar 8, 2026
2 checks passed
@David-Noble-at-work
David-Noble-at-work deleted the feature/mem-resource-phase-6 branch March 8, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant