Skip to content

chore: add gitleaks pre-commit hook#3

Merged
cipher813 merged 1 commit into
mainfrom
chore/gitleaks-setup
Apr 7, 2026
Merged

chore: add gitleaks pre-commit hook#3
cipher813 merged 1 commit into
mainfrom
chore/gitleaks-setup

Conversation

@cipher813
Copy link
Copy Markdown
Owner

Summary

  • Add .pre-commit-config.yaml with gitleaks hook for pre-commit secret scanning
  • Update .gitignore for gitleaks config and baseline files

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cipher813 cipher813 merged commit a01bd9f into main Apr 7, 2026
1 check passed
@cipher813 cipher813 deleted the chore/gitleaks-setup branch April 7, 2026 20:45
cipher813 added a commit that referenced this pull request May 1, 2026
* feat(ci): wire deploy.yml + deploy-infrastructure.yml into system-wide changelog

Adds a final step to both deploy workflows that calls the
append-changelog composite action in alpha-engine-docs. Each
successful (or failed) deploy now emits one JSON to
s3://alpha-engine-research/changelog/.

Two distinct entries per merge that touches both surfaces:
- deploy.yml          → Phase 2 Lambda image rebuild + alias bump
- deploy-infrastructure.yml → SF + CF stamp re-deploy

Distinguished by the deploy_workflow field on each entry, so the
materialized CHANGELOG.md can show both as separate items under the
same SHA.

Uses if: always() + ternary on job.status so failed deploys also
register in the log — the failure signal is itself a useful
provenance record.

Companion: alpha-engine-docs PR #3 (composite action + aggregator),
alpha-engine-data PR #120 (IAM grant — already merged).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(orchestration): SNS→S3 changelog incident mirror Lambda

Adds a small Lambda subscribed to the alpha-engine-alerts SNS topic
that mirrors every alert as one JSON entry under
s3://alpha-engine-research/changelog/incidents/. Closes the event-
mining loop alongside the deploy-side log: now both "what shipped"
and "what failed" feed the same time-ordered changelog.

Why
The 2026-05-01 weekday SF timeout cascade is the canonical example.
The deploy log records the 4 PRs that fixed it, but it never
captured the original SNS alert email at 06:01 PT — the failure
event itself. With this Lambda, that alert would have landed at
changelog/incidents/2026/05/01T13-01-XX_alpha-engine-alerts_*.json
with full subject + body, queryable months later for retro mining
("show me every SF failure incident this quarter").

Resources added (4)
- ChangelogIncidentMirrorRole       — minimal: PutObject scoped to
  changelog/incidents/* + AWSLambdaBasicExecutionRole for logs.
- ChangelogIncidentMirrorFunction   — python3.12, arm64, 256 MB,
  30s timeout. Inline ZipFile (~50 lines). Reads SNS Records,
  builds a JSON entry, S3 PutObject. No-ops cleanly on malformed
  timestamps (falls back to "now").
- ChangelogIncidentMirrorSubscription — SNS subscription on
  AlertsTopic with Protocol: lambda.
- ChangelogIncidentMirrorPermission — Lambda::Permission letting
  SNS invoke the function.

Schema (matches the deploy-side action's event_type discriminator)
{
  "ts_utc": ...,
  "event_type": "incident",
  "source": "alpha-engine-alerts",
  "subject": "...",
  "summary": "...",        // first 240 chars of subject or message line 1
  "details": "...",        // full message body
  "sns_message_id": "...",
  "topic_arn": "..."
}

Apply state
Already applied live via aws cloudformation execute-change-set;
smoke-tested with one SNS publish — entry landed at
s3://alpha-engine-research/changelog/incidents/2026/05/01T15-52-57_*
within 2s, schema validated, then cleaned up. This PR is the
codification of the source-of-truth template.

Companions
- alpha-engine-docs PR #5 (event_type schema + aggregator support)
- Future: flow-doctor S3 notifier, manual CLI helper.

Note on template description
The template's docstring says "Does NOT manage Lambda functions or
IAM roles." Strictly we now manage one of each — narrow exception
for the SNS-mirror because it's tightly coupled to AlertsTopic
defined here. Not updating the doc this commit; will revisit if a
second exception lands.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant