Ready for draft PR; deployment acceptance blocked
Four independent reviewers found no findings. Ten Python checks, full Go suite and current Go linter pass. The helper was exercised on the actual processed template; only Runtime differs and CloudFormation lint passes. Exact source archive read was denied, so packaged Python compatibility remains unverified and no deployment is accepted.
ff86248f31ac043b0cdd8f4ebb6d7497e1be9853 [feat]: Prepare runtime-only standalone builder migration Prepare a supported-runtime copy of the old builder stack without changing its Python package or site. Existing code compatibility still needs testing.
A local JSON transformation accepts the exported deployed template, checks the known function and changes Runtime only. It refuses overwrites and makes no AWS calls.
Original SAM and processed CloudFormation forms retain code locator, role, logical ID, wiring and resource attributes. Whole-template equality after restoring the old runtime verifies preservation. The exact archive read is denied, preventing Python/dependency and binding validation.
scripts/prepare-builder-runtime-template.py
Why it matters. Avoid replacing the existing stack with the combined site template.
What to look at. prepare() and exclusive output creation
test/lambda/test_builder_migration.py
Why it matters. Runtime-only must mean no hidden resource, policy or package changes.
What to look at. Original/processed equality, wrapper input, wrong target and file overwrite tests
docs/lambda-runtime-upgrade.md
Why it matters. Different logical IDs and packaging did not establish unrelated provenance.
What to look at. Source coverage and standalone preparation sections
Keep the existing package rather than substitute unverified code. D12/D13 preserve rationale and the corrected source mapping.
Source: local run at 2026-10-17T13:35:28.917818+00:00 · snapshot ff86248f31ac043b0cdd8f4ebb6d7497e1be9853
Baseline: none
Execution: passed · JUnit: 1 file · Coverage: none · Baseline: absent
Coverage scope: as the project configures it
Totals: 10 passed · 0 failed · 0 skipped · 0 errored · 0 flaky
Derived by declaration name, from the diff (no baseline run).
Files that import a changed file on the left, changed files in the centre, files a changed file imports on the right. Snapshot working-tree against base b30a73c20cb77bcc90f4c492982b1dded2bebf53.
9 files: 2 code · 7 docs. Click to expand.
diff --git a/scripts/prepare-builder-runtime-template.py b/scripts/prepare-builder-runtime-template.pynew file mode 100644index 0000000..64e48db--- /dev/null+++ b/scripts/prepare-builder-runtime-template.py@@ -0,0 +1,63 @@+#!/usr/bin/env python3+"""Prepare a runtime-only update for Fog's older standalone builder; never call AWS."""+import argparse+import copy+import json+from pathlib import Path+import sys+++RUNTIME = 'python3.14'+LOGICAL_ID = 'HelloWorldFunction'+++def prepare(template):+ """Preserve the deployed template except for the known standalone runtime."""+ if not isinstance(template, dict):+ raise ValueError('Expected a CloudFormation template JSON object')+ # Accept the JSON response from GetTemplate as well as its TemplateBody.+ if 'TemplateBody' in template:+ template = template['TemplateBody']+ if isinstance(template, str):+ try:+ template = json.loads(template)+ except json.JSONDecodeError as error:+ raise ValueError('TemplateBody must be JSON; export the Processed template') from error+ if not isinstance(template, dict):+ raise ValueError('TemplateBody must be a JSON object')+ resources = template.get('Resources', {})+ function = resources.get(LOGICAL_ID, {})+ properties = function.get('Properties', {})+ resource_type = function.get('Type')+ if resource_type not in ('AWS::Lambda::Function', 'AWS::Serverless::Function'):+ raise ValueError('Expected the existing HelloWorldFunction Lambda resource')+ if properties.get('Handler') != 'app.lambda_handler':+ raise ValueError('Expected the existing app.lambda_handler; refusing a different builder')+ if properties.get('Runtime') not in ('python3.9', RUNTIME):+ raise ValueError('Expected the inventoried python3.9 runtime or an already prepared template')+ code_key = 'Code' if resource_type == 'AWS::Lambda::Function' else 'CodeUri'+ if not properties.get(code_key) or 'InlineCode' in properties:+ raise ValueError('Expected the existing packaged code locator; refusing replacement code')+ candidate = copy.deepcopy(template)+ candidate['Resources'][LOGICAL_ID]['Properties']['Runtime'] = RUNTIME+ return candidate+++def main():+ parser = argparse.ArgumentParser(description=__doc__)+ parser.add_argument('input', type=Path, help='Existing deployed template or GetTemplate JSON response')+ parser.add_argument('output', type=Path, help='New candidate JSON file; must not already exist')+ args = parser.parse_args()+ try:+ candidate = prepare(json.loads(args.input.read_text()))+ # Never overwrite an export or an earlier review candidate.+ with args.output.open('x') as output:+ output.write(json.dumps(candidate, indent=2) + '\n')+ except (OSError, ValueError, TypeError, AttributeError) as error:+ parser.exit(2, f'{error}\n')+ print(f'Prepared {args.output}: only {LOGICAL_ID}.Properties.Runtime -> {RUNTIME}')+ print('No AWS call made. Existing packaged Python compatibility is unverified.', file=sys.stderr)+++if __name__ == '__main__':+ main()
diff --git a/test/lambda/test_builder_migration.py b/test/lambda/test_builder_migration.pynew file mode 100644index 0000000..39b9fae--- /dev/null+++ b/test/lambda/test_builder_migration.py@@ -0,0 +1,100 @@+"""Verify standalone migration preserves resource identity, package and site binding."""+import copy+import importlib.util+import json+from pathlib import Path+import subprocess+import sys+import tempfile+import unittest++ROOT = Path(__file__).resolve().parents[2]+SCRIPT = ROOT / 'scripts/prepare-builder-runtime-template.py'+SPEC = importlib.util.spec_from_file_location('builder_migration', SCRIPT)+migration = importlib.util.module_from_spec(SPEC)+SPEC.loader.exec_module(migration)+++def deployed_template(processed=False):+ properties = {+ 'Runtime': 'python3.9', 'Handler': 'app.lambda_handler',+ 'Architectures': ['x86_64'],+ }+ if processed:+ properties.update(Code={'S3Bucket': 'existing-source', 'S3Key': 'immutable-package'},+ Role={'Fn::GetAtt': ['HelloWorldFunctionRole', 'Arn']}, Timeout=3)+ else:+ properties.update(CodeUri='s3://existing-source/immutable-package',+ Policies=[{'Statement': [{'Effect': 'Allow', 'Action': ['amplify:*'],+ 'Resource': '*'}]}])+ template = {+ 'AWSTemplateFormatVersion': '2010-09-09',+ 'Description': 'Lambda function for running Amplify job',+ 'Resources': {'HelloWorldFunction': {+ 'Type': 'AWS::Lambda::Function' if processed else 'AWS::Serverless::Function',+ 'Properties': properties,+ }},+ }+ if processed:+ template['Resources']['HelloWorldFunctionRole'] = {+ 'Type': 'AWS::IAM::Role', 'Properties': {'Policies': [{'PolicyName': 'existing'}]},+ }+ else:+ template['Transform'] = 'AWS::Serverless-2016-10-31'+ return template+++class BuilderMigrationTests(unittest.TestCase):+ def test_original_and_processed_preserve_everything_except_runtime(self):+ for processed in (False, True):+ with self.subTest(processed=processed):+ original = deployed_template(processed)+ before = copy.deepcopy(original)+ candidate = migration.prepare(original)+ self.assertEqual(original, before)+ self.assertEqual(candidate['Resources']['HelloWorldFunction']['Properties']['Runtime'],+ 'python3.14')+ candidate['Resources']['HelloWorldFunction']['Properties']['Runtime'] = 'python3.9'+ self.assertEqual(candidate, before)++ def test_accepts_get_template_json_body_and_is_idempotent(self):+ for body in (deployed_template(), json.dumps(deployed_template())):+ candidate = migration.prepare({'TemplateBody': body, 'StagesAvailable': ['Original']})+ self.assertEqual(migration.prepare(candidate), candidate)++ def test_refuses_wrong_resource_handler_runtime_or_missing_package(self):+ for field, value in [('Type', 'AWS::S3::Bucket'), ('Handler', 'index.lambda_handler'),+ ('Runtime', 'python3.12'), ('CodeUri', '')]:+ with self.subTest(field=field):+ template = deployed_template()+ function = template['Resources']['HelloWorldFunction']+ target = function if field == 'Type' else function['Properties']+ target[field] = value+ with self.assertRaises(ValueError):+ migration.prepare(template)+ with self.assertRaises(ValueError):+ migration.prepare({'Resources': {'TriggerFunction': {}}})+ with self.assertRaises(ValueError):+ migration.prepare({'TemplateBody': 'Resources: {}'})++ def test_cli_writes_candidate_but_never_overwrites_files(self):+ with tempfile.TemporaryDirectory() as temp:+ source, output = Path(temp) / 'deployed.json', Path(temp) / 'candidate.json'+ source.write_text(json.dumps(deployed_template(True)))+ before = source.read_bytes()+ command = [sys.executable, str(SCRIPT), str(source), str(output)]+ result = subprocess.run(command, capture_output=True, text=True)+ self.assertEqual(result.returncode, 0, result.stderr)+ self.assertIn('compatibility is unverified', result.stderr)+ candidate = output.read_bytes()+ result = subprocess.run(command, capture_output=True, text=True)+ self.assertEqual(result.returncode, 2)+ self.assertEqual(output.read_bytes(), candidate)+ self.assertEqual(source.read_bytes(), before)+ result = subprocess.run([*command[:-1], str(source)], capture_output=True, text=True)+ self.assertEqual(result.returncode, 2)+ self.assertEqual(source.read_bytes(), before)+++if __name__ == '__main__':+ unittest.main()
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex f70c545..eb7dfcd 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -2,6 +2,7 @@ Unreleased ========== ### Changed+- Added runtime-only template preparation for the older standalone report builder, preserving its packaged code, resource identity and Amplify binding; corrected its source coverage and documented unverified package compatibility. - Report Lambda templates now use Amazon Linux 2023 and Python 3.14, with x86_64/ARM64 bootstrap packaging, explicit architecture selection, current Go/runtime client and main-only CI publication alongside GitHub artifacts; see docs/lambda-runtime-upgrade.md before deployment. ### Fixed
diff --git a/README.md b/README.mdindex e9c8cd0..2357db9 100644--- a/README.md+++ b/README.md@@ -15,7 +15,7 @@ Fog is a tool to manage your CloudFormation deployments and ensure you have all - **[Advanced Usage](docs/user-guide/advanced-usage.md)** - Complex scenarios and CI/CD integration - **[Troubleshooting Guide](docs/user-guide/troubleshooting.md)** - Solutions to common problems -- **[Report Lambda runtime migration](docs/lambda-runtime-upgrade.md)** - Bootstrap packaging, supported runtimes and deployment prerequisites+- **[Report Lambda runtime migration](docs/lambda-runtime-upgrade.md)** - Bootstrap packaging, supported runtimes, standalone builder preparation and deployment prerequisites ### Diagrams
diff --git a/docs/lambda-runtime-upgrade.md b/docs/lambda-runtime-upgrade.mdindex a438166..677354f 100644--- a/docs/lambda-runtime-upgrade.md+++ b/docs/lambda-runtime-upgrade.md@@ -78,14 +78,17 @@ and the [official v8.0.2 release](https://github.com/actions/download-artifact/r separately to `fog/al2023/{architecture}/{release-tag}.zip`; use that exact tag as `FogVersion`. The default `latest` requires a separately published alias under the selected architecture. Main-only publishing supplies `unstable` after an- authorized merge/main push. No objects were published during this work.-3. Verify bucket region/availability and existing publisher permission for the new- keys before merge. No IAM changes are made. Do not use the x86_64 alias for ARM64.+ authorized merge/main push. After the authorised PR #216 merge, the main workflow+ successfully published all four unstable archives (run 39035856705).+3. Verify artifact availability for the selected version and region before deployment.+ The main publisher successfully wrote the new unstable keys; no IAM changes were+ needed. Do not use the x86_64 alias for ARM64. 4. Review each owning stack's actual template and source artifact before updating runtime and code together. Preserve deployed parameters, architecture, triggers- and policies. Existing runtime/architecture/handler and stack ownership are- inventoried below; exact deployed template, S3 keys and source equivalence remain- unverified because `GetTemplate` and `GetFunctionConfiguration` are denied.+ and policies. Original-template and function-configuration reads now succeed.+ The deployed builder variants have different logical IDs and packaging; do not+ apply the full maintained builder template over the older standalone stack.+ Preserve its logical ID and external site integration during an authorised upgrade. 5. Validate report generation and Amplify rebuilds only in a separately authorized deployment. Plan rollback with a previous compatible bootstrap artifact; deprecated runtime rollback may be blocked. Use versioned artifact keys because@@ -93,27 +96,79 @@ and the [official v8.0.2 release](https://github.com/actions/download-artifact/r ## Deployed-source coverage -The renewed-session read-only check on 17 October independently confirmed all five-stack/logical-resource/function relationships with `ListStackResources`. Permitted-`ListFunctions` reads confirmed the runtime, architecture and handler. Authentication-works, but the current ViewOnlyAccess roles deny `GetTemplate` and-`GetFunctionConfiguration`; no denied operation was retried or circumvented. No code-archives were downloaded. Source-to-stack ownership is confirmed; exact deployed-source/template matching is not.+The initial renewed-session check confirmed all five stack/function relationships,+but template/configuration reads were denied. After the user updated the read policy,+both reads succeeded for all five targets. No source archives were downloaded. | Audit target | Runtime / architecture / handler | Source coverage | |---|---|---|-| PT 2022 report generator, Sydney | go1.x / x86_64 / fog | Confirmed fogreport-lambda / ReportGeneratorFunction ownership matches maintained template. New x86_64 bootstrap supported; exact deployed template/code key unreadable. |-| PT 2022 report generator, Virginia | go1.x / x86_64 / fog | Same confirmed ownership and supported x86_64 migration. |-| Demo 2023 report generator, Virginia | provided.al2 / arm64 / bootstrap | Confirmed same stack/logical ID. Select LambdaArchitecture=arm64 and the ARM64 ZIP; exact deployed definition/source remains unreadable. |-| Demo 2023 builder trigger, Virginia | python3.9 / x86_64 / index.lambda_handler | Confirmed fogreport-builder / TriggerFunction ownership matches maintained inline-handler definition. Python 3.14 target; inline-source equivalence unverified. |-| Fog Report legacy build trigger, Sydney | python3.9 / x86_64 / app.lambda_handler | Separate fog-reports-trigger-build / HelloWorldFunction stack. Description confirms an Amplify build job; no confirmed source found. Remains outside PR coverage. |+| PT 2022 report generator, Sydney | go1.x / x86_64 / fog | Maintained report-template variant with an older pinned SAM artifact. Set LambdaArchitecture=x86_64 and migrate its code locator deliberately. |+| PT 2022 report generator, Virginia | go1.x / x86_64 / fog | Maintained report template; only a semantically equivalent artifact-bucket expression differs from the baseline. |+| Demo 2023 report generator, Virginia | provided.al2 / arm64 / bootstrap | Maintained report-template variant; select LambdaArchitecture=arm64 and matching ARM64 ZIP. |+| Demo 2023 builder trigger, Virginia | python3.9 / x86_64 / index.lambda_handler | Original template exactly matches the pre-upgrade maintained builder template; inline Python matches the current source. Python 3.14 target. |+| Fog Report build trigger, Sydney | python3.9 / x86_64 / app.lambda_handler | Owner confirms the same Fog report builder pipeline, deployed as the older standalone fog-reports-trigger-build / HelloWorldFunction stack. Current template packages Python in a SAM ZIP instead of using the maintained inline TriggerFunction. Python 3.14 is the maintained target, but the standalone deployment adaptation and packaged-code comparison remain outstanding. |++The Sydney function's CloudFormation tags identify its exact standalone stack and+logical ID. They do not name a Git file or prove that the packaged Python equals+the maintained inline handler. Its original template contains only the trigger;+its processed template contains the function and generated role. The maintained+`examples/templates/fogreport-builder.yaml` defines the combined site infrastructure+and inline trigger. These are different deployment shapes within the same pipeline.+PR #216 updates the maintained builder runtime, but does not provide a directly+applicable update for the old standalone logical resource. A future authorised+migration must preserve that identity and verify its existing Python and Amplify+application/branch binding before changing runtime or packaging. Describing it as+unrelated or outside Fog's maintained pipeline was an incorrect inference from the+logical ID and packaging differences. Deployed ZIP contents remain unverified;+template provenance supplied by the owner is distinct from byte-for-byte code identity.++## Prepare the older standalone builder update++The combined builder template must not replace the older standalone stack. Use+`scripts/prepare-builder-runtime-template.py` to prepare a candidate from that+stack's existing template. It makes no AWS calls and changes only+`Resources.HelloWorldFunction.Properties.Runtime` from `python3.9` to `python3.14`.+It keeps the packaged Python, handler, code locator, architecture, generated role,+other resources and any existing event permissions unchanged. Therefore any Amplify+application/branch binding contained in the package is retained without guessing it.+This preserves the binding; it does not verify that the old code runs on Python 3.14.++Export the existing **Processed** template with the already authorised read-only+profile and correct region. Substitute the exact owning stack ID from the function's+CloudFormation tags; these commands prepare local files only:++```sh+aws --profile READ_ONLY_PROFILE --region STACK_REGION cloudformation get-template \+ --stack-name EXACT_STACK_ID --template-stage Processed --output json \+ > /tmp/builder-current.json+python3 scripts/prepare-builder-runtime-template.py \+ /tmp/builder-current.json /tmp/builder-python314-candidate.json+```++The helper accepts a JSON template or the JSON GetTemplate response. JSON Original+SAM templates are also accepted; YAML bodies must be exported/converted to JSON+first. It refuses a different logical resource, handler, source runtime or missing+code locator, and refuses to overwrite the export or any existing candidate.+The existing CI unittest discovery checks preservation and refusal cases.++**Prepared candidate is not deployment acceptance.** The current read-only profile+denied `s3:GetObject` for the known source archive, so no packaged code was read and+no alternate source-download route was attempted. Before deploying, recover that+exact archive through separately granted access, compare its Python/dependencies+with the maintained inline handler, and test its Python 3.14 compatibility and+existing Amplify application/branch binding. Keep any resulting code/package change+separate from this runtime-only candidate. Review a future CloudFormation change set+for the existing stack and expect only the function Runtime change; reject resource+replacement, new site resources, role/policy changes or changed event wiring.+Deployment, invocation, change-set creation and IAM changes are outside this helper+and were not performed for this follow-up. The adjacent `fogreport-generator` repository is an older CDK/site prototype, not Fog's runtime entry point. Its tracked Go source has no Lambda runtime definition; a locally untracked `fullstack.yaml` defines site infrastructure without this trigger. Its modified go.mod and untracked fullstack.yaml/go.sum were preserved. Historical-site report files mention the legacy stack but do not establish maintained ownership.+site report files mention the older stack. The owner has now confirmed its role in+the same Fog builder pipeline. Other workshop HelloWorld SAM functions found locally do not prove this stack's source. Do not deploy a guessed template over the legacy stack.
diff --git a/specs/lambda-runtime-upgrade/decision_log.md b/specs/lambda-runtime-upgrade/decision_log.mdindex 82fd0ed..f08c762 100644--- a/specs/lambda-runtime-upgrade/decision_log.md+++ b/specs/lambda-runtime-upgrade/decision_log.md@@ -44,3 +44,30 @@ AWS evidence is limited to permitted metadata: stack/logical-resource ownership ARM64 local verification: both architecture packages build successfully; six Python 3.14 archive/alias/invalid-input/Runtime API/trigger tests pass; actionlint and cfn-lint pass with only previously recorded W1031/W3045 exclusions. Reuse, quality, efficiency and spec reviewers report no findings. Native Linux ARM64 acceptance awaits exact-head CI; task 4 stays open until that result is verified. Native validation accepted: exact implementation head 6bcf488 passes x86_64 build/tests/lint and the native ARM64 smoke of the downloaded ZIP (PR workflow run 39033796920). The main-only publish job was skipped. Task 4 is complete. No AWS operation or permission change was made.++## Source-mapping correction after merge++D12 corrects the earlier inference that the standalone Sydney trigger was outside+Fog source coverage. The owner confirms it belongs to the same builder pipeline.+Read-only tags identify fog-reports-trigger-build / HelloWorldFunction; Original+and Processed templates show a standalone packaged app.lambda_handler function,+while examples/templates/fogreport-builder.yaml defines the combined site and+inline TriggerFunction. Different logical IDs/packaging do not establish unrelated+provenance. PR #216 updates the maintained Python target but is not a drop-in+standalone-stack migration; packaged Python contents and binding remain unverified.+Retain the earlier findings as investigation history, superseded by this correction.+No replacement handler, guessed Amplify binding or live change is introduced.++After explicit merge authorisation, PR #216 merged as b30a73c. Main workflow+39035856705 passed both architecture checks and all four established archive uploads.+Template/configuration reads succeeded after the user applied the read policy;+earlier denial and pre-merge statements above describe their original checkpoints.++D13: Prepare the standalone update by transforming its exported deployed template,+changing only Runtime. Preserve the packaged code and its embedded Amplify binding+instead of introducing an unverified replacement handler or recreating site resources.+The bounded exact-archive s3:GetObject read was denied by the existing read-only+role; no retry or alternate download route was attempted. Runtime-only preparation+is testable without source access, but deployment acceptance remains blocked on+packaged code/dependency compatibility and binding verification. The helper accepts+JSON Original or Processed templates and never calls AWS or overwrites an export.
diff --git a/specs/lambda-runtime-upgrade/implementation.md b/specs/lambda-runtime-upgrade/implementation.mdindex cd170b6..c9c8643 100644--- a/specs/lambda-runtime-upgrade/implementation.md+++ b/specs/lambda-runtime-upgrade/implementation.md@@ -31,10 +31,16 @@ and Amplify execution still require separately authorized deployed validation. Maintained Fog templates, library/toolchain, archive builder, CI and contract tests are implemented. No AWS function has been upgraded by these source changes. Current-SSO works, but template/configuration reads are denied, so exact source/template-matching remains unverified; the separate legacy-HelloWorldFunction source was not found. Compatible S3 artifacts must be published-under separate authorization before updating any stack. Transit ticket creation is+template/configuration reads now succeed. The owner confirms the older standalone+Sydney trigger is part of the same builder pipeline. Its packaged app.lambda_handler+contents remain unverified; the combined maintained template's inline TriggerFunction+is not a drop-in update for that logical resource. A runtime-only standalone+candidate can now be prepared with scripts/prepare-builder-runtime-template.py;+it preserves all existing fields except Runtime. Exact source archive s3:GetObject+was denied. Code/dependency compatibility must be verified before a separately+authorised deployment. The authorised PR #216+merge and main publisher completed successfully; versioned release keys remain an+operator prerequisite. Transit ticket creation is blocked before request submission by a local MCP initialization timeout. The required LambdaArchitecture parameter selects both the function architecture@@ -42,3 +48,19 @@ and its architecture-qualified artifact key; no default silently migrates existi ARM64 deployments. Both ZIPs are built once, checked for correct ELF targets, then executed on matching Linux GitHub runners. Main-only publication waits for both jobs and retains legacy and unqualified x86_64 aliases.++## Standalone builder follow-up++Beginner: prepare an updated copy of the old builder stack without replacing its+site or Python package. The existing function identity and site binding stay intact.++Intermediate: the local helper accepts the deployed JSON template or GetTemplate+response and changes only HelloWorldFunction.Properties.Runtime to python3.14.+It refuses a different handler/runtime/resource and will not overwrite any file.+Existing CI discovery includes preservation and failure-path tests.++Expert: original SAM and processed CloudFormation forms retain their existing code+locator and all role/resource attributes; a semantic full-template comparison after+restoring the old runtime must equal the input. The helper makes no AWS calls.+The exact archive read was denied, so this is a reviewed runtime-only candidate,+not proof of Python/dependency compatibility or approval to deploy.
diff --git a/specs/lambda-runtime-upgrade/smolspec.md b/specs/lambda-runtime-upgrade/smolspec.mdindex d093b64..98cbbb5 100644--- a/specs/lambda-runtime-upgrade/smolspec.md+++ b/specs/lambda-runtime-upgrade/smolspec.md@@ -6,7 +6,9 @@ Fog report functions use deprecated Go and Python Lambda runtimes. Update mainta ## Requirements - Maintained report templates MUST select generally available supported Lambda runtimes, verified against official documentation. - The Go deployment archive MUST contain an executable Linux bootstrap matching the selected architecture at its root and run the existing report handler through the Lambda Runtime API.-- The Python trigger MUST request the same Amplify main branch RELEASE job and propagate service failures.+- The maintained inline Python trigger MUST request the same Amplify main branch RELEASE job and propagate service failures.+- A standalone builder migration candidate MUST preserve HelloWorldFunction identity, packaged code, handler, architecture, role, permissions and site binding; only Runtime may change. Preparation MUST NOT call AWS or overwrite existing files.+- Packaged Python compatibility MUST remain explicitly unverified if exact archive read access is denied; no alternate download or guessed replacement code is permitted. - Feature branch and pull request validation MUST NOT publish to AWS. - Changes MUST preserve report event, environment and output contracts; no AWS deployment, IAM changes, deletion or merge is in scope. @@ -17,7 +19,7 @@ Fog report functions use deprecated Go and Python Lambda runtimes. Update mainta - Add scripts/package-lambda.sh and a Makefile target using CGO_ENABLED=0, linux/amd64 or linux/arm64 and lambda.norpc. Reuse main.go handler selection and existing handler tests. - Update .github/workflows/push.yml and release.yaml to use the module toolchain and package bootstrap; validate with PRs and publish build artifacts to GitHub. Preserve existing OIDC/S3 publication only for main pushes, retain the legacy fog archive at fog/unstable.zip, and publish architecture-specific bootstraps at fog/al2023/{architecture}/unstable.zip while retaining the unqualified AL2023 x86_64 alias. The publisher waits for x86_64 and native ARM64 smoke checks. Feature/PR events skip all publisher steps. - Add executable archive/Runtime API smoke tests and inline Python success/failure tests; document migration in docs/lambda-runtime-upgrade.md and README.md.-- Audit the five known deployed functions through bounded metadata reads; document external legacy sources without editing their unrelated working changes.+- Audit the five known deployed functions through bounded metadata reads. The owner confirms the older standalone builder belongs to this pipeline. Add scripts/prepare-builder-runtime-template.py for a local JSON template transformation preserving its deployed shape, with focused preservation/refusal tests under test/lambda/. - Dependencies: aws-lambda-go implements the Runtime API; inline Python uses runtime-provided boto3. Out of scope: wholesale SDK/CLI dependency refresh, Amplify/site redesign and external legacy repository changes. Official sources checked 2026-10-16 UTC: https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html ; https://docs.aws.amazon.com/lambda/latest/dg/golang-package.html ; https://go.dev/dl/?mode=json ; https://proxy.golang.org/github.com/aws/aws-lambda-go/@latest . Audit targets and limitations are recorded in docs/lambda-runtime-upgrade.md. Embed Go timezone data to retain named report timezones in minimal images. GitHub release lambda-{architecture}.zip maps to fog/al2023/{architecture}/{release-tag}.zip; lambda.zip remains an x86_64 copy; latest is a separately published alias. No templates are deployable until a compatible object is published.@@ -26,7 +28,7 @@ Official sources checked 2026-10-16 UTC: https://docs.aws.amazon.com/lambda/late - Risk: changing runtime without changing the archive fails initialization. Mitigation: verify archive contents, executable mode, ELF architecture and a local Runtime API exchange using the extracted Linux archive on Linux x86_64 and arm64; on other hosts validate the archive and run a native binary using the same build tag. Verify a Runtime API error response without AWS calls, and handler success/error results with the existing report-generator test seam. - Risk: AWS publication might run on feature pushes. Mitigation: guard legacy build, credential configuration and S3 writes with push plus refs/heads/main conditions. - Prerequisite: separately authorize publication of the new artifact prefix and stack updates; existing hosted latest.zip is unsuitable for provided.al2023.-- Prerequisite: explicitly select the inventoried deployed architecture; the template has no architecture default. The 17 October inventory confirms x86_64 PT reports and the arm64 Demo report. Exact template/source matching remains unverified due to denied reads; legacy HelloWorld trigger source remains missing.+- Prerequisite: explicitly select the inventoried deployed architecture; the template has no architecture default. The 17 October inventory confirms x86_64 PT reports and the arm64 Demo report. Template/configuration matching now succeeds. The separate exact SAM archive read is denied (s3:GetObject), so packaged Python compatibility remains a deployment prerequisite. ## Escalation Note This change was scoped as a smolspec. If implementation reveals ambiguity only the user can resolve, an irreversible boundary (public API, persisted schema, auth path), or a contested architectural choice, stop and escalate to the full spec workflow rather than deciding it inline.
diff --git a/specs/lambda-runtime-upgrade/tasks.md b/specs/lambda-runtime-upgrade/tasks.mdindex 92791b6..5dba8ef 100644--- a/specs/lambda-runtime-upgrade/tasks.md+++ b/specs/lambda-runtime-upgrade/tasks.md@@ -14,3 +14,6 @@ references: - [x] 4. Both deployed architectures select matching bootstrap artifacts and pass native CI smoke checks <!-- id:zd468p4 --> - Blocked-by: zd468p2 (Bootstrap archives initialize via the Runtime API and CI validates without feature-branch AWS publication)++- [x] 5. Standalone builder candidate changes only Runtime and preserves package, identity and binding, verified by focused tests and actual-template comparison <!-- id:zd468p5 -->+ - Blocked-by: zd468p3 (Upgrade builds and tests pass with migration prerequisites documented)