[AAASM-2299] ✨ (scenarios): Add policy-enforcement/node/ TypeScript implementation#29
Merged
Chisanan232 merged 7 commits intoJun 1, 2026
Conversation
Contributor
Author
Code Review — Claude CodeCI status
Functional CI is green. Scope completenessVerified against AAASM-2299 ticket requirements. All 7 expected Node.js files are present:
Note on diff size: The PR diff currently shows the Python/shared files from PR #26 as well, since this branch was stacked on top of that branch and #26 has not yet merged to master. This is expected stacking behaviour — the extra files will disappear from the diff once PR #26 merges first. The net-new scope of this PR is solely the Code quality notes
Verdict✅ Ready to merge (after PR #26 merges first). All functional CI green, AAASM-2299 scope fully covered. |
4 tasks
56a66ac to
96be46a
Compare
|
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.


What changed
Adds the Node.js/TypeScript sub-project for the
scenarios/policy-enforcement/scenario. Reads the sharedpolicy.yamlat runtime usingjs-yaml, evaluates allow/deny rules before each tool call, and demonstrates the full ALLOW/DENY output cycle.Files added (
scenarios/policy-enforcement/node/):src/policy.ts— loads../policy.yamlusing js-yaml; exportsevaluate(),POLICY_RULES,DEFAULT_ACTIONsrc/tools.ts— typed tool functions returningToolResult(safe + risky variants)src/index.ts— main demo: prints policy summary, then runs 4 governed tool callstests/smoke.test.ts— 10 vitest tests covering policy rules, default deny, and tool outputsAll fully offline — no gateway or API key required.
Related ticket
Closes AAASM-2299
How to verify
Checklist
[AAASM-XXXX] <GitEmoji> (<scope>): <summary>.envfiles committed