afyx-engineering-kit 0.1.0-alpha.6 → 0.1.0-alpha.7

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.
@@ -1 +1 @@
1
- 70352243e5f312a082ac394c470031750ba32f36
1
+ 251f73a8f91cd7b9194a2bd730966c1d92f86da0
@@ -3,19 +3,19 @@
3
3
  "product": "Afyx Graph",
4
4
  "product_version": "1.0.0",
5
5
  "release_tag": "afyx-graph-v1.0.0",
6
- "source_revision": "70352243e5f312a082ac394c470031750ba32f36",
6
+ "source_revision": "251f73a8f91cd7b9194a2bd730966c1d92f86da0",
7
7
  "integrity_claim": "sha256",
8
8
  "publisher_authenticity": "requires-independent-attestation",
9
9
  "artifacts": [
10
10
  {
11
11
  "file": "afyx-graph-linux-x64.tar.gz",
12
12
  "target": "linux-x64",
13
- "sha256": "6d8f7870431a58e460850ca237ceeed82d5f4e32ca3348a753a2d14084eccc6a"
13
+ "sha256": "5c657a46f86652d9f32f1b8045c60a41ab8c6f2bc46aeb55a943db1b65ea0b83"
14
14
  },
15
15
  {
16
16
  "file": "afyx-graph-win32-x64.zip",
17
17
  "target": "win32-x64",
18
- "sha256": "98223eb13c1a6196f90c610f945ac6a94cc3255c803c735fbd790cf7448f2f63"
18
+ "sha256": "720878c50518e4650a529cd6a766d4c8cdec173863799b8ea9c966c36601bd25"
19
19
  }
20
20
  ]
21
21
  }
@@ -1,2 +1,2 @@
1
- 6d8f7870431a58e460850ca237ceeed82d5f4e32ca3348a753a2d14084eccc6a afyx-graph-linux-x64.tar.gz
2
- 98223eb13c1a6196f90c610f945ac6a94cc3255c803c735fbd790cf7448f2f63 afyx-graph-win32-x64.zip
1
+ 5c657a46f86652d9f32f1b8045c60a41ab8c6f2bc46aeb55a943db1b65ea0b83 afyx-graph-linux-x64.tar.gz
2
+ 720878c50518e4650a529cd6a766d4c8cdec173863799b8ea9c966c36601bd25 afyx-graph-win32-x64.zip
package/install.sh CHANGED
@@ -17,6 +17,7 @@ update_installed=false
17
17
  component_actions=()
18
18
  component_action_count=0
19
19
  preset=
20
+ implicit_preset=false
20
21
  custom_component_list=
21
22
  offline=false
22
23
  no_build_fallback=false
@@ -176,6 +177,7 @@ if [[ -t 0 && -z "${CI:-}" ]] && ! "$dry_run"; then interactive=true; fi
176
177
  if [[ -z "$preset" && "$component_action_count" -eq 0 && "$interactive" == false &&
177
178
  "$validate_only" == false && "$update_installed" == false && "$force" == false ]]; then
178
179
  preset=recommended
180
+ implicit_preset=true
179
181
  fi
180
182
 
