feat: aegis workflow prereqs (constitution + swe role)#23
Merged
electronicBlacksmith merged 8 commits intomainfrom Apr 12, 2026
Merged
feat: aegis workflow prereqs (constitution + swe role)#23electronicBlacksmith merged 8 commits intomainfrom
electronicBlacksmith merged 8 commits intomainfrom
Conversation
…dSections buildEvolvedSections() was emitting a # Constitution heading from evolved.constitution, which reads the same phantom-config/constitution.md file. Now that buildConstitution() handles injection unconditionally, the evolved path would duplicate the content. Removed to avoid double injection and wasted context tokens.
…t assertion Pass evolution config_dir through AgentRuntime to assemblePrompt so constitution injection uses the correct path even with non-default config directories. Strengthen the "omits when missing" test to assert on the heading itself rather than a specific content substring.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
phantom-config/constitution.mdconstitution.mdas a top-level prompt section after security boundaries (Layer 1)buildEvolvedSections(was reading the same file twice)workflow_specfield to role config schema (z.string().default(""))configDirthroughAgentRuntimeso constitution injection uses the correct path with non-default config directoriesWhy
Layers 1 and 2 of the AEGIS four-layer enforcement wall live in the Phantom repo. Phantom can't deliver code to AEGIS under the strict workflow until it carries those rules in its system prompt every session. Design doc:
docs/plans/2026-04-11-aegis-github-workflow-design.md.What changed
phantom-config/constitution.md- principle 9 addedsrc/agent/prompt-assembler.ts-configDirparam,buildConstitution()helper, removed evolved duplicatesrc/agent/runtime.ts-setConfigDir()method, passes configDir to assemblePromptsrc/index.ts- wires evolution config_dir to runtimesrc/roles/types.ts-workflow_specfield onRoleConfigSchemasrc/roles/loader.ts-buildSystemPromptSectionappends# Workflowheadingconfig/roles/swe.yaml- full AEGIS workflow spec (cardinal git rules, branch model, label taxonomy, hard limits, sensitive paths, promotion model, hotfix path, issues workflow).gitignore- ignore docs/plans/Test plan
bun test- 1067 tests pass (5 new tests added)bun run lint- cleanbun run typecheck- clean