Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 0 additions & 110 deletions .github/workflows/deploy-config-schema.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release-sce.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ jobs:
merge-multiple: true

- name: Create GitHub release
uses: softprops/action-gh-release@3d0d9888cb7fd7b750713d6e236d1fcb99157228 # v3.0.2
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
with:
tag_name: ${{ needs.resolve-release.outputs.tag }}
name: sce ${{ needs.resolve-release.outputs.tag }}
Expand Down
2 changes: 1 addition & 1 deletion .sce/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://sce.crocoder.dev/config.json",
"$schema": "https://sce.crocoder.dev/v0.4.0-pre-alpha-v5/config.json",
"agent_trace": {
"auto_sync": true
},
Expand Down
1 change: 1 addition & 0 deletions cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const PACKAGE_FALLBACK_INVENTORY: &str = "SHA256SUMS";
const OPTIONAL_WORKFLOW_MANIFEST: &str = "config/optional-workflows.json";
const OPTIONAL_WORKFLOW_MANIFEST_SCHEMA_VERSION: u64 = 1;
const CANONICAL_GENERATOR_INPUTS: &[&str] = &[
".version",
"config/pkl",
"config/lib/agent-trace-plugin/opencode-sce-agent-trace-plugin.ts",
"config/lib/bash-policy-plugin/opencode-bash-policy-plugin.ts",
Expand Down
4 changes: 4 additions & 0 deletions cli/src/services/agent_trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ use super::version::PACKAGE_VERSION;
pub const AGENT_TRACE_VERSION: &str = "0.1.0";
pub(crate) const SCE_WEB_BASE_URL: &str = "https://sce.crocoder.dev";

pub(crate) fn sce_config_schema_url() -> String {
format!("{SCE_WEB_BASE_URL}/v{PACKAGE_VERSION}/config.json")
}

const RANGE_CONTENT_HASH_PREFIX: &str = "murmur3:";
const RANGE_CONTENT_HASH_INPUT_VERSION: &[u8] = b"sce-agent-trace-range-content-hash-v1\0";
const TOUCHED_LINE_ADDED_TAG: &[u8] = b"added\0";
Expand Down
9 changes: 9 additions & 0 deletions cli/src/services/config/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,15 @@ mod agent_trace_config_tests {
)
}

#[test]
fn accepts_versioned_schema_declaration() {
let schema_url = format!(
"https://sce.crocoder.dev/v{}/config.json",
env!("CARGO_PKG_VERSION")
);
parse(&format!(r#"{{"$schema":"{schema_url}"}}"#)).unwrap();
}

#[test]
fn parses_agent_trace_repository_identity_keys() {
let config = parse(
Expand Down
17 changes: 15 additions & 2 deletions cli/src/services/setup/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ pub(crate) fn is_missing_git_remote_error(error: &anyhow::Error) -> bool {
/// Contains only the `$schema` declaration pointing to the SCE config JSON Schema.
fn repo_local_config_bootstrap_payload() -> String {
format!(
"{{\n \"$schema\": \"{}/config.json\"\n}}\n",
crate::services::agent_trace::SCE_WEB_BASE_URL
"{{\n \"$schema\": \"{}\"\n}}\n",
crate::services::agent_trace::sce_config_schema_url()
)
}

Expand Down Expand Up @@ -1949,6 +1949,19 @@ mod tests {
}
}

#[test]
fn repo_local_config_bootstrap_payload_uses_versioned_schema_url() {
let payload = repo_local_config_bootstrap_payload();

assert_eq!(
payload,
format!(
"{{\n \"$schema\": \"https://sce.crocoder.dev/v{}/config.json\"\n}}\n",
env!("CARGO_PKG_VERSION")
)
);
}

#[test]
fn resolve_setup_request_accepts_pi_target() {
let request = resolve_setup_request(options_with(|options| {
Expand Down
5 changes: 3 additions & 2 deletions config/pkl/base/sce-config-schema.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import "workflow-catalog.pkl" as catalog
import "../deps/org.json_schema/JsonSchema.pkl"

local presetIds = bash_policy_presets.presets.toList().map((preset) -> preset.id).toListing()
local configSchemaUrl = "https://sce.crocoder.dev/v\(read("../../../.version").text.trim())/config.json"

local optionalWorkflowIds = catalog.workflows.toMap()
.filter((_, workflow) -> workflow.optional)
Expand Down Expand Up @@ -59,15 +60,15 @@ local perDbRetrySchema = new JsonSchema {

local sceConfigSchema = new JsonSchema {
$schema = "https://json-schema.org/draft/2020-12/schema"
$id = "https://sce.crocoder.dev/config.json"
$id = configSchemaUrl
title = "SCE Config"
description = "Canonical JSON Schema for global and repo-local sce/config.json files."
type = "object"
additionalProperties = false
properties {
["$schema"] = new JsonSchema {
type = "string"
`const` = "https://sce.crocoder.dev/config.json"
`const` = configSchemaUrl
}
["log_level"] = new JsonSchema {
type = "string"
Expand Down
1 change: 1 addition & 0 deletions config/pkl/generator-inputs.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Repository-relative files and directories that determine generate.pkl output.
.version
config/pkl
config/lib/agent-trace-plugin/opencode-sce-agent-trace-plugin.ts
config/lib/bash-policy-plugin/opencode-bash-policy-plugin.ts
Expand Down
2 changes: 1 addition & 1 deletion context/cli/config-precedence-contract.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions context/glossary.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading