refactor: extract shared utilities from duplicated patterns#4
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
refactor: extract shared utilities from duplicated patterns#4devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
- lib/paths.mjs: shared root directory resolution - lib/meta.mjs: single source of truth from ontology/graphite.yaml - lib/envelope.mjs: envelope creation and validation from schema - lib/boundary.mjs: non-adoption boundary checks from meta - lib/index.mjs: barrel export - Refactored scripts/check.mjs to use shared lib (meta, boundary, envelope) - Added scripts/validate-consistency.mjs to detect cross-file drift - Fixed content drift: README and boundary spec now aligned with YAML - Added yaml dependency for ontology parsing - Added .gitignore for node_modules Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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
The non-adoption boundary rules, adoption requirements, and protocol metadata were duplicated across
README.md,spec/non_adoption_boundary.md,ontology/graphite.yaml,protocol/envelope.schema.json, andspec/graphite.protocol.md— with content drift already present (e.g. README used "use" where YAML says "invoke").New
lib/modules makeontology/graphite.yamlandenvelope.schema.jsonthe single programmatic source of truth:scripts/check.mjsnow uses the shared lib instead of only checking file existence — it also validates meta loading, boundary rules, and envelope creation/validation.New
scripts/validate-consistency.mjs(npm run validate) detects cross-file drift:non_adoption_boundaryspec/non_adoption_boundary.md↔ YAMLnon_adoption_boundaryspec/adoption_gate.md↔ YAMLadoption.requires_signed_decisionspec/graphite.protocol.mdprotocol prefix ↔envelope.schema.jsonpatternFixed 3 existing drifts found by the validator:
spec/non_adoption_boundary.md: added the 3 YAML boundary rules that were missing from the "Do not use" blockCI: added
npm cistep to workflow since the project now has a runtime dependency (yaml).Link to Devin session: https://app.devin.ai/sessions/a98b817d59c748e1b0e6949367039970
Requested by: @cemphlvn