Skip to content

Add writ deployment infrastructure and rename clifactory to cli - #2

Merged
David-Noble-at-work merged 2 commits into
developfrom
feature/writ-deployment-tree
Jan 23, 2026
Merged

David-Noble-at-work merged 2 commits into
developfrom
feature/writ-deployment-tree

Conversation

@David-Noble-at-work

Copy link
Copy Markdown
Contributor

Summary

  • Rename internal/clifactory to internal/cli for consistency
  • Add complete writ deployment infrastructure: segment matching, deployment tree, executor, state tracking, receipts, status checking
  • Add shared CLI utilities: viper config, help, output formatting
  • Consolidate schemas: lore-config + writ-config → devlore-config
  • Remove generated man pages from version control

Changes

  • internal/writ/ — Full command implementations (add, remove, upgrade, status, adopt, repo subcommands)
  • internal/writ/segment/ — Platform detection and directory matching
  • internal/writ/tree/ — Deployment tree construction (OpLink, OpExpand, OpDecrypt, OpCopy)
  • internal/writ/exec/ — File operation execution with conflict resolution
  • internal/writ/state/ — State file with age-based signatures
  • internal/writ/status/ — Status checking utilities
  • internal/writ/receipt/ — Checksums and receipt management
  • internal/cli/ — Renamed from clifactory, added viper and output utilities

Test plan

  • go build ./cmd/writ compiles
  • go test ./internal/writ/... passes
  • writ add --dry-run all noblefactor shows correct deployment tree

David Noble added 2 commits January 21, 2026 21:27
Core packages:
- internal/cli: Renamed from clifactory for cleaner imports
  - Added help.go (git-style man page help)
  - Added viper.go (shared configuration initialization)

Writ subpackages:
- internal/writ/segment: Platform segmentation matching
- internal/writ/tree: Deployment tree builder
- internal/writ/exec: File operation execution
- internal/writ/state: Deployment state tracking
- internal/writ/status: Status checking
- internal/writ/receipt: Checksum and receipt handling

Commands implemented:
- writ add: Deploy projects with symlinks/templates/secrets
- writ remove: Remove deployed files with drift detection
- writ upgrade: Regenerate copied files from sources
- writ status: Show deployment status with drift detection
- writ adopt: Move files into repo and create symlinks
- writ repo: Manage layered repositories (init/add/list/remove)

Schema:
- Consolidated to single devlore-config schema
Man pages and shell completions are generated at runtime via
`lore man --generate` and `lore completion`. Added to .gitignore.
@David-Noble-at-work
David-Noble-at-work merged commit ee692c7 into develop Jan 23, 2026
@David-Noble-at-work
David-Noble-at-work deleted the feature/writ-deployment-tree branch January 31, 2026 03:57
David-Noble-at-work pushed a commit that referenced this pull request Mar 8, 2026
…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
David-Noble-at-work pushed a commit that referenced this pull request Mar 8, 2026
…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
David-Noble-at-work added a commit that referenced this pull request Mar 8, 2026
…n (Phase 6) (#202)

* feature(op): E2E tests, full-signature callables, struct serialization (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

* feature(op): E2E tests, full-signature callables, struct serialization (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

---------

Co-authored-by: David Noble <[email protected]>
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