Skip to content

Commit 152b380

Browse files
author
jovanSAPFIONEER
committed
feat: Phase 4 Behavioral Control Plane (v3.3.0)
- lib/fsm-journey.ts: JourneyFSM, ToolAuthorizationMatrix, ComplianceMiddleware, ComplianceViolationError, createDeliveryPipelineFSM, WORKFLOW_STATES - lib/compliance-monitor.ts: ComplianceMonitor with async polling loop, RESPONSE_TIMEOUT, JOURNEY_TIMEOUT, TURN_TAKING, TOOL_ABUSE violation detection - lib/mcp-blackboard-tools.ts: BlackboardMCPTools, registerBlackboardTools, BLACKBOARD_TOOL_DEFINITIONS (5 MCP-compatible tool definitions) - index.ts: Phase 4 exports wired in - test-phase4.ts: 147 tests covering all Phase 4 modules - README.md: Phase 4 features, usage example, updated test count (462) - SKILL.md: Phase 4 section + updated description - CONTRIBUTING.md, SECURITY.md: updated for v3.3.0 - package.json: test:phase4 + test:all includes phase4, version 3.3.0 Total tests: 462 passing (79 + 33 + 139 + 64 + 147)
1 parent cca44d8 commit 152b380

File tree

11 files changed

+2125
-19
lines changed

11 files changed

+2125
-19
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Unsolicited PRs without a linked, approved issue will be closed.
1616

1717
### Code Quality
1818

19-
- All 251+ existing tests must pass (`npm test`)
19+
- All 462+ existing tests must pass (`npm run test:all`)
2020
- Zero TypeScript compile errors (`npx tsc --noEmit`)
2121
- New features must include tests with >90% branch coverage
2222
- Follow existing code style and patterns
@@ -41,7 +41,7 @@ Unsolicited PRs without a linked, approved issue will be closed.
4141
2. Implement your change with tests
4242
3. Run the full test suite:
4343
```bash
44-
npm test
44+
npm run test:all
4545
npx tsc --noEmit
4646
```
4747
4. Open a PR referencing the approved issue
@@ -78,7 +78,8 @@ Unsolicited PRs without a linked, approved issue will be closed.
7878
git clone https://github.com/jovanSAPFIONEER/Network-AI.git
7979
cd Network-AI
8080
npm install
81-
npm test # Run all 251 tests
81+
npm run test:all # Run all 462 tests (5 suites)
82+
npm run test:phase4 # Phase 4 behavioral control plane tests only
8283
npx tsc --noEmit # Type-check
8384
```
8485

SECURITY.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44

55
| Version | Supported |
66
|---------|-----------|
7-
| 3.2.x | Yes (latest) |
8-
| 3.1.x | Security fixes only |
9-
| 3.0.x | No |
10-
| < 3.0 | No |
11-
12-
## Reporting a Vulnerability
7+
| 3.3.x | Yes (latest) |
8+
| 3.2.x | Security fixes only |
9+
| 3.1.x | No |
10+
| 3.0.x | No |
11+
| < 3.0 | No |
1312

1413
**Do NOT open a public GitHub issue for security vulnerabilities.**
1514

@@ -32,12 +31,14 @@ Network-AI includes built-in security features:
3231
- **Input validation** on all 20+ public API entry points
3332
- **Secure audit logging** with tamper-resistant event trails
3433
- **Justification hardening** (v3.2.1) -- prompt-injection detection (16 patterns), keyword-stuffing defense, repetition/padding detection, structural coherence validation
34+
- **FSM Behavioral Control Plane** (v3.3.0) -- state-scoped agent and tool authorization via `JourneyFSM` and `ToolAuthorizationMatrix`; unauthorized actions blocked with `ComplianceViolationError`
35+
- **ComplianceMonitor** (v3.3.0) -- real-time agent behavior surveillance with configurable violation policies, severity classification, and async audit loop
3536

3637
## Security Scan Results
3738

3839
- **VirusTotal**: Benign (0/64 engines)
3940
- **OpenClaw Scanner**: Benign, HIGH CONFIDENCE
40-
- **CodeQL**: v3.2.10 -- all fixable alerts resolved; unused imports cleaned; false-positive detection patterns dismissed
41+
- **CodeQL**: v3.3.0 -- all fixable alerts resolved; unused imports cleaned; false-positive detection patterns dismissed
4142
- **Snyk**: All High/Medium findings resolved in v3.0.3
4243

4344
## Disclosure Policy

index.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,6 +2176,50 @@ export {
21762176
TimeoutError,
21772177
} from './lib/errors';
21782178

2179+
// ============================================================================
2180+
// Phase 4: Behavioral Control Plane
2181+
// ============================================================================
2182+
2183+
// FSM Journey Layer
2184+
export {
2185+
JourneyFSM,
2186+
ToolAuthorizationMatrix,
2187+
ComplianceMiddleware,
2188+
ComplianceViolationError,
2189+
createDeliveryPipelineFSM,
2190+
WORKFLOW_STATES,
2191+
} from './lib/fsm-journey';
2192+
export type {
2193+
WorkflowStateDefinition,
2194+
StateTransition,
2195+
TransitionResult,
2196+
ComplianceCheckResult,
2197+
JourneyFSMOptions,
2198+
} from './lib/fsm-journey';
2199+
2200+
// Real-Time Compliance Monitor
2201+
export { ComplianceMonitor } from './lib/compliance-monitor';
2202+
export type {
2203+
ComplianceViolation,
2204+
ViolationType,
2205+
AgentAction,
2206+
AgentMonitorConfig,
2207+
ComplianceMonitorOptions,
2208+
} from './lib/compliance-monitor';
2209+
2210+
// MCP Blackboard Tool Bindings
2211+
export {
2212+
BlackboardMCPTools,
2213+
registerBlackboardTools,
2214+
BLACKBOARD_TOOL_DEFINITIONS,
2215+
} from './lib/mcp-blackboard-tools';
2216+
export type {
2217+
MCPToolDefinition,
2218+
MCPJsonSchema,
2219+
BlackboardToolResult,
2220+
IBlackboard,
2221+
} from './lib/mcp-blackboard-tools';
2222+
21792223
/**
21802224
* Factory function for creating a configured SwarmOrchestrator instance.
21812225
*

0 commit comments

Comments
 (0)