-
Notifications
You must be signed in to change notification settings - Fork 0
Initialize Prime Security repository with self-organizing multi-agent framework #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
1f143d7
67e4fd3
ad13aed
d3ac7e9
029b721
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| module.exports = { | ||
| parser: '@typescript-eslint/parser', | ||
| extends: [ | ||
| 'eslint:recommended', | ||
| 'plugin:@typescript-eslint/recommended' | ||
| ], | ||
| parserOptions: { | ||
| ecmaVersion: 2022, | ||
| sourceType: 'module', | ||
| project: './tsconfig.json' | ||
| }, | ||
| rules: { | ||
| '@typescript-eslint/explicit-function-return-type': 'warn', | ||
| '@typescript-eslint/no-explicit-any': 'error', | ||
| '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], | ||
| 'no-console': ['warn', { allow: ['warn', 'error'] }] | ||
| } | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| name: CI/CD Pipeline | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, develop, 'copilot/**' ] | ||
| pull_request: | ||
| branches: [ main, develop ] | ||
|
|
||
| jobs: | ||
| lint: | ||
| name: Lint Code | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '18' | ||
| cache: 'npm' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Run linter | ||
| run: npm run lint | ||
|
|
||
| test: | ||
| name: Run Tests | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '18' | ||
| cache: 'npm' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Run tests | ||
| run: npm test -- --coverage | ||
|
|
||
| - name: Upload coverage | ||
| uses: codecov/codecov-action@v3 | ||
| with: | ||
| files: ./coverage/lcov.info | ||
| fail_ci_if_error: false | ||
|
|
||
| build: | ||
| name: Build | ||
| runs-on: ubuntu-latest | ||
| needs: [lint, test] | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '18' | ||
| cache: 'npm' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Build | ||
| run: npm run build | ||
|
|
||
| - name: Upload build artifacts | ||
| uses: actions/upload-artifact@v3 | ||
| with: | ||
| name: dist | ||
| path: dist/ | ||
|
|
||
| compliance-check: | ||
| name: Core Directive Compliance | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Check Core Directive exists | ||
| run: | | ||
| if [ ! -f "CORE_DIRECTIVE.md" ]; then | ||
| echo "Error: CORE_DIRECTIVE.md not found" | ||
| exit 1 | ||
| fi | ||
| echo "✓ Core Directive found" | ||
|
|
||
| - name: Check architecture documentation | ||
| run: | | ||
| if [ ! -f "notes/ARCHITECTURE_DRAFT.md" ]; then | ||
| echo "Warning: ARCHITECTURE_DRAFT.md not found" | ||
| else | ||
| echo "✓ Architecture documentation found" | ||
| fi | ||
|
|
||
| - name: Verify no secrets in code | ||
| run: | | ||
| if grep -r "api[_-]key\|password\|secret" --include="*.ts" --include="*.js" src/ 2>/dev/null; then | ||
| echo "Warning: Potential secrets found in code" | ||
| else | ||
| echo "✓ No obvious secrets detected" | ||
| fi | ||
|
Comment on lines
+111
to
+117
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # Dependencies | ||
| node_modules/ | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| package-lock.json | ||
| yarn.lock | ||
|
|
||
| # Python | ||
| __pycache__/ | ||
| *.py[cod] | ||
| *$py.class | ||
| *.so | ||
| .Python | ||
| env/ | ||
| venv/ | ||
| ENV/ | ||
| .venv | ||
|
|
||
| # Build outputs | ||
| dist/ | ||
| build/ | ||
| *.egg-info/ | ||
| .eggs/ | ||
| lib/ | ||
| lib64/ | ||
|
|
||
| # IDE | ||
| .vscode/ | ||
| .idea/ | ||
| *.swp | ||
| *.swo | ||
| *~ | ||
| .DS_Store | ||
|
|
||
| # Testing | ||
| .coverage | ||
| .pytest_cache/ | ||
| coverage/ | ||
| *.cover | ||
| .hypothesis/ | ||
| htmlcov/ | ||
|
|
||
| # Logs | ||
| logs/ | ||
| *.log | ||
|
|
||
| # Environment variables | ||
| .env | ||
| .env.local | ||
| .env.*.local | ||
|
|
||
| # Temporary files | ||
| tmp/ | ||
| temp/ | ||
| *.tmp | ||
| *.bak | ||
|
|
||
| # OS | ||
| .DS_Store | ||
| Thumbs.db |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "semi": true, | ||
| "trailingComma": "es5", | ||
| "singleQuote": true, | ||
| "printWidth": 100, | ||
| "tabWidth": 2 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,153 @@ | ||
| # Contributing to Prime Security | ||
|
|
||
| Thank you for your interest in contributing to Prime Security (Under Pressure Looming)! This project implements a self-organizing, multi-agent security framework governed by the Core Directive. | ||
|
|
||
| ## Core Directive Compliance | ||
|
|
||
| **All contributions must align with the [Core Directive](./CORE_DIRECTIVE.md).** This is the foundational, non-negotiable requirement for any code or documentation changes. | ||
|
|
||
| Before submitting: | ||
| 1. Read the [Core Directive](./CORE_DIRECTIVE.md) | ||
| 2. Review the [Architecture](./notes/ARCHITECTURE_DRAFT.md) | ||
| 3. Understand the [Research Foundations](./UNDER_PRESSURE_LOOMING.md) | ||
|
|
||
| ## Getting Started | ||
|
|
||
| 1. Fork the repository | ||
| 2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/Prime-security.git` | ||
| 3. Install dependencies: `npm install` | ||
| 4. Create a branch: `git checkout -b feature/your-feature-name` | ||
|
|
||
| ## Development Workflow | ||
|
|
||
| ### Building | ||
| ```bash | ||
| npm run build | ||
| ``` | ||
|
|
||
| ### Testing | ||
| ```bash | ||
| npm test # Run all tests | ||
| npm run test:watch # Watch mode | ||
| npm run test:coverage # With coverage | ||
| ``` | ||
|
|
||
| ### Linting | ||
| ```bash | ||
| npm run lint # Check for issues | ||
| npm run lint:fix # Auto-fix issues | ||
| npm run format # Format with Prettier | ||
| ``` | ||
|
|
||
| ## Code Standards | ||
|
|
||
| ### TypeScript | ||
| - Use strict TypeScript | ||
| - Prefer interfaces over types where appropriate | ||
| - Document public APIs with JSDoc comments | ||
| - No `any` types (use `unknown` if truly needed) | ||
|
|
||
| ### Security | ||
| - All inputs must be validated | ||
| - Use provided crypto primitives from `src/security/crypto.ts` | ||
| - Log security-relevant events via `auditLogger` | ||
| - Never commit secrets or credentials | ||
|
|
||
| ### Testing | ||
| - Write tests for new functionality | ||
| - Maintain >70% code coverage | ||
| - Test both success and failure paths | ||
| - Use descriptive test names | ||
|
|
||
| ### Documentation | ||
| - Update README.md if adding user-facing features | ||
| - Document architecture changes in `notes/ARCHITECTURE_DRAFT.md` | ||
| - Add inline comments for complex logic | ||
| - Update UNDER_PRESSURE_LOOMING.md for new research/tools | ||
|
|
||
| ## Pull Request Process | ||
|
|
||
| 1. **Create descriptive PR title**: `feat: add X` or `fix: resolve Y` | ||
| 2. **Reference issues**: Link to related issues | ||
| 3. **Pass CI checks**: All tests and lints must pass | ||
| 4. **Core Directive compliance**: Automated check will verify | ||
| 5. **Code review**: At least one approval required | ||
| 6. **Documentation**: Update relevant docs | ||
|
|
||
| ### PR Template | ||
| ```markdown | ||
| ## Description | ||
| Brief description of changes | ||
|
|
||
| ## Core Directive Compliance | ||
| - [ ] Changes align with Core Directive principles | ||
| - [ ] Security-first approach maintained | ||
| - [ ] Audit logging added where appropriate | ||
| - [ ] No compromise of user data or privacy | ||
|
|
||
| ## Testing | ||
| - [ ] Unit tests added/updated | ||
| - [ ] Integration tests pass | ||
| - [ ] Manual testing performed | ||
|
|
||
| ## Documentation | ||
| - [ ] Code comments added | ||
| - [ ] README updated (if needed) | ||
| - [ ] Architecture doc updated (if needed) | ||
| ``` | ||
|
|
||
| ## Module Development | ||
|
|
||
| When adding new modules: | ||
|
|
||
| 1. **Register in Module Registry** | ||
| ```typescript | ||
| import { registry, Module } from './registry'; | ||
|
|
||
| const myModule: Module = { | ||
| name: 'my-module', | ||
| version: '0.1.0', | ||
| dependencies: ['core-security'], | ||
| init: async () => { /* ... */ }, | ||
| start: async () => { /* ... */ }, | ||
| stop: async () => { /* ... */ } | ||
| }; | ||
|
|
||
| registry.register(myModule); | ||
| ``` | ||
|
|
||
| 2. **Add to System Blueprint** | ||
| - Update `src/autonomic/dna.ts` if module is core | ||
|
|
||
| 3. **Add Compliance Checks** | ||
| - Register checks in `src/governance/compliance.ts` | ||
|
|
||
| 4. **Document in Architecture** | ||
| - Add module description to `notes/ARCHITECTURE_DRAFT.md` | ||
|
|
||
| ## Security Vulnerabilities | ||
|
|
||
| **DO NOT** open public issues for security vulnerabilities. | ||
|
|
||
| Instead: | ||
| 1. Email security concerns to project maintainers | ||
| 2. Provide detailed description | ||
| 3. Allow time for patch development | ||
| 4. Coordinate disclosure timing | ||
|
|
||
| ## Community Guidelines | ||
|
|
||
| - Be respectful and inclusive | ||
| - Assume good intentions | ||
| - Provide constructive feedback | ||
| - Help others learn and grow | ||
|
|
||
| ## Questions? | ||
|
|
||
| - Check existing [Issues](https://github.com/dshvvvshr/Prime-security/issues) | ||
| - Review [Architecture Documentation](./notes/ARCHITECTURE_DRAFT.md) | ||
| - Read [Research Foundations](./UNDER_PRESSURE_LOOMING.md) | ||
|
|
||
| --- | ||
|
|
||
| By contributing, you agree that your contributions will be licensed under the MIT License. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The no-console ESLint rule allows 'warn' and 'error' but the codebase uses console.log extensively in examples/basic-usage.ts and the persist method uses console.error. While this is appropriate for the example file and audit logging, consider documenting the rationale for console usage or using a proper logging framework that can be configured for different environments.