Skip to content

docs(rfc): variable refactor proposal#905

Merged
mleonidas merged 3 commits intomainfrom
mleonidas/refactor_variables_rfc
Apr 3, 2026
Merged

docs(rfc): variable refactor proposal#905
mleonidas merged 3 commits intomainfrom
mleonidas/refactor_variables_rfc

Conversation

@mleonidas
Copy link
Copy Markdown
Collaborator

@mleonidas mleonidas commented Apr 2, 2026

  • adds an RFC to describe the proposal for refactoring how variables are stored

Summary by CodeRabbit

  • Documentation
    • Added RFC proposing a unified variable and secret resolution system, detailing system architecture, database modeling, resolution semantics pipeline, migration strategy, and alternatives discussion.

* adds an RFC to describe the proposal for refactoring how variables are
  stored
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e02b85ef-db40-4b15-8757-50d2345461ea

📥 Commits

Reviewing files that changed from the base of the PR and between a1045e0 and 7696b51.

📒 Files selected for processing (1)
  • docs/rfc/0010-variable-storage.mdx
✅ Files skipped from review due to trivial changes (1)
  • docs/rfc/0010-variable-storage.mdx

📝 Walkthrough

Walkthrough

A new RFC document is added outlining a unified variable and secret resolution system. The proposal specifies database schema design with variable scoping, value kinds, and resolution semantics through a multi-stage pipeline, including migration strategy.

Changes

Cohort / File(s) Summary
RFC Documentation
docs/rfc/0010-variable-storage.mdx
New RFC proposing unified variable & secret resolution system. Defines database schema with variable and variable_value tables, enum-based scoping, value kinds (literal, ref, secret_ref), resolution pipeline semantics, and migration strategy.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A variable burrow, so neat and so grand,
With secrets stored safely throughout all the land,
The RFC outlines, with care and precision,
How scopes and values align in division,
One unified way to resolve them all right! 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs(rfc): variable refactor proposal' directly and clearly summarizes the main change: adding an RFC document proposing a refactor of variable storage and resolution.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mleonidas/refactor_variables_rfc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/rfc/0010-variable-storage.md`:
- Line 238: The fenced code block in the RFC is missing a language identifier;
update the Markdown block that contains the JSON snippet (the block showing {
"ref": "db.config", "path": ["host"] }) to use the json language identifier by
changing the opening fence to ```json so it gets proper syntax highlighting and
satisfies markdownlint MD040 and Prettier formatting rules.
- Line 228: Update the fenced code block in docs/rfc/0010-variable-storage.md to
include the json language identifier by changing the opening triple-backtick to
```json so the block containing { "host": "db.internal", "port": 5432 } is
syntax-highlighted and satisfies markdownlint MD040; run Prettier/markdown
formatter after the change to ensure consistent formatting.
- Line 66: Change the fenced code block language identifier from `jsx` to `sql`
so the SQL DDL statements in the block are highlighted correctly; locate the
triple-backtick fence currently labeled ```jsx``` and replace it with ```sql```
(ensure only the language label is changed and the SQL content remains
unchanged).
- Around line 79-120: Add uniqueness so the same key can't be created twice for
the same owner: create three partial unique indexes on the variable table (one
per scope) that combine the owner id and key and only apply when scope matches.
For example, add a UNIQUE INDEX on (resource_id, key) WHERE scope = 'resource',
another on (deployment_id, key) WHERE scope = 'deployment', and a third on
(deployment_job_agent_id, key) WHERE scope = 'deployment_job_agent'; keep the
existing variable_scope_target_check constraint as-is to guarantee single-owner
semantics.
- Around line 248-254: Add the JSON language identifier to the fenced code block
containing the example object (the block starting with {"provider": "vault",
"key": "kv/data/prod/db", "path": ["password"]}) by changing the opening fence
to ```json so the block is recognised as JSON for syntax highlighting and to
satisfy markdownlint MD040; no other content changes required.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 72df9a3f-1ad9-4153-bd91-c859340de09c

📥 Commits

Reviewing files that changed from the base of the PR and between c62e858 and b832e03.

📒 Files selected for processing (1)
  • docs/rfc/0010-variable-storage.md


## **Proposal**

```jsx
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Use sql language identifier instead of jsx.

The code block contains SQL DDL statements, not JSX. This should use the sql language identifier for proper syntax highlighting.

📝 Proposed fix
-```jsx
+```sql
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```jsx
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/rfc/0010-variable-storage.md` at line 66, Change the fenced code block
language identifier from `jsx` to `sql` so the SQL DDL statements in the block
are highlighted correctly; locate the triple-backtick fence currently labeled
```jsx``` and replace it with ```sql``` (ensure only the language label is
changed and the SQL content remains unchanged).


Example:

```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add json language identifier to fenced code block.

The code block should specify json as the language for proper syntax highlighting and to satisfy the markdownlint MD040 rule. As per coding guidelines, Prettier is used for formatting markdown files.

📝 Proposed fix
-```
+```json
 { "host": "db.internal", "port": 5432 }
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.22.0)

[warning] 228-228: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/rfc/0010-variable-storage.md` at line 228, Update the fenced code block
in docs/rfc/0010-variable-storage.md to include the json language identifier by
changing the opening triple-backtick to ```json so the block containing {
"host": "db.internal", "port": 5432 } is syntax-highlighted and satisfies
markdownlint MD040; run Prettier/markdown formatter after the change to ensure
consistent formatting.


Example:

```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add json language identifier to fenced code block.

The code block should specify json as the language for proper syntax highlighting and to satisfy the markdownlint MD040 rule. As per coding guidelines, Prettier is used for formatting markdown files.

📝 Proposed fix
-```
+```json
 { "ref": "db.config", "path": ["host"] }
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.22.0)

[warning] 238-238: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/rfc/0010-variable-storage.md` at line 238, The fenced code block in the
RFC is missing a language identifier; update the Markdown block that contains
the JSON snippet (the block showing { "ref": "db.config", "path": ["host"] }) to
use the json language identifier by changing the opening fence to ```json so it
gets proper syntax highlighting and satisfies markdownlint MD040 and Prettier
formatting rules.

Comment on lines +248 to +254
```
{
"provider": "vault",
"key": "kv/data/prod/db",
"path": ["password"]
}
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add json language identifier to fenced code block.

The code block should specify json as the language for proper syntax highlighting and to satisfy the markdownlint MD040 rule. As per coding guidelines, Prettier is used for formatting markdown files.

📝 Proposed fix
-```
+```json
 {
   "provider": "vault",
   "key": "kv/data/prod/db",
   "path": ["password"]
 }
</details>

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.22.0)</summary>

[warning] 248-248: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @docs/rfc/0010-variable-storage.md around lines 248 - 254, Add the JSON
language identifier to the fenced code block containing the example object (the
block starting with {"provider": "vault", "key": "kv/data/prod/db", "path":
["password"]}) by changing the opening fence to ```json so the block is
recognised as JSON for syntax highlighting and to satisfy markdownlint MD040; no
other content changes required.


</details>

<!-- fingerprinting:phantom:triton:puma:86dae066-5924-40dd-a637-bb6c1837903a -->

<!-- This is an auto-generated comment by CodeRabbit -->

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (4)
docs/rfc/0010-variable-storage.md (4)

293-299: ⚠️ Potential issue | 🟡 Minor

Add json language identifier to fenced code block.

The code block should specify json as the language for proper syntax highlighting and to satisfy the markdownlint MD040 rule. As per coding guidelines, Prettier is used for formatting markdown files.

📝 Proposed fix
-```
+```json
 {
   "provider": "vault",
   "key": "kv/data/prod/db",
   "path": ["password"]
 }
</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @docs/rfc/0010-variable-storage.md around lines 293 - 299, The fenced code
block containing the JSON snippet should include the language identifier "json"
for proper syntax highlighting and to satisfy markdownlint MD040; update the
block that currently starts with to start withjson so the snippet with
keys "provider", "key", and "path" is recognized as JSON.


</details>

---

