diff --git a/engine.py b/engine.py index c3ad724..eed7076 100644 --- a/engine.py +++ b/engine.py @@ -39,16 +39,51 @@ # [SEC A END] # [SEC B START] Greetings +GREETING = "Howdy from FEATURE" +SIGNOFF = "Thanks," GREETING = "Hello from MAIN v2" SIGNOFF = "Cheers," def greet(name): - # main style greeting with signoff inline - return f"{GREETING} {name}! {SIGNOFF}" + # feature chooses different punctuation & placement + return f"{SIGNOFF} {name}. {GREETING}" +# SEC B filler 001 +# SEC B filler 002 +# SEC B filler 003 +# SEC B filler 004 +# SEC B filler 005 +# SEC B filler 006 +# SEC B filler 007 +# SEC B filler 008 +# SEC B filler 009 +# SEC B filler 010 +# SEC B filler 011 +# SEC B filler 012 +# SEC B filler 013 +# SEC B filler 014 +# SEC B filler 015 +# SEC B filler 016 +# SEC B filler 017 +# SEC B filler 018 +# SEC B filler 019 +# SEC B filler 020 +# SEC B filler 021 +# SEC B filler 022 +# SEC B filler 023 +# SEC B filler 024 +# SEC B filler 025 +# SEC B filler 026 +# SEC B filler 027 +# SEC B filler 028 +# SEC B filler 029 +# SEC B filler 030 # [SEC B END] # [SEC C START] Math helpers def add(a, b): return a + b + +def multiply(a, b): + return a * b # SEC C filler 001 # SEC C filler 002 # SEC C filler 003 @@ -82,9 +117,9 @@ def add(a, b): # [SEC C END] # [SEC D START] Logger -LEVEL = "DEBUG" +LEVEL = "WARN" jdnfljdnfbondsfgbsfggssfgn def get_logger(): - fmt = "%(asctime)s [%(levelname)s] %(message)s" # main adds timestamp + fmt = "[%(levelname)s] %(name)s: %(message)s" # feature adds logger name return (LEVEL, fmt) # SEC D filler 001 # SEC D filler 002 @@ -119,10 +154,10 @@ def get_logger(): # [SEC D END] # [SEC E START] Versioning -VERSION = "2.0.0" +VERSION = "1.5.0" def compute_version(): - # main appends -main - return VERSION + "-main" + # feature appends -feature + return VERSION + "-feature" # SEC E filler 001 # SEC E filler 002 # SEC E filler 003 @@ -156,7 +191,8 @@ def compute_version(): # [SEC E END] # [SEC F START] Flags -FEATURE_X = False +FEATURE_X = True +FEATURE_Y = False # SEC F filler 001 # SEC F filler 002 # SEC F filler 003 @@ -190,8 +226,8 @@ def compute_version(): # [SEC F END] # [SEC G START] IO helpers -def write_file(p, text, mode="w"): - open(p, mode).write(text) +def write_file(p, text): + open(p, "w").write(text) # SEC G filler 001 # SEC G filler 002 # SEC G filler 003 @@ -226,7 +262,7 @@ def write_file(p, text, mode="w"): # [SEC H START] Main if __name__ == "__main__": - print(greet("MAIN")) + print(greet("world")) # SEC H filler 001 # SEC H filler 002 # SEC H filler 003 diff --git a/handbook.md b/handbook.md index 726910c..ff3cd51 100644 --- a/handbook.md +++ b/handbook.md @@ -38,10 +38,10 @@ version: 1 -# Chapter 2: Engineering Standards -- Use black/ruff (strict) -- 88-col limit -- Type hints enforced +# Chapter 2: Coding Standards +- Use black/ruff (lenient) +- 100-col limit +- Docstrings preferred, type hints optional @@ -77,6 +77,8 @@ version: 1 - main is protected - feature branches from main - rebase before merge +- PRs must reference a ticket +- Merge via squash @@ -144,10 +146,10 @@ version: 1 # Chapter 5: Release Process -- bump version (semver) -- tag release +- version bump via tool +- tag & sign release - publish artifacts -- smoke test in staging +- canary 10% for 1h @@ -181,8 +183,8 @@ version: 1 # Chapter 6: Incident Response - SEV1 page immediately -- Initial RCA within 24h -- Full postmortem within 72h +- RCA start within 48h +- Postmortem by end of week @@ -251,7 +253,6 @@ version: 1 # Chapter 8: FAQ - Q: Who owns releases? A: Dev Infra - Q: What’s the SLA? A: 99.9% -- Q: Do we support LTS? A: 12 months diff --git a/pipeline.sql b/pipeline.sql index 6711a85..1c3bd50 100644 --- a/pipeline.sql +++ b/pipeline.sql @@ -2,8 +2,6 @@ -- [STAGE 1 START] prepare users CREATE TEMP TABLE t_users AS --- main adds constraint --- (simulated) ALTER TABLE t_users ADD PRIMARY KEY (id); SELECT id, name, active FROM users WHERE deleted = false; @@ -118,7 +116,8 @@ LEFT JOIN purchases p ON p.user_id = a.id; CREATE TEMP TABLE t_rev AS SELECT id, SUM(amount * 1.05) AS revenue -- main applies uplift FROM t_join -GROUP BY id; +GROUP BY id +HAVING SUM(amount) > 0; -- S4 filler 001 -- S4 filler 002 -- S4 filler 003 @@ -152,8 +151,8 @@ GROUP BY id; -- [STAGE 4 END] -- [STAGE 5 START] write outputs -INSERT INTO reporting.users_daily (id, name, revenue, dt) -SELECT j.id, j.name, r.revenue, CURRENT_DATE +INSERT INTO reporting.users_daily (id, name, revenue, yyyymm) +SELECT j.id, j.name, r.revenue, TO_CHAR(CURRENT_DATE, 'YYYYMM') FROM t_join j JOIN t_rev r USING (id); -- main keeps dt as DATE partition @@ -190,7 +189,7 @@ JOIN t_rev r USING (id); -- [STAGE 5 END] -- [STAGE 6 START] finalize -VACUUM ANALYZE; +ANALYZE VERBOSE; -- feature alternative finalization -- S6 filler 001 -- S6 filler 002 -- S6 filler 003