181
183
  available_version() {
@@ -219,6 +221,9 @@ component_action() {
219
221
  fi
220
222
  available="$(available_version "$id")"
221
223
  if action="$(explicit_action "$id")"; then :
224
+ elif "$implicit_preset" && [[ "$state" == DRIFTED && "$(afyx_component_field "$id" type)" == skill ]]; then
225
+ # A default selection does not authorize discarding local skill edits.
226
+ action=skip
222
227
  elif [[ -n "$preset" ]]; then
223
228
  afyx_control_classify "$id" "$state" "$preset" "$custom_component_list" "$provider_list"
224
229
  if [[ "$AFYX_DESIRED" != true || "$AFYX_DRIFT" == NOT_APPLICABLE ]]; then action=skip
@@ -522,7 +527,7 @@ expert_action="$(component_action afyx-engineering-expert 'Afyx Engineering Expe
522
527
  for additional_root in ${additional_skill_roots[@]+"${additional_skill_roots[@]}"}; do
523
528
  for skill_spec in "efficient-coding|$efficient_action" "odoo-engineering|$odoo_action" "afyx-engineering-expert|$expert_action"; do
524
529
  skill_id="${skill_spec%%|*}"; skill_action="${skill_spec#*|}"
525
- if [[ -n "$preset" ]] && afyx_component_desired "$skill_id" "$preset" "$custom_component_list" "$provider_list"; then skill_action=install; fi
530
+ if ! "$implicit_preset" && [[ -n "$preset" ]] && afyx_component_desired "$skill_id" "$preset" "$custom_component_list" "$provider_list"; then skill_action=install; fi
526
531
  [[ "$skill_action" != skip && "$skill_action" != adopt ]] || continue
527
532
  target="$additional_root/$skill_id"
528
533
  afyx_classify_skill "$target" "$skill_id" afyx
@@ -547,7 +552,7 @@ elif [[ "$expert_action" != skip ]]; then expert_result="$(safe_skill_install af
547
552
 
548
553
  replicate_provider_skill() {
549
554
  local id="$1" label="$2" source="$3" action="$4" root target replace result
550
- if [[ -n "$preset" ]] && afyx_component_desired "$id" "$preset" "$custom_component_list" "$provider_list"; then action=install; fi
555
+ if ! "$implicit_preset" && [[ -n "$preset" ]] && afyx_component_desired "$id" "$preset" "$custom_component_list" "$provider_list"; then action=install; fi
551
556
  [[ "$action" != skip && "$action" != adopt ]] || return 0
552
557
  for root in ${additional_skill_roots[@]+"${additional_skill_roots[@]}"}; do
553
558
  target="$root/$id"
@@ -558,7 +563,9 @@ replicate_provider_skill() {
558
563
  if [[ "$(afyx_skill_version "$target")" == "$(afyx_skill_version "$source")" ]]; then printf '%s [%s]: skipped\n' "$label" "$root"; continue; fi
559
564
  replace=true
560
565
  ;;
561
- AFYX_OWNED_MODIFIED) replace=true ;;
566
+ AFYX_OWNED_MODIFIED)
567
+ if "$implicit_preset"; then printf '%s [%s]: modified content preserved; explicit repair required\n' "$label" "$root"; continue; fi
568
+ replace=true ;;
562
569
  *) printf 'Refusing to replace %s at provider skill root %s because ownership is %s.\n' "$label" "$root" "$AFYX_OWNERSHIP_STATE" >&2; exit 1 ;;
563
570
  esac
564
571
  result="$(safe_skill_install "$id" "$label" "$source" "$target" "$replace")"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "afyx-engineering-kit",
3
- "version": "0.1.0-alpha.6",
3
+ "version": "0.1.0-alpha.7",
4
4
  "description": "Universal cross-platform CLI installer and lifecycle manager for AFYX Engineering Kit",
5
5
  "type": "module",
6
6
  "main": "./bin/afyx-engineering-kit.mjs",
@@ -54,30 +54,34 @@ function Assert-SafeRoot {
54
54
  }
55
55
 
56
56
  function Resolve-SourceRevision {
57
- if ($SourceRevision) { return $SourceRevision }
58
- $revFile = Join-Path $packageRoot '.afyx-source-revision'
59
- if (Test-Path -LiteralPath $revFile -PathType Leaf) {
60
- $fromFile = (Get-Content -Raw -LiteralPath $revFile -Encoding utf8).Trim()
61
- if ($fromFile) { return $fromFile }
57
+ if ($SourceRevision) {
58
+ if ($SourceRevision -cnotmatch '^[0-9a-f]{40}$') { throw 'Explicit source revision is invalid.' }
59
+ return $SourceRevision
62
60
  }
63
61
  $gitCmd = Get-Command git -ErrorAction SilentlyContinue
64
- if ($gitCmd) {
62
+ if ($gitCmd -and (Test-Path -LiteralPath (Join-Path $packageRoot '.git'))) {
65
63
  $rev = ((& $gitCmd.Source -C $packageRoot rev-parse HEAD 2>$null) -join '').Trim()
66
- if ($LASTEXITCODE -eq 0 -and $rev) { return $rev }
64
+ if ($LASTEXITCODE -eq 0 -and $rev -cmatch '^[0-9a-f]{40}$') { return $rev }
65
+ }
66
+ $revFile = Join-Path $packageRoot '.afyx-source-revision'
67
+ if (Test-Path -LiteralPath $revFile -PathType Leaf) {
68
+ $fromFile = (Get-Content -Raw -LiteralPath $revFile -Encoding utf8).Trim()
69
+ if ($fromFile -cnotmatch '^[0-9a-f]{40}$') { throw 'Packaged source revision marker is invalid.' }
70
+ return $fromFile
67
71
  }
68
72
  return 'unknown'
69
73
  }
70
74
 
71
75
  function Resolve-SourceProvenance {
72
- $revFile = Join-Path $packageRoot '.afyx-source-revision'
73
- if (Test-Path -LiteralPath $revFile -PathType Leaf) { return 'RELEASE_CANDIDATE_SNAPSHOT' }
74
76
  $gitCmd = Get-Command git -ErrorAction SilentlyContinue
75
- if ($gitCmd) {
77
+ if ($gitCmd -and (Test-Path -LiteralPath (Join-Path $packageRoot '.git'))) {
76
78
  $dirty = ((& $gitCmd.Source -C $packageRoot status --porcelain -- afyx-forge 2>$null) -join '').Trim()
77
79
  if ($LASTEXITCODE -eq 0) {
78
80
  return $(if ($dirty) { 'LOCAL_SOURCE_DIRTY' } else { 'LOCAL_SOURCE_CLEAN' })
79
81
  }
80
82
  }
83
+ $revFile = Join-Path $packageRoot '.afyx-source-revision'
84
+ if (Test-Path -LiteralPath $revFile -PathType Leaf) { return 'RELEASE_CANDIDATE_SNAPSHOT' }
81
85
  return 'LOCAL_SOURCE_UNVERIFIED'
82
86
  }
83
87
 
@@ -94,30 +94,29 @@ json_value() {
94
94
 
95
95
  resolve_source_revision() {
96
96
  if [[ -n "$source_revision" ]]; then
97
+ [[ "$source_revision" =~ ^[0-9a-f]{40}$ ]] || { printf 'Explicit source revision is invalid.\n' >&2; return 1; }
97
98
  printf '%s\n' "$source_revision"
98
99
  return 0
99
100
  fi
100
- if [[ -f "$PACKAGE_ROOT/.afyx-source-revision" ]]; then
101
- tr -d '\r\n' < "$PACKAGE_ROOT/.afyx-source-revision"
102
- printf '\n'
103
- return 0
104
- fi
105
101
  if [[ -e "$PACKAGE_ROOT/.git" ]] && command -v git >/dev/null 2>&1; then
106
102
  local rev
107
103
  rev="$(git -C "$PACKAGE_ROOT" rev-parse HEAD 2>/dev/null || true)"
108
- if [[ -n "$rev" ]]; then
104
+ if [[ "$rev" =~ ^[0-9a-f]{40}$ ]]; then
109
105
  printf '%s\n' "$rev"
110
106
  return 0
111
107
  fi
112
108
  fi
109
+ if [[ -f "$PACKAGE_ROOT/.afyx-source-revision" ]]; then
110
+ local marker
111
+ marker="$(tr -d '\r\n' < "$PACKAGE_ROOT/.afyx-source-revision")"
112
+ [[ "$marker" =~ ^[0-9a-f]{40}$ ]] || { printf 'Packaged source revision marker is invalid.\n' >&2; return 1; }
113
+ printf '%s\n' "$marker"
114
+ return 0
115
+ fi
113
116
  printf '%s\n' 'unknown'
114
117
  }
115
118
 
116
119
  resolve_source_provenance() {
117
- if [[ -f "$PACKAGE_ROOT/.afyx-source-revision" ]]; then
118
- printf '%s\n' 'RELEASE_CANDIDATE_SNAPSHOT'
119
- return 0
120
- fi
121
120
  if [[ -e "$PACKAGE_ROOT/.git" ]] && command -v git >/dev/null 2>&1 && git -C "$PACKAGE_ROOT" rev-parse HEAD >/dev/null 2>&1; then
122
121
  local dirty
123
122
  dirty="$(git -C "$PACKAGE_ROOT" status --porcelain -- afyx-forge 2>/dev/null || true)"
@@ -128,6 +127,10 @@ resolve_source_provenance() {
128
127
  fi
129
128
  return 0
130
129
  fi
130
+ if [[ -f "$PACKAGE_ROOT/.afyx-source-revision" ]]; then
131
+ printf '%s\n' 'RELEASE_CANDIDATE_SNAPSHOT'
132
+ return 0
133
+ fi
131
134
  printf '%s\n' 'LOCAL_SOURCE_UNVERIFIED'
132
135
  }
133
136
 
package/verify.ps1 CHANGED
@@ -22,6 +22,7 @@ Set-StrictMode -Version Latest
22
22
  $ErrorActionPreference = 'Stop'
23
23
  $coreFailure = $false
24
24
  $configuredProviders = @()
25
+ $claudeCommand = Get-Command claude -ErrorAction SilentlyContinue
25
26
  $codexHome = if ($env:CODEX_HOME) { $env:CODEX_HOME } else { Join-Path $env:USERPROFILE '.codex' }
26
27
  $configPath = Join-Path $codexHome 'config.toml'
27
28
  $graphRoot = if ($GraphRuntimeRoot) { $GraphRuntimeRoot } elseif ($env:AFYX_GRAPH_RUNTIME_ROOT) { $env:AFYX_GRAPH_RUNTIME_ROOT } else { Join-Path $env:USERPROFILE '.afyx\graph' }
@@ -45,6 +46,7 @@ function Write-Result([string]$State, [string]$Name, [string]$Detail = '') {
45
46
  Import-Module (Join-Path $PSScriptRoot 'scripts\lib\AfyxComponents.psm1') -Force
46
47
  Import-Module (Join-Path $PSScriptRoot 'scripts\lib\AfyxSkillLifecycle.psm1') -Force -DisableNameChecking
47
48
  $providerIds = @(Get-AfyxProviderRegistry | ForEach-Object { [string]$_.provider })
49
+ $Provider = @($Provider | ForEach-Object { $_ -split ',' } | ForEach-Object { $_.Trim() } | Where-Object { $_ } | Select-Object -Unique)
48
50
  $unknownProviders = @($Provider | Where-Object { $_ -notin $providerIds })
49
51
  if ($unknownProviders.Count) { throw "Unknown provider(s): $($unknownProviders -join ', ')" }
50
52
  $providerSkillRoots = @()
@@ -112,7 +114,6 @@ if ($Provider.Count -and -not $SkipProviderConfiguration) {
112
114
  '--node', $nodeCommand.Source, '--entry', $entry)
113
115
  $codexHost = Get-AfyxCodexHost
114
116
  $codexCommand = if ($codexHost.State -eq 'CLI_READY') { [pscustomobject]@{ Source = $codexHost.Path } } else { $null }
115
- $claudeCommand = Get-Command claude -ErrorAction SilentlyContinue
116
117
  if ($codexCommand) { $providerArguments += @('--codex', $codexCommand.Source) }
117
118
  if ($claudeCommand) { $providerArguments += @('--claude', $claudeCommand.Source) }
118
119
  if ($ClaudeConfigDir) { $providerArguments += @('--claude-config-dir', $ClaudeConfigDir) }
package/verify.sh CHANGED
@@ -142,7 +142,7 @@ if command -v tar >/dev/null 2>&1 && { command -v shasum >/dev/null 2>&1 || comm
142
142
  codex_detected=false
143
143
  if command -v codex >/dev/null 2>&1; then
144
144
  codex_detected=true
145
- if version="$(codex --version 2>/dev/null)"; then result OK 'Codex CLI' "$version"; elif "$provider_explicit" && [[ ",$provider_list," == *,codex,* ]]; then result FAIL 'Codex CLI' 'selected host version command failed'; core_failure=true; else result WARN 'Codex CLI' 'version command failed (not selected)'; fi
145
+ if version="$(codex --version 2>/dev/null)"; then result OK 'Codex CLI' "$version"; elif [[ ",$provider_list," == *,codex,* ]]; then result FAIL 'Codex CLI' 'version command failed'; core_failure=true; else result WARN 'Codex CLI' 'version command failed (not selected)'; fi
146
146
  else result SKIP 'Codex CLI' 'PROVIDER_NOT_INSTALLED'; fi
147
147
  extension_detected=false
148
148
  for extension in "$HOME"/.vscode/extensions/openai.chatgpt-*; do [[ -d "$extension" ]] && { extension_detected=true; break; }; done