Skip to content

feat(process): honor entry-declared security config on process start - #555

Merged
wolfy-j merged 3 commits into
mainfrom
feat/process-entry-security
Aug 8, 2026
Merged

feat(process): honor entry-declared security config on process start#555
wolfy-j merged 3 commits into
mainfrom
feat/process-entry-security

Conversation

@wolfy-j

@wolfy-j wolfy-j commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Problem

Lua process entries currently discard their security: block. Functions and supervised services already apply intrinsic entry security through WithSecurityConfig; processes are the remaining executable entry type that cannot declare an actor or policy scope.

Change

  • Add Security *security.Config to source and bytecode process configs and to process factory metadata.
  • Preserve the typed config through add, update, and invalidation factory registration.
  • Apply it to the prepared process frame before standard or terminal hosts submit the process to the scheduler.

Semantics

This uses the existing function-entry contract and resolver:

  • data.security is intrinsic to the process and applies to every launch path.
  • A declared actor replaces an inherited or launch-provided actor; omitting the actor preserves the inherited actor.
  • Declared policies and groups merge with the inherited or launch-provided scope.
  • No security declaration is a no-op.

This is distinct from PR #558: meta.command.security is a trusted CLI-launch overlay, while this PR provides the process entry’s intrinsic security. Combined-tree tests verify that launch scope is preserved, intrinsic policy scope is merged, and the intrinsic actor wins. Once #558 lands, both paths resolve through the same system/security.ResolveConfigPairs implementation.

Verification

Copilot AI lite review requested due to automatic review settings August 6, 2026 01:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR ensures entry-declared security: configuration for process entries is preserved and applied at process start, bringing process behavior in line with functions and supervised services.

Changes:

  • Extends process metadata (process.Meta) and Lua process entry configs to carry Security *security.Config.
  • Threads parsed security config through the Lua process component factory registration so hosts can access it.
  • Applies WithSecurityConfig to the process frame context in both service/host and service/terminal, and adds a host-level test covering actor + policy application.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
service/terminal/host.go Applies entry-declared security config to terminal-launched process frame contexts before scheduling.
service/host/host.go Applies entry-declared security config to standard host process frame contexts before scheduling.
service/host/host_test.go Adds test asserting entry security actor + policies are visible/evaluable in the process frame context.
runtime/lua/component/process/manager.go Propagates parsed Security from Lua process configs into FactoryEntry.Meta during factory registration/updates/invalidation.
runtime/lua/component/process/manager_test.go Updates test helper call signature for registerFactory to include the new security parameter.
api/runtime/lua/config.go Adds security field to ProcessConfig and BytecodeProcessConfig to support security: blocks in manifests.
api/process/process.go Extends process.Meta to include Security *security.Config so hosts can apply it at start.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread service/host/host_test.go Outdated
})
require.NoError(t, err)

<-done
wolfy-j added 3 commits August 8, 2026 18:20
Process entries silently dropped their security block: ProcessConfig and
BytecodeProcessConfig had no Security field, and the process component
registered factories with method-only metadata. Function entries and
supervised services already apply entry security via WithSecurityConfig,
leaving processes as the one component type without declared capabilities.

Security now flows from the entry config through process.Meta into both
host Run paths (service host and terminal host), applied to the process
frame context before scheduling. Semantics match the function path:
a declared actor replaces the inherited one, declared policies merge
onto the inherited scope.

Entries without a security block are unaffected; meta.Security is nil
and the frame context is unchanged.
@wolfy-j
wolfy-j force-pushed the feat/process-entry-security branch from badbcb2 to 016d229 Compare August 8, 2026 22:25
@wolfy-j
wolfy-j merged commit bd630d0 into main Aug 8, 2026
4 checks passed
@wolfy-j
wolfy-j deleted the feat/process-entry-security branch August 8, 2026 23:04
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.

3 participants