arcvision 0.2.21 → 0.2.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/bin/arcvision.js +1 -1
  2. package/package.json +10 -3
  3. package/src/core/change-evaluator.js +38 -9
  4. package/src/index.js +208 -97
  5. package/.arcvision/logs/errors.log +0 -7
  6. package/arcvision_context/architecture.authority.ledger.json +0 -26
  7. package/dist/index.js +0 -68468
  8. package/schema/arcvision_context_schema_v1.json +0 -356
  9. package/test-block-functionality.js +0 -40
  10. package/test-dev-project/.arcvision/invariants.json +0 -19
  11. package/test-dev-project/arcvision_context/README.md +0 -93
  12. package/test-dev-project/arcvision_context/architecture.authority.ledger.json +0 -45
  13. package/test-dev-project/arcvision_context/arcvision.context.json +0 -1023
  14. package/test-dev-project/src/core/data-service.js +0 -0
  15. package/test-dev-project/src/ui/user-profile.js +0 -0
  16. package/test-dev-project/src/utils/helpers.js +0 -0
  17. package/test_repos/allowed-clean-architecture/.arcvision/invariants.json +0 -57
  18. package/test_repos/allowed-clean-architecture/adapters/controllers/UserController.js +0 -95
  19. package/test_repos/allowed-clean-architecture/adapters/http/HttpServer.js +0 -78
  20. package/test_repos/allowed-clean-architecture/application/dtos/CreateUserRequest.js +0 -37
  21. package/test_repos/allowed-clean-architecture/application/services/UserService.js +0 -61
  22. package/test_repos/allowed-clean-architecture/arcvision_context/README.md +0 -93
  23. package/test_repos/allowed-clean-architecture/arcvision_context/arcvision.context.json +0 -2796
  24. package/test_repos/allowed-clean-architecture/domain/interfaces/UserRepository.js +0 -25
  25. package/test_repos/allowed-clean-architecture/domain/models/User.js +0 -39
  26. package/test_repos/allowed-clean-architecture/index.js +0 -45
  27. package/test_repos/allowed-clean-architecture/infrastructure/database/DatabaseConnection.js +0 -56
  28. package/test_repos/allowed-clean-architecture/infrastructure/repositories/InMemoryUserRepository.js +0 -61
  29. package/test_repos/allowed-clean-architecture/package.json +0 -15
  30. package/test_repos/blocked-legacy-monolith/.arcvision/invariants.json +0 -78
  31. package/test_repos/blocked-legacy-monolith/arcvision_context/README.md +0 -93
  32. package/test_repos/blocked-legacy-monolith/arcvision_context/arcvision.context.json +0 -2882
  33. package/test_repos/blocked-legacy-monolith/database/dbConnection.js +0 -35
  34. package/test_repos/blocked-legacy-monolith/index.js +0 -38
  35. package/test_repos/blocked-legacy-monolith/modules/emailService.js +0 -31
  36. package/test_repos/blocked-legacy-monolith/modules/paymentProcessor.js +0 -37
  37. package/test_repos/blocked-legacy-monolith/package.json +0 -15
  38. package/test_repos/blocked-legacy-monolith/shared/utils.js +0 -19
  39. package/test_repos/blocked-legacy-monolith/utils/helpers.js +0 -23
  40. package/test_repos/risky-microservices-concerns/.arcvision/invariants.json +0 -69
  41. package/test_repos/risky-microservices-concerns/arcvision_context/README.md +0 -93
  42. package/test_repos/risky-microservices-concerns/arcvision_context/arcvision.context.json +0 -3070
  43. package/test_repos/risky-microservices-concerns/common/utils.js +0 -77
  44. package/test_repos/risky-microservices-concerns/gateways/apiGateway.js +0 -84
  45. package/test_repos/risky-microservices-concerns/index.js +0 -20
  46. package/test_repos/risky-microservices-concerns/libs/deprecatedHelper.js +0 -36
  47. package/test_repos/risky-microservices-concerns/package.json +0 -15
  48. package/test_repos/risky-microservices-concerns/services/orderService.js +0 -42
  49. package/test_repos/risky-microservices-concerns/services/userService.js +0 -48
@@ -1,25 +0,0 @@
1
- // UserRepository Interface - Abstraction for data persistence
2
-
3
- class UserRepository {
4
- async findById(id) {
5
- throw new Error('Method not implemented');
6
- }
7
-
8
- async findByEmail(email) {
9
- throw new Error('Method not implemented');
10
- }
11
-
12
- async save(user) {
13
- throw new Error('Method not implemented');
14
- }
15
-
16
- async update(user) {
17
- throw new Error('Method not implemented');
18
- }
19
-
20
- async delete(id) {
21
- throw new Error('Method not implemented');
22
- }
23
- }
24
-
25
- module.exports = UserRepository;
@@ -1,39 +0,0 @@
1
- // User Domain Entity - Pure business logic without infrastructure concerns
2
-
3
- class User {
4
- constructor(id, name, email) {
5
- this.id = id;
6
- this.name = name;
7
- this.email = email;
8
- this.createdAt = new Date();
9
- }
10
-
11
- static create(name, email) {
12
- const id = this.generateId();
13
- return new User(id, name, email);
14
- }
15
-
16
- static generateId() {
17
- return `user_${Date.now()}_${Math.random().toString(36).substr(2, 5)}`;
18
- }
19
-
20
- updateName(newName) {
21
- this.name = newName;
22
- this.updatedAt = new Date();
23
- }
24
-
25
- updateEmail(newEmail) {
26
- this.email = newEmail;
27
- this.updatedAt = new Date();
28
- }
29
-
30
- isValid() {
31
- return this.name && this.email && this.validateEmail(this.email);
32
- }
33
-
34
- validateEmail(email) {
35
- return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
36
- }
37
- }
38
-
39
- module.exports = User;
@@ -1,45 +0,0 @@
1
- // Main Application Entry Point - Clean Architecture Implementation
2
-
3
- const HttpServer = require('./adapters/http/HttpServer');
4
-
5
- async function main() {
6
- console.log('🚀 Starting Clean Architecture Reference Implementation');
7
- console.log('✅ Following proper architectural boundaries');
8
- console.log('✅ Domain layer isolated from infrastructure');
9
- console.log('✅ Application services orchestrating business logic');
10
- console.log('✅ Adapters depending only on application layer');
11
-
12
- const server = new HttpServer();
13
-
14
- try {
15
- await server.start(3002);
16
- console.log('\n📋 Available Endpoints:');
17
- console.log('POST /api/users - Create user');
18
- console.log('GET /api/users/:id - Get user');
19
- console.log('PUT /api/users/:id - Update user');
20
- console.log('DELETE /api/users/:id - Delete user');
21
- console.log('GET /health - Health check');
22
-
23
- } catch (error) {
24
- console.error('Failed to start server:', error);
25
- process.exit(1);
26
- }
27
- }
28
-
29
- // Handle graceful shutdown
30
- process.on('SIGINT', async () => {
31
- console.log('\nReceived SIGINT. Shutting down gracefully...');
32
- process.exit(0);
33
- });
34
-
35
- process.on('SIGTERM', async () => {
36
- console.log('\nReceived SIGTERM. Shutting down gracefully...');
37
- process.exit(0);
38
- });
39
-
40
- // Start the application
41
- if (require.main === module) {
42
- main();
43
- }
44
-
45
- module.exports = { main };
@@ -1,56 +0,0 @@
1
- // Database Connection Manager
2
-
3
- class DatabaseConnection {
4
- constructor(connectionString) {
5
- this.connectionString = connectionString;
6
- this.connected = false;
7
- }
8
-
9
- async connect() {
10
- // Simulate database connection
11
- console.log(`Connecting to database: ${this.connectionString}`);
12
- this.connected = true;
13
- return this;
14
- }
15
-
16
- async disconnect() {
17
- console.log('Disconnecting from database');
18
- this.connected = false;
19
- }
20
-
21
- isConnected() {
22
- return this.connected;
23
- }
24
-
25
- async query(sql, params = []) {
26
- if (!this.connected) {
27
- throw new Error('Database not connected');
28
- }
29
-
30
- // Simulate query execution
31
- console.log(`Executing query: ${sql}`, params);
32
- return { rows: [], rowCount: 0 };
33
- }
34
-
35
- async execute(sql, params = []) {
36
- if (!this.connected) {
37
- throw new Error('Database not connected');
38
- }
39
-
40
- // Simulate execution
41
- console.log(`Executing: ${sql}`, params);
42
- return { affectedRows: 1 };
43
- }
44
- }
45
-
46
- // Singleton instance
47
- let instance = null;
48
-
49
- function getDatabaseConnection(connectionString = 'sqlite://memory') {
50
- if (!instance) {
51
- instance = new DatabaseConnection(connectionString);
52
- }
53
- return instance;
54
- }
55
-
56
- module.exports = { getDatabaseConnection, DatabaseConnection };
@@ -1,61 +0,0 @@
1
- // In-Memory User Repository Implementation
2
-
3
- const UserRepository = require('../../domain/interfaces/UserRepository');
4
- const User = require('../../domain/models/User');
5
-
6
- class InMemoryUserRepository extends UserRepository {
7
- constructor() {
8
- super();
9
- this.users = new Map();
10
- }
11
-
12
- async findById(id) {
13
- return this.users.get(id) || null;
14
- }
15
-
16
- async findByEmail(email) {
17
- for (const user of this.users.values()) {
18
- if (user.email === email) {
19
- return user;
20
- }
21
- }
22
- return null;
23
- }
24
-
25
- async save(user) {
26
- if (!(user instanceof User)) {
27
- throw new Error('Must save User entity');
28
- }
29
-
30
- this.users.set(user.id, user);
31
- return user;
32
- }
33
-
34
- async update(user) {
35
- if (!(user instanceof User)) {
36
- throw new Error('Must update User entity');
37
- }
38
-
39
- if (!this.users.has(user.id)) {
40
- throw new Error('User not found');
41
- }
42
-
43
- this.users.set(user.id, user);
44
- return user;
45
- }
46
-
47
- async delete(id) {
48
- return this.users.delete(id);
49
- }
50
-
51
- // For testing purposes
52
- clear() {
53
- this.users.clear();
54
- }
55
-
56
- getAll() {
57
- return Array.from(this.users.values());
58
- }
59
- }
60
-
61
- module.exports = InMemoryUserRepository;
@@ -1,15 +0,0 @@
1
- {
2
- "name": "allowed-clean-architecture",
3
- "version": "1.0.0",
4
- "description": "Clean architecture reference implementation for ArcVision testing",
5
- "main": "index.js",
6
- "scripts": {
7
- "start": "node index.js",
8
- "test": "echo \"Error: no test specified\" && exit 1"
9
- },
10
- "dependencies": {
11
- "express": "^4.18.2"
12
- },
13
- "author": "ArcVision Test Suite",
14
- "license": "MIT"
15
- }
@@ -1,78 +0,0 @@
1
- {
2
- "version": "1.0",
3
- "project_specific_invariants": [
4
- {
5
- "id": "no-circular-dependencies",
6
- "system": "blocked-legacy-monolith",
7
- "description": "Circular dependencies between modules are forbidden",
8
- "severity": "block",
9
- "scope": {
10
- "files": ["modules/*"]
11
- },
12
- "rule": {
13
- "type": "dependency",
14
- "condition": {
15
- "forbiddenDependency": {
16
- "from": "emailService.js",
17
- "to": "paymentProcessor.js"
18
- }
19
- }
20
- }
21
- },
22
- {
23
- "id": "no-database-access-from-ui",
24
- "system": "blocked-legacy-monolith",
25
- "description": "UI modules must not directly access database",
26
- "severity": "block",
27
- "scope": {
28
- "files": ["modules/ui/*"]
29
- },
30
- "rule": {
31
- "type": "dependency",
32
- "condition": {
33
- "forbiddenDependency": {
34
- "from": "ui/",
35
- "to": "database/"
36
- }
37
- }
38
- }
39
- },
40
- {
41
- "id": "no-shared-imports-in-modules",
42
- "system": "blocked-legacy-monolith",
43
- "description": "Modules must not import from shared directory",
44
- "severity": "block",
45
- "scope": {
46
- "files": ["modules/*"]
47
- },
48
- "rule": {
49
- "type": "dependency",
50
- "condition": {
51
- "forbiddenDependency": {
52
- "from": "modules/",
53
- "to": "shared/"
54
- }
55
- }
56
- }
57
- },
58
- {
59
- "id": "no-utils-in-database",
60
- "system": "blocked-legacy-monolith",
61
- "description": "Database layer must not depend on utility functions",
62
- "severity": "block",
63
- "scope": {
64
- "files": ["database/*"]
65
- },
66
- "rule": {
67
- "type": "dependency",
68
- "condition": {
69
- "forbiddenDependency": {
70
- "from": "database/",
71
- "to": "utils/"
72
- }
73
- }
74
- }
75
- }
76
- ],
77
- "generated_at": "2026-01-22T12:00:00Z"
78
- }
@@ -1,93 +0,0 @@
1
- # ArcVision System Context Artifact
2
-
3
-
4
- ## What This Is [arcvision.context.json](./arcvision.context.json)
5
-
6
- This file is the **canonical structural context** of this codebase.
7
- It represents how the system actually works — not how it is described.
8
-
9
- It is generated directly from source code by ArcVision.
10
-
11
- ## What This Replaces
12
-
13
- This artifact replaces:
14
- - Manual repository scanning
15
- - Tribal knowledge held by senior engineers
16
- - Re-explaining the system to new developers
17
- - Re-prompting LLMs with partial or incorrect context
18
- - Guessing blast radius of changes
19
-
20
- ## When You Must Use This
21
-
22
- Use this artifact when:
23
- - Onboarding a new developer
24
- - Prompting an AI assistant about this codebase
25
- - Making architectural changes
26
- - Investigating unexpected behavior
27
- - Assessing risk before modifying core modules
28
-
29
- ## What This Artifact Contains
30
-
31
- - Canonical module and dependency graph
32
- - Execution and data flow relationships
33
- - Structural roles (service, store, boundary, etc.)
34
- - Invariants inferred from the system
35
- - Impact metrics (blast radius, coupling)
36
- - Authority core identification
37
- - Hidden coupling detection
38
- - Architectural archetype classification
39
- - Analysis completeness metrics
40
-
41
- ## Determinism & Trust
42
-
43
- - Generated from commit: ae164d81a70b781ce2aa48702aa493acc245b50c
44
- - Generation timestamp: 2026-01-22T06:50:03.448Z
45
- - Tool version: 0.2.14
46
- - Deterministic: same input → same output
47
- - Explicit assumptions listed inside the artifact
48
-
49
- If this artifact conflicts with human memory, **trust the artifact**.
50
-
51
- ## Structural Context Hubs
52
-
53
- The following files have the highest blast radius and represent critical structural hubs in the system:
54
-
55
- - **database/dbConnection.js**
56
- - Blast Radius: 3 files (42.86% of codebase)
57
- - Risk: Changes here may silently propagate across the system.
58
-
59
- - **modules/emailService.js**
60
- - Blast Radius: 2 files (28.57% of codebase)
61
- - Risk: Acts as a coordination layer between components.
62
-
63
- - **modules/paymentProcessor.js**
64
- - Blast Radius: 2 files (28.57% of codebase)
65
- - Risk: Modifications can cause widespread inconsistencies.
66
-
67
-
68
-
69
- ## How to Use With AI
70
-
71
- When prompting AI tools, include this file as system context.
72
- Do not ask the AI to infer architecture without it.
73
-
74
- ## When to Regenerate
75
-
76
- Regenerate this artifact when:
77
- - Core modules change
78
- - New services are added
79
- - Dependency structure shifts
80
-
81
- Run:
82
-
83
- ```
84
- arcvision scan --upload
85
- ```
86
-
87
- ## Source of Truth
88
-
89
- This artifact is the **source of truth** for system structure.
90
- All explanations, decisions, and AI reasoning should reference it.
91
-
92
- Some execution script invocations are dynamically assembled at runtime and may not be statically traceable; such scripts are included
93
- as execution boundaries without guaranteed call-site resolution