janito 0.5.0__py3-none-any.whl → 0.7.0__py3-none-any.whl

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 (110) hide show
  1. janito/__init__.py +0 -47
  2. janito/__main__.py +105 -17
  3. janito/agents/__init__.py +9 -9
  4. janito/agents/agent.py +10 -3
  5. janito/agents/claudeai.py +15 -34
  6. janito/agents/openai.py +5 -1
  7. janito/change/__init__.py +29 -16
  8. janito/change/__main__.py +0 -0
  9. janito/{analysis → change/analysis}/__init__.py +5 -15
  10. janito/change/analysis/__main__.py +7 -0
  11. janito/change/analysis/analyze.py +62 -0
  12. janito/change/analysis/formatting.py +78 -0
  13. janito/change/analysis/options.py +81 -0
  14. janito/{analysis → change/analysis}/prompts.py +33 -18
  15. janito/change/analysis/view/__init__.py +9 -0
  16. janito/change/analysis/view/terminal.py +181 -0
  17. janito/change/applier/__init__.py +5 -0
  18. janito/change/applier/file.py +58 -0
  19. janito/change/applier/main.py +156 -0
  20. janito/change/applier/text.py +247 -0
  21. janito/change/applier/workspace_dir.py +58 -0
  22. janito/change/core.py +124 -0
  23. janito/{changehistory.py → change/history.py} +12 -14
  24. janito/change/operations.py +7 -0
  25. janito/change/parser.py +287 -0
  26. janito/change/play.py +54 -0
  27. janito/change/preview.py +82 -0
  28. janito/change/prompts.py +121 -0
  29. janito/change/test.py +0 -0
  30. janito/change/validator.py +269 -0
  31. janito/{changeviewer → change/viewer}/__init__.py +3 -4
  32. janito/change/viewer/content.py +66 -0
  33. janito/{changeviewer → change/viewer}/diff.py +19 -4
  34. janito/change/viewer/panels.py +533 -0
  35. janito/change/viewer/styling.py +114 -0
  36. janito/{changeviewer → change/viewer}/themes.py +3 -5
  37. janito/clear_statement_parser/clear_statement_format.txt +328 -0
  38. janito/clear_statement_parser/examples.txt +326 -0
  39. janito/clear_statement_parser/models.py +104 -0
  40. janito/clear_statement_parser/parser.py +496 -0
  41. janito/cli/base.py +30 -0
  42. janito/cli/commands.py +75 -40
  43. janito/cli/functions.py +19 -194
  44. janito/cli/history.py +61 -0
  45. janito/common.py +65 -8
  46. janito/config.py +70 -5
  47. janito/demo/__init__.py +4 -0
  48. janito/demo/data.py +13 -0
  49. janito/demo/mock_data.py +20 -0
  50. janito/demo/operations.py +45 -0
  51. janito/demo/runner.py +59 -0
  52. janito/demo/scenarios.py +32 -0
  53. janito/prompt.py +36 -0
  54. janito/qa.py +6 -14
  55. janito/search_replace/README.md +192 -0
  56. janito/search_replace/__init__.py +7 -0
  57. janito/search_replace/__main__.py +21 -0
  58. janito/search_replace/core.py +120 -0
  59. janito/search_replace/logger.py +35 -0
  60. janito/search_replace/parser.py +52 -0
  61. janito/search_replace/play.py +61 -0
  62. janito/search_replace/replacer.py +36 -0
  63. janito/search_replace/searcher.py +411 -0
  64. janito/search_replace/strategy_result.py +10 -0
  65. janito/shell/__init__.py +38 -0
  66. janito/shell/bus.py +31 -0
  67. janito/shell/commands.py +136 -0
  68. janito/shell/history.py +20 -0
  69. janito/shell/processor.py +32 -0
  70. janito/shell/prompt.py +48 -0
  71. janito/shell/registry.py +60 -0
  72. janito/tui/__init__.py +21 -0
  73. janito/tui/base.py +22 -0
  74. janito/tui/flows/__init__.py +5 -0
  75. janito/tui/flows/changes.py +65 -0
  76. janito/tui/flows/content.py +128 -0
  77. janito/tui/flows/selection.py +117 -0
  78. janito/tui/screens/__init__.py +3 -0
  79. janito/tui/screens/app.py +1 -0
  80. janito/workspace/__init__.py +6 -0
  81. janito/workspace/analysis.py +121 -0
  82. janito/workspace/show.py +141 -0
  83. janito/workspace/stats.py +43 -0
  84. janito/workspace/types.py +98 -0
  85. janito/workspace/workset.py +108 -0
  86. janito/workspace/workspace.py +114 -0
  87. janito-0.7.0.dist-info/METADATA +167 -0
  88. janito-0.7.0.dist-info/RECORD +96 -0
  89. {janito-0.5.0.dist-info → janito-0.7.0.dist-info}/WHEEL +1 -1
  90. janito/_contextparser.py +0 -113
  91. janito/analysis/display.py +0 -149
  92. janito/analysis/options.py +0 -112
  93. janito/change/applier.py +0 -269
  94. janito/change/content.py +0 -62
  95. janito/change/indentation.py +0 -33
  96. janito/change/position.py +0 -169
  97. janito/changeviewer/panels.py +0 -268
  98. janito/changeviewer/styling.py +0 -59
  99. janito/console/__init__.py +0 -3
  100. janito/console/commands.py +0 -112
  101. janito/console/core.py +0 -62
  102. janito/console/display.py +0 -157
  103. janito/fileparser.py +0 -334
  104. janito/prompts.py +0 -81
  105. janito/scan.py +0 -176
  106. janito/tests/test_fileparser.py +0 -26
  107. janito-0.5.0.dist-info/METADATA +0 -146
  108. janito-0.5.0.dist-info/RECORD +0 -45
  109. {janito-0.5.0.dist-info → janito-0.7.0.dist-info}/entry_points.txt +0 -0
  110. {janito-0.5.0.dist-info → janito-0.7.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,328 @@
1
+ # CLEAR STATEMENT FORMAT
2
+
3
+ Version: 1.9.8
4
+
5
+ ## OVERVIEW
6
+
7
+ This document provides a format for clear, unambiguous statements that can be reliably interpreted by both humans and computers. The format emphasizes literal interpretation and straightforward parsing rules to ensure consistent understanding across different implementations and use cases.
8
+
9
+ ## FUNDAMENTAL PRINCIPLES
10
+
11
+ 1. Whitespace Significance
12
+ - Whitespace only has meaning when it appears between two symbols in the same line
13
+ - Leading and trailing whitespace on lines has no meaning
14
+ - Empty lines (containing only whitespace) are ignored
15
+ - Multiple consecutive whitespace characters are treated the same as a single whitespace
16
+ - Indentation is for human readability only and has no semantic meaning
17
+
18
+ 2. Keep It Literal
19
+ - Content is interpreted exactly as written without escape sequences
20
+ - Special characters are marked by their position (e.g., leading dot for literal blocks) rather than by escaping
21
+ - No character escaping mechanism is provided or needed
22
+ - Line endings are normalized but not escaped
23
+ - What you see is what you get - the format avoids hidden or transformed characters
24
+
25
+ ## FORMAT ELEMENTS
26
+
27
+ ### 1. Basic Line Types
28
+
29
+ The following symbols are special: # . : - /, particularly when wrapping lines.
30
+
31
+ Line type is determined by these rules in order, once there is a match the type is set:
32
+
33
+ 1. All lines are stripped of leading whitespace and trailing whitespace/end-of-line symbols (\n, \r, \r\n), parsing is based on line content, not indentation
34
+ 2. Empty Lines: Lines that are completely empty or consist only of whitespace are skipped
35
+ 3. Comment: Lines starting with # are treated as comments and ignored
36
+ 4. List Item: Lines beginning with one or more - characters
37
+ 5. Statement: Lines containing only alphanumeric characters and spaces
38
+ 6. Literal Block: Lines beginning with ., terminating when a non-dot-prefixed line is encountered (excluding comments) or when the document ends
39
+ 7. Key/Value: Lines containing : are treated as key/value pairs
40
+ 8. Block Marker: Lines matching one of these patterns:
41
+ - Block Start: Line begins with / followed immediately by an alphanumeric block name (e.g., /BlockName)
42
+ - Block End: Line consists of an alphanumeric block name followed immediately by / (e.g., BlockName/)
43
+
44
+ Note: The order of these rules is significant. A line's type is determined by the first matching rule.
45
+
46
+ ### 1.1 Block Marker Syntax Rules
47
+
48
+ Block markers follow these specific rules:
49
+ 1. Start marker must be:
50
+ - A forward slash (/)
51
+ - Immediately followed by an alphanumeric block name
52
+ - No whitespace between slash and name
53
+ - Examples: /Environment, /Database, /Service
54
+
55
+ 2. End marker must be:
56
+ - An alphanumeric block name
57
+ - Immediately followed by a forward slash (/)
58
+ - Must match exactly the name used in the corresponding start marker
59
+ - No whitespace between name and slash
60
+ - Examples: Environment/, Database/, Service/
61
+
62
+ 3. Block Naming Conventions:
63
+ - Use nouns or noun phrases to name blocks
64
+ - Names should describe the scope or category of contained statements
65
+ - Use PascalCase for multi-word names
66
+ - Examples:
67
+ - Good: /Configuration, /Network, /SecurityPolicy
68
+ - Avoid: /Configure, /Running, /ProcessItems
69
+
70
+ 4. Invalid block markers:
71
+ - / (slash alone)
72
+ - /block name (contains space)
73
+ - / BlockName (contains space)
74
+ - BlockName / (contains space)
75
+ - block_name/ (contains underscore)
76
+ - /block-name (contains hyphen)
77
+
78
+ ### 1.2 Statement Naming Conventions
79
+
80
+ Statements follow these naming conventions:
81
+ 1. Statement Structure:
82
+ - Use verb phrases that clearly describe actions
83
+ - Start with an imperative verb
84
+ - Follow with appropriate objects or context
85
+ - Examples: Create File, Deploy Application, Update Configuration
86
+
87
+ 2. Verb Usage:
88
+ - Use precise, specific verbs
89
+ - Choose verbs that clearly indicate the action's purpose
90
+ - Examples:
91
+ - Good: Deploy Service (specific action)
92
+ - Avoid: Do Service (vague action)
93
+ - Good: Create Database (clear intent)
94
+ - Avoid: Make Database (imprecise)
95
+
96
+ 3. Naming Format:
97
+ - Use Title Case for statement names
98
+ - Separate words with single spaces
99
+ - Keep names concise but descriptive
100
+ - Examples:
101
+ - Good: Install Dependencies
102
+ - Good: Configure Network Settings
103
+ - Good: Create Backup Schedule
104
+ - Avoid: installDependencies (wrong format)
105
+ - Avoid: INSTALL_DEPENDENCIES (wrong format)
106
+ - Avoid: Install the System Dependencies for the Application (too verbose)
107
+
108
+ 4. Common Statement Verbs:
109
+ - Creation: Create, Generate, Initialize
110
+ - Modification: Update, Modify, Configure
111
+ - Removal: Delete, Remove, Clear
112
+ - Deployment: Deploy, Install, Provision
113
+ - Status: Check, Validate, Verify
114
+
115
+ ### 1.3 Statement and Block Name Relationships
116
+
117
+ When using statements within blocks, maintain clear relationships:
118
+ 1. Blocks use nouns describing scope/category (see section 1.1)
119
+ 2. Statements use verb phrases describing actions
120
+ 3. Together they form clear action-scope pairs:
121
+
122
+ ```
123
+ /Database
124
+ Create Table
125
+ name: users
126
+ Update Schema
127
+ version: 2
128
+ Database/
129
+
130
+ /SecurityPolicy
131
+ Configure Rules
132
+ type: firewall
133
+ Enable Monitoring
134
+ level: high
135
+ SecurityPolicy/
136
+ ```
137
+
138
+ ### Line Type Priority Examples
139
+
140
+ The following examples demonstrate how the order of rules determines line type:
141
+
142
+ ```
143
+ # key: value -> Rule 3: Comment (despite containing a colon)
144
+ #.literal content -> Rule 3: Comment (despite starting with dot after #)
145
+ #- item -> Rule 3: Comment (despite starting with dash after #)
146
+ # /BlockName -> Rule 3: Comment (despite looking like block start)
147
+ #BlockName/ -> Rule 3: Comment (despite looking like block end)
148
+ - key: value -> Rule 4: List Item (despite containing a colon)
149
+ -.literal content -> Rule 4: List Item (despite containing a dot)
150
+ - /BlockName -> Rule 4: List Item (despite containing block start syntax)
151
+ - BlockName/ -> Rule 4: List Item (despite containing block end syntax)
152
+ .key: value -> Rule 6: Literal Block (despite containing a colon)
153
+ .# not a comment -> Rule 6: Literal Block (despite containing #)
154
+ .- not a list -> Rule 6: Literal Block (despite containing -)
155
+ ./BlockName -> Rule 6: Literal Block (despite containing block start syntax)
156
+ .BlockName/ -> Rule 6: Literal Block (despite containing block end syntax)
157
+ key: /BlockName -> Rule 7: Key/Value (despite containing block start syntax)
158
+ key: BlockName/ -> Rule 7: Key/Value (despite containing block end syntax)
159
+ /BlockName -> Rule 8: Block Start Marker
160
+ BlockName/ -> Rule 8: Block End Marker
161
+ ```
162
+
163
+ ### 2. Statements Format
164
+
165
+ A statement is a single line that represents an action or instruction, followed by parameters that provide additional context or data for the statement. Parameters can be key-value pairs, list items, literal block lines, or statement blocks. Statement blocks can be freely mixed with other parameter types, while key-value pairs, list items, and literal blocks cannot be mixed with each other.
166
+
167
+ #### 2.1 Statement Parameters
168
+
169
+ Parameters must follow these rules:
170
+ - Base parameter types are mutually exclusive:
171
+ - A series of key/value lines (with enhanced support for literal blocks or lists as values)
172
+ - A sequence of list items, where each item is a single line of text
173
+ - A literal block, where lines are preserved exactly as written including whitespace and formatting
174
+ - Statement blocks can be freely mixed with any other parameter type
175
+ - Statement blocks can contain their own parameters following these same rules
176
+
177
+ #### 2.2 Enhanced Key/Value Lines
178
+
179
+ - Keys within a scope must be unique:
180
+ - All keys within a single statement's parameters must be unique
181
+ - All keys within the same nesting level of a list must be unique
182
+ - Keys can be reused in different scopes (different statements or different list items)
183
+ - Values:
184
+ - If the value is inline (non-empty), it must remain on a single line
185
+ - If the value is empty (e.g., key:), either a literal block or a list must follow:
186
+ - Literal Block: Lines starting with . must immediately follow the key and will be treated as the value for the key. The literal block terminates when a non-dot-prefixed line is encountered (except comments) or when the document finishes. All lines are joined using \n after stripping the leading dot.
187
+ - List: Lines starting with - must immediately follow the key and will be treated as a list for the key. Nesting rules for lists apply.
188
+ - Mixing Error: Mixing literal blocks and lists under the same key is not allowed and must result in a syntax error.
189
+
190
+ ##### 2.2.1 Literal Blocks
191
+
192
+ - A leading dot is required for each line of a literal block
193
+ - The content after the leading dot is preserved exactly as written
194
+ - The literal block terminates when:
195
+ - A line without a leading dot (excluding comments) is encountered, or
196
+ - The document finishes
197
+ - Join all lines with \n to form a single string value
198
+ - Literal blocks are stored as strings
199
+ - All whitespace and characters after the leading dot are preserved exactly as written
200
+ - The dot prefix allows literal blocks to contain content that would otherwise be interpreted as comments or other special line types
201
+
202
+ ##### 2.2.2 Lists
203
+
204
+ - List items are marked by one or more leading dash characters (-) to indicate nesting level
205
+ - Nesting Levels:
206
+ - Determined by the number of consecutive dash characters (-, --, ---)
207
+ - Maximum depth of 5 levels
208
+ - Each level must use exactly one more dash than its parent
209
+ - List Item Content:
210
+ - Each list item must contain exactly one line of text
211
+ - The text starts immediately after the dashes and any whitespace
212
+ - No continuation lines are allowed
213
+ - No empty items are allowed
214
+ - List Storage: Lists are stored as a list type within the dictionary under the corresponding key they follow
215
+
216
+ ##### 2.2.3 Mixing Rules
217
+
218
+ - A key cannot have both a literal block and a list as its value
219
+
220
+ #### 2.3 Statement Blocks
221
+
222
+ Statement blocks are a powerful mechanism for organizing complex, nested instructions within a single statement. They provide a structured way to group related sub-operations, transformations, or configurations.
223
+
224
+ Key Characteristics:
225
+ - Blocks create a hierarchical, nested structure for organizing instructions
226
+ - Block markers must follow the syntax rules defined in section 1.1
227
+ - Block names can be duplicated within the same level to represent parallel or repeated operations
228
+ - Allow nested blocks by providing new blocks within inner statement parameters
229
+ - Maximum nesting depth of 10 levels
230
+ - Enables complex, multi-step processes within a single statement
231
+ - A block name cannot be the same as its direct parent block name
232
+
233
+ Block Rules:
234
+ - Statement block names must be alphanumeric
235
+ - Multiple blocks with the same name are allowed within the same level to represent parallel or repeated operations
236
+ - A block name cannot be the same as its direct parent block name
237
+ - Block names can be reused at any level except as a direct child of a block with the same name
238
+ - Content: Must consist of statements, where each statement can have parameters in the form of key/value pairs, literal blocks, lists, or nested blocks
239
+ - Nesting: Maximum depth of 10 levels (not counting the initial statement level)
240
+ - Empty Blocks: Allowed
241
+ - Scope: Each block creates a new scope for key uniqueness
242
+
243
+ ### 3. Error Handling
244
+
245
+ - Errors must include the following details:
246
+ - Statement Context: The statement that caused the error
247
+ - Line Number: The location of the error
248
+ - Error Message: Descriptive message explaining the issue
249
+ - Errors should be reported in plain text format for simplicity, with one error per line
250
+ - Uniqueness violations must be reported with clear scope context
251
+
252
+ ### 4. Examples
253
+
254
+ #### Statement Without Parameters:
255
+ Clear All Cache
256
+
257
+ #### Statement with Key/Value and Literal Block:
258
+ Create New File
259
+ name: test.py
260
+ content:
261
+ .def greet():
262
+ . print("Hello")
263
+
264
+ #### Statement with Lists:
265
+ Update Menu Items
266
+ categories:
267
+ - Main Course
268
+ -- Pasta
269
+ -- Pizza
270
+ - Desserts
271
+ -- Ice Cream
272
+ -- Cake
273
+
274
+ #### Statement with Block Name Constraints:
275
+ Deploy Application
276
+ /Environment
277
+ Configure Settings
278
+ region: us-west-2
279
+
280
+ /Service # Valid: Different name than parent
281
+ Deploy Container
282
+ name: auth-service
283
+
284
+ /Environment # Valid: Same name as grandparent
285
+ Set Parameters
286
+ memory: 512Mi
287
+ Environment/
288
+ Service/
289
+ Environment/
290
+
291
+ #### Statement with Mixed Parameter Types:
292
+ Create Database
293
+ name: users
294
+ /Configuration
295
+ Set Parameters
296
+ engine: postgresql
297
+ version: 14
298
+ Configuration/
299
+ schema:
300
+ .CREATE TABLE users (
301
+ . id SERIAL PRIMARY KEY,
302
+ . name VARCHAR(255)
303
+ .);
304
+
305
+ #### Statement with Duplicate Blocks:
306
+ Deploy Microservices
307
+ /Service
308
+ Deploy Container
309
+ name: auth-service
310
+ port: 8000
311
+ image: auth:latest
312
+ Service/
313
+
314
+ /Service
315
+ Deploy Container
316
+ name: payment-service
317
+ port: 8001
318
+ image: payments:latest
319
+ Service/
320
+
321
+ /Service
322
+ Deploy Container
323
+ name: user-service
324
+ port: 8002
325
+ image: users:latest
326
+ Service/
327
+
328
+
@@ -0,0 +1,326 @@
1
+ # CLEAR STATEMENT FORMAT EXAMPLES
2
+
3
+ ## Configuration Management
4
+
5
+ #### Web Server Configuration
6
+ Configure Web Server
7
+ hostname: web-01
8
+ port: 80
9
+ worker_processes: auto
10
+ client_max_body_size: 100M
11
+ access_log: /var/log/access.log
12
+ error_log: /var/log/error.log
13
+ ssl_enabled: true
14
+ ssl_certificate: /etc/ssl/cert.pem
15
+ ssl_key: /etc/ssl/key.pem
16
+
17
+ #### Environment Configuration
18
+ Set Environment Variables
19
+ /Production
20
+ Set Variables
21
+ database_url: postgres://prod-db:5432
22
+ redis_host: redis-master
23
+ log_level: info
24
+ Production/
25
+
26
+ /Development
27
+ Set Variables
28
+ database_url: postgres://dev-db:5432
29
+ redis_host: localhost
30
+ log_level: debug
31
+ Development/
32
+
33
+ ## Data Processing
34
+
35
+ #### Customer Data Processing
36
+ Transform Customer Data
37
+ input_file: customers.csv
38
+ output_format: json
39
+ transformations:
40
+ - Capitalize all name fields
41
+ - Convert phone numbers to E.164 format
42
+ - Validate all email addresses
43
+ - Remove special characters from addresses
44
+ filters:
45
+ - Exclude accounts inactive for 90+ days
46
+ - Remove records marked as test data
47
+ - Skip entries with missing required fields
48
+ field_mapping:
49
+ .customer_id=id
50
+ .first_name=given_name
51
+ .last_name=family_name
52
+ .phone=contact_number
53
+ .email=contact_email
54
+
55
+ #### Report Generation
56
+ Generate Monthly Report
57
+ title: Monthly Sales Analysis
58
+ period: 2024-03
59
+ sections:
60
+ - Revenue Overview and Trends
61
+ -- Total Monthly Revenue
62
+ -- Year-over-Year Growth
63
+ -- Revenue by Product Line
64
+ - Customer Insights
65
+ -- New Customer Acquisition
66
+ -- Customer Retention Rates
67
+ -- Average Order Value
68
+ - Regional Performance
69
+ -- North America Sales
70
+ -- European Market Analysis
71
+ -- Asia Pacific Growth
72
+ output_format: pdf
73
+ include_charts: true
74
+ add_executive_summary: true
75
+
76
+ ## System Administration
77
+
78
+ #### Database Backup Process
79
+ Backup Database
80
+ /Preparation
81
+ Verify Space
82
+ minimum_free: 100GB
83
+ backup_path: /mnt/backups
84
+ temp_space: /tmp/backup
85
+ Check Connections
86
+ max_active: 50
87
+ timeout: 30s
88
+ verify_replica: true
89
+ Preparation/
90
+
91
+ /Execution
92
+ Create Snapshot
93
+ type: hot
94
+ compression: true
95
+ verify_checksums: true
96
+ Copy Files
97
+ destination: s3://backups/
98
+ retention_days: 30
99
+ encryption: AES256
100
+ Execution/
101
+
102
+ #### Service Mesh Deployment
103
+ Deploy Service Mesh
104
+ /Infrastructure
105
+ Setup Network
106
+ primary_subnet: 10.0.1.0/24
107
+ secondary_subnet: 10.0.2.0/24
108
+ encryption_enabled: true
109
+ firewall_enabled: true
110
+ Infrastructure/
111
+
112
+ /Services
113
+ Deploy Gateway
114
+ replicas: 3
115
+ ingress_port: 80
116
+ egress_port: 443
117
+ health_check: /health
118
+ Deploy Monitoring
119
+ monitoring_stack:
120
+ - Enable Prometheus metrics collection
121
+ - Install Grafana dashboards
122
+ - Configure Alert Manager rules
123
+ - Set up logging pipeline
124
+ Services/
125
+
126
+ ## Content Management
127
+
128
+ #### Blog Post Creation
129
+ Create Blog Post
130
+ title: Getting Started with Clear Statement Format
131
+ author: John Smith
132
+ status: draft
133
+ content:
134
+ .# Getting Started with Clear Statement Format
135
+ .
136
+ .The Clear Statement Format provides a simple yet powerful way to structure configuration and commands.
137
+ .
138
+ .## Key Benefits
139
+ .
140
+ .* Easy to read and write
141
+ .* No escape characters needed
142
+ .* Supports nested structures
143
+ .
144
+ .## Examples
145
+ .
146
+ .Let's look at some practical examples...
147
+ categories:
148
+ - Technical Documentation
149
+ - Best Practices
150
+ - Getting Started Guides
151
+
152
+ #### Media Library Management
153
+ Process Media Library
154
+ /Scan
155
+ Process Images
156
+ source_dir: /uploads/images
157
+ allowed_formats:
158
+ - Process all JPEG files
159
+ - Handle PNG images
160
+ - Convert WEBP files
161
+ processing_steps:
162
+ - Create thumbnails for all images
163
+ - Extract EXIF metadata
164
+ - Optimize file sizes
165
+ - Generate alt text
166
+ Scan/
167
+
168
+ /Organize
169
+ Create Structure
170
+ root_path: /media/library
171
+ categories:
172
+ - Create Events folder
173
+ -- Add Conferences subfolder
174
+ -- Add Meetups subfolder
175
+ - Create Products folder
176
+ -- Add Product Launches subfolder
177
+ -- Add Demo Videos subfolder
178
+ Organize/
179
+
180
+ ## Security Operations
181
+
182
+ #### Firewall Configuration
183
+ Update Firewall Rules
184
+ /Inbound
185
+ Configure HTTP
186
+ port: 80
187
+ source_cidr: 0.0.0.0/0
188
+ description: Allow incoming HTTP
189
+ Configure HTTPS
190
+ port: 443
191
+ source_cidr: 0.0.0.0/0
192
+ description: Allow incoming HTTPS
193
+ Configure SSH
194
+ port: 22
195
+ source_cidr: 10.0.0.0/8
196
+ description: Internal SSH access
197
+ Inbound/
198
+
199
+ /Outbound
200
+ Set Default Policy
201
+ default_action: deny
202
+ log_blocked: true
203
+ Configure External Access
204
+ allowed_destinations:
205
+ - Allow DNS to 8.8.8.8/32
206
+ - Allow HTTPS to all destinations
207
+ - Allow NTP to pool.ntp.org
208
+ Outbound/
209
+
210
+ #### Access Key Management
211
+ Rotate Access Keys
212
+ /Audit
213
+ Check Usage
214
+ maximum_age: 90
215
+ inactive_period: 30
216
+ audit_enabled: true
217
+ Audit/
218
+
219
+ /Update
220
+ Configure Keys
221
+ algorithm: rsa-4096
222
+ validity_days: 365
223
+ require_rotation: true
224
+ Update Service Keys
225
+ services:
226
+ - Rotate API Gateway credentials
227
+ - Update Auth Service keys
228
+ - Refresh Monitoring tokens
229
+ - Renew Backup service keys
230
+ Update/
231
+
232
+ ## CI/CD Pipeline
233
+
234
+ #### Build Process
235
+ Execute Build Pipeline
236
+ /Prepare
237
+ Setup Environment
238
+ cache_enabled: true
239
+ package_file: package.json
240
+ lockfile: yarn.lock
241
+ Prepare/
242
+
243
+ /Build
244
+ Run Build Steps
245
+ environment: production
246
+ optimizations:
247
+ - Minimize all JavaScript bundles
248
+ - Optimize and compress images
249
+ - Generate source maps
250
+ - Tree shake unused code
251
+
252
+ Execute Tests
253
+ test_types:
254
+ - Run all unit tests
255
+ - Execute integration test suite
256
+ - Perform end-to-end testing
257
+ coverage_threshold: 80
258
+ report_path: /reports/coverage
259
+ Build/
260
+
261
+ /Deploy
262
+ Push Artifacts
263
+ registry: gcr.io/myproject
264
+ versions:
265
+ - Tag as latest version
266
+ - Add semantic version tag
267
+ - Include build metadata
268
+ Update Cluster
269
+ namespace: production
270
+ replica_count: 3
271
+ rolling_update: true
272
+ Deploy/
273
+
274
+ #### Deployment Monitoring
275
+ Monitor Deployment Status
276
+ application_name: user-service
277
+ watch_metrics:
278
+ - Track error rate percentage
279
+ - Monitor average response times
280
+ - Watch CPU utilization
281
+ - Check memory consumption
282
+ alert_conditions:
283
+ - Alert on error rate above 1%
284
+ - Notify when response time exceeds 500ms
285
+ - Warn on CPU above 80%
286
+ remediation_steps:
287
+ - Send team notification
288
+ - Increase replica count
289
+ - Create incident ticket
290
+ - Start investigation
291
+
292
+ ## Data Migration
293
+
294
+ #### Database Migration
295
+ Migrate Database
296
+ /Planning
297
+ Analyze Size
298
+ table_stats:
299
+ - Users table contains 1M records
300
+ - Orders table has 5M entries
301
+ - Products catalog has 100K items
302
+ - Comments section with 10M rows
303
+ Plan Schedule
304
+ maintenance_window: 2h
305
+ transfer_speed: 100MB/s
306
+ backup_required: true
307
+ Planning/
308
+
309
+ /Execution
310
+ Extract Data
311
+ output_format: binary
312
+ enable_compression: true
313
+ verify_integrity: true
314
+ Update Database
315
+ schema_changes:
316
+ - Update users table structure
317
+ - Add order history indexes
318
+ - Modify product categories
319
+ - Optimize query patterns
320
+ Verify Migration
321
+ validation_steps:
322
+ - Compare record counts
323
+ - Verify data integrity
324
+ - Test all indexes
325
+ - Validate constraints
326
+ Execution/