`283-285`: _⚠️ Potential issue_ | _🟡 Minor_

**Add `json` language identifier to fenced code block.**

The code block should specify `json` as the language for proper syntax highlighting and to satisfy the markdownlint MD040 rule. As per coding guidelines, Prettier is used for formatting markdown files.




<details>
<summary>📝 Proposed fix</summary>

```diff
-```
+```json
 { "ref": "db.config", "path": ["host"] }
 ```
```
</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @docs/rfc/0010-variable-storage.md around lines 283 - 285, The fenced code
block containing the JSON snippet { "ref": "db.config", "path": ["host"] }
should include the json language identifier for proper syntax highlighting and
to satisfy markdownlint MD040; update the triple-backtick fence to start with


66-66: ⚠️ Potential issue | 🟡 Minor

Use sql language identifier instead of jsx.

The code block contains SQL DDL statements, not JSX. This should use the sql language identifier for proper syntax highlighting. As per coding guidelines, Prettier is used for formatting markdown files.

📝 Proposed fix
-```jsx
+```sql
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/rfc/0010-variable-storage.md` at line 66, The markdown code block in
docs/rfc/0010-variable-storage.md uses the wrong language identifier ("jsx") for
SQL DDL; update that code fence to use "sql" instead (replace the opening ```jsx
with ```sql) so syntax highlighting and Prettier formatting are correct for the
SQL statements in the block.

273-275: ⚠️ Potential issue | 🟡 Minor

Add json language identifier to fenced code block.

The code block should specify json as the language for proper syntax highlighting and to satisfy the markdownlint MD040 rule. As per coding guidelines, Prettier is used for formatting markdown files.

📝 Proposed fix
-```
+```json
 { "host": "db.internal", "port": 5432 }
</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @docs/rfc/0010-variable-storage.md around lines 273 - 275, The fenced code
block containing the JSON example { "host": "db.internal", "port": 5432 } is
missing a language identifier; update the opening fence from tojson so
the block becomes a JSON code block (ensuring markdownlint MD040 compliance and
proper Prettier formatting).


</details>

</blockquote></details>

</blockquote></details>

<details>
<summary>🤖 Prompt for all review comments with AI agents</summary>

Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @docs/rfc/0010-variable-storage.md:

  • Around line 293-299: The fenced code block containing the JSON snippet should
    include the language identifier "json" for proper syntax highlighting and to
    satisfy markdownlint MD040; update the block that currently starts with to start withjson so the snippet with keys "provider", "key", and "path" is
    recognized as JSON.
  • Around line 283-285: The fenced code block containing the JSON snippet {
    "ref": "db.config", "path": ["host"] } should include the json language
    identifier for proper syntax highlighting and to satisfy markdownlint MD040;
    update the triple-backtick fence to start with ```json so the block becomes a
    JSON code block.
  • Line 66: The markdown code block in docs/rfc/0010-variable-storage.md uses the
    wrong language identifier ("jsx") for SQL DDL; update that code fence to use
    "sql" instead (replace the opening jsx with sql) so syntax highlighting
    and Prettier formatting are correct for the SQL statements in the block.
  • Around line 273-275: The fenced code block containing the JSON example { "host": "db.internal", "port": 5432 } is missing a language identifier; update
    the opening fence from tojson so the block becomes a JSON code block
    (ensuring markdownlint MD040 compliance and proper Prettier formatting).

</details>

---

<details>
<summary>ℹ️ Review info</summary>

<details>
<summary>⚙️ Run configuration</summary>

**Configuration used**: Path: .coderabbit.yaml

**Review profile**: CHILL

**Plan**: Pro

**Run ID**: `f3cc544a-7adf-41ce-857b-8945956093a8`

</details>

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between b832e03c426800206d8a132951b36a9cfd7741fb and a1045e096fc033d9ba49f371568bfaa6bce285f8.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `docs/rfc/0010-variable-storage.md`

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

@mleonidas mleonidas merged commit a9e6678 into main Apr 3, 2026
7 checks passed
@mleonidas mleonidas deleted the mleonidas/refactor_variables_rfc branch April 3, